Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font rendering crash #17

Open
andrewrk opened this issue May 4, 2015 · 2 comments
Open

font rendering crash #17

andrewrk opened this issue May 4, 2015 · 2 comments
Labels

Comments

@andrewrk
Copy link
Owner

andrewrk commented May 4, 2015

seems to be a sporadic failure. current sha1: 89e2ba0

gdb session:

andy@andy-bx:~/dev/genesis/build$ make && gdb ./genesis -ex run -ex quit 
[ 13%] Built target libgenesis_shared
[ 14%] Built target delay
[ 18%] Built target generate_unicode_data
Scanning dependencies of target genesis
[ 19%] Building CXX object CMakeFiles/genesis.dir/src/genesis_editor.cpp.o
Linking CXX executable genesis
[ 60%] Built target genesis
[ 74%] Built target libgenesis_static
[ 75%] Built target list_devices
[ 77%] Built target list_supported_formats
[ 78%] Built target normalize_audio
[ 79%] Built target play
[ 79%] Built target rucksack_bundle
[ 80%] Built target synth
[100%] Built target unit_tests
GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./genesis...done.
Starting program: /home/andy/dev/genesis/build/genesis 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffde560700 (LWP 13578)]
[New Thread 0x7fffded61700 (LWP 13577)]
[New Thread 0x7fffe4f50700 (LWP 13576)]
[New Thread 0x7fffe9752700 (LWP 13575)]

Program received signal SIGSEGV, Segmentation fault.
0x0000000000427598 in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::key_to_index (
    this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:221
221         return (int)(HashFunction(key) % ((uint32_t)_capacity));
A debugging session is active.

    Inferior 1 [process 13571] will be killed.

Quit anyway? (y or n) n
Not confirmed.
(gdb) up
#1  0x00000000004272d1 in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::internal_get
    (this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:206
206         int start_index = key_to_index(key);
(gdb) 
#2  0x00000000004270bb in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::maybe_get (
    this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:70
70          return internal_get(key);
(gdb) 
#3  0x0000000000426c92 in FontSize::font_cache_entry (this=0x1, codepoint=85)
    at /home/andy/dev/genesis/src/font_size.cpp:38
38      auto *entry = _font_cache.maybe_get(codepoint);
(gdb) 
#4  0x0000000000421e5e in Label::update (this=0x791118) at /home/andy/dev/genesis/src/label.cpp:112
112         FontCacheValue entry = _font_size->font_cache_entry(ch);
(gdb) 
#5  0x000000000043406c in MenuWidgetItem::set_caption (this=0x791110, caption=..., new_mnemonic_index=0)
    at /home/andy/dev/genesis/src/menu_widget.cpp:68
68      label.update();
(gdb) 
#6  0x0000000000434010 in MenuWidgetItem::set_caption (this=0x791110, orig_caption=...)
    at /home/andy/dev/genesis/src/menu_widget.cpp:63
63      return set_caption(caption, mnemonic_index);
(gdb) 
#7  0x000000000042c851 in GenesisEditor::refresh_menu_state (this=0x75a8c0)
    at /home/andy/dev/genesis/src/genesis_editor.cpp:251
251         editor_window->undo_menu->set_caption(undo_caption);
(gdb) print undo_caption
$1 = {static max_codepoint = 2097151, _chars = {_items = 0xd335a0, _length = 5, _capacity = 16}}
(gdb) print undo_caption.encode()
$2 = {_buffer = {_items = 0xa762f0 "&Undo", _length = 6, _capacity = 16}}
(gdb) down
#6  0x0000000000434010 in MenuWidgetItem::set_caption (this=0x791110, orig_caption=...)
    at /home/andy/dev/genesis/src/menu_widget.cpp:63
63      return set_caption(caption, mnemonic_index);
(gdb) 
#5  0x000000000043406c in MenuWidgetItem::set_caption (this=0x791110, caption=..., new_mnemonic_index=0)
    at /home/andy/dev/genesis/src/menu_widget.cpp:68
68      label.update();
(gdb) 
#4  0x0000000000421e5e in Label::update (this=0x791118) at /home/andy/dev/genesis/src/label.cpp:112
112         FontCacheValue entry = _font_size->font_cache_entry(ch);
(gdb) 
#3  0x0000000000426c92 in FontSize::font_cache_entry (this=0x1, codepoint=85)
    at /home/andy/dev/genesis/src/font_size.cpp:38
38      auto *entry = _font_cache.maybe_get(codepoint);
(gdb) 
#2  0x00000000004270bb in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::maybe_get (
    this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:70
70          return internal_get(key);
(gdb) 
#1  0x00000000004272d1 in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::internal_get
    (this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:206
206         int start_index = key_to_index(key);
(gdb) 
#0  0x0000000000427598 in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::key_to_index
    (this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:221
221         return (int)(HashFunction(key) % ((uint32_t)_capacity));
(gdb) 
Bottom (innermost) frame selected; you cannot go down.
(gdb) up
#1  0x00000000004272d1 in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::internal_get
    (this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:206
206         int start_index = key_to_index(key);
(gdb) print key
$3 = (const unsigned int &) @0x7fffffffda3c: 85
(gdb) up
#2  0x00000000004270bb in HashMap<unsigned int, FontCacheValue, &(hash_uint32_t(unsigned int const&))>::maybe_get (
    this=0x9, key=@0x7fffffffda3c: 85) at /home/andy/dev/genesis/src/hash_map.hpp:70
70          return internal_get(key);
(gdb) up
#3  0x0000000000426c92 in FontSize::font_cache_entry (this=0x1, codepoint=85)
    at /home/andy/dev/genesis/src/font_size.cpp:38
38      auto *entry = _font_cache.maybe_get(codepoint);
(gdb) print codeponit
No symbol "codeponit" in current context.
(gdb) print codepoint
$4 = 85
(gdb) print _font_cache 
Cannot access memory at address 0x9
(gdb) print *this
Cannot access memory at address 0x1
(gdb) up
#4  0x0000000000421e5e in Label::update (this=0x791118) at /home/andy/dev/genesis/src/label.cpp:112
112         FontCacheValue entry = _font_size->font_cache_entry(ch);
(gdb) print *this
$5 = {_gui = 0x100003503, _width = 0, _height = 0, _texture_id = 0, _vertex_buffer = 0, _text = {
    static max_codepoint = 2097151, _chars = {_items = 0xd769a0, _length = 4, _capacity = 16}}, _font_size = 0x1, 
  _img_buffer = {_buffer = {_items = 0xaf7b50 "\240e{", _length = 2, _capacity = 16}}, _letters = {_items = 0x0, 
    _length = 0, _capacity = 0}}
(gdb) quit
A debugging session is active.

    Inferior 1 [process 13571] will be killed.

Quit anyway? (y or n) y
@andrewrk andrewrk added the bug label May 4, 2015
@andrewrk
Copy link
Owner Author

andrewrk commented May 4, 2015

oops, spoke too soon. this is a bug I caused while developing locally.

@andrewrk andrewrk closed this as completed May 4, 2015
@andrewrk
Copy link
Owner Author

Program received signal SIGSEGV, Segmentation fault.
0x0000000000427a8a in HashMap<int, FontSize*, &(hash_int(int const&))>::key_to_index (this=0x100000028000150, 
    key=@0x7fffffffda74: 12) at /home/andy/dev/genesis/src/hash_map.hpp:221
    key=@0x7fffffffda74: 12) at /home/andy/dev/genesis/src/hash_map.hpp:70
#3  0x00000000004264b4 in Gui::get_font_size (this=0x100000028000000, font_size=12)
    at /home/andy/dev/genesis/src/gui.cpp:134
#4  0x0000000000428ae9 in Label::set_font_size (this=0x77bd40, size=12) at /home/andy/dev/genesis/src/label.cpp:240
#5  0x0000000000427bda in Label::Label (this=0x77bd40, gui=0x100000028000000)
    at /home/andy/dev/genesis/src/label.cpp:17
#6  0x0000000000446247 in create<Label, Gui*> () at /home/andy/dev/genesis/src/util.hpp:21
#7  0x0000000000445ba9 in TrackEditorWidget::create_gui_track (this=0x20a3070)
    at /home/andy/dev/genesis/src/track_editor_widget.cpp:155
#8  0x0000000000445854 in TrackEditorWidget::update_model (this=0x20a3070)
    at /home/andy/dev/genesis/src/track_editor_widget.cpp:119
#9  0x0000000000444f9a in on_tracks_changed (userdata=0x20a3070)
    at /home/andy/dev/genesis/src/track_editor_widget.cpp:27
#10 0x0000000000426f03 in EventDispatcher::trigger (this=0xbc40e0, event=EventProjectTracksChanged)
    at /home/andy/dev/genesis/src/event_dispatcher.hpp:62
#11 0x0000000000447f6e in trigger_event (project=0xbc3f40, event=EventProjectTracksChanged)
    at /home/andy/dev/genesis/src/project.cpp:722
#12 0x000000000044802e in project_compute_indexes (project=0xbc3f40) at /home/andy/dev/genesis/src/project.cpp:734
#13 0x0000000000449bfa in project_insert_track (project=0xbc3f40, before=0x20b7ba0, after=0x0)
    at /home/andy/dev/genesis/src/project.cpp:1322
#14 0x0000000000444f3e in insert_track_after_handler (userdata=0x16001d0)
    at /home/andy/dev/genesis/src/track_editor_widget.cpp:17
#15 0x000000000043ca87 in MenuWidgetItem::activate (this=0x16094f0)
    at /home/andy/dev/genesis/src/menu_widget.cpp:267
#16 0x000000000043d364 in ContextMenuWidget::on_key_event (this=0x20facb0, event=0x7fffffffde90)
    at /home/andy/dev/genesis/src/menu_widget.cpp:408
#17 0x0000000000435de2 in GuiWindow::key_callback (this=0xb7ffa0, key=65, scancode=38, action=1, mods=0)
    at /home/andy/dev/genesis/src/gui_window.cpp:267
#18 0x00000000004350e3 in static_key_callback (window=0xbca330, key=65, scancode=38, action=1, mods=0)
    at /home/andy/dev/genesis/src/gui_window.cpp:44
#19 0x00007ffff72ce8dc in ?? () from /usr/lib/x86_64-linux-gnu/libglfw.so.3
#20 0x00000000004263ba in Gui::exec (this=0x7b3040) at /home/andy/dev/genesis/src/gui.cpp:120
#21 0x0000000000431a94 in GenesisEditor::exec (this=0x7fffffffe1a0)
    at /home/andy/dev/genesis/src/genesis_editor.cpp:353
#22 0x0000000000420957 in main (argc=1, argv=0x7fffffffe2e8) at /home/andy/dev/genesis/src/main.cpp:8

@andrewrk andrewrk reopened this May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant