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

Crash when zooming out enough. #9967

Closed
pouar opened this issue Nov 10, 2014 · 5 comments · Fixed by #10005
Closed

Crash when zooming out enough. #9967

pouar opened this issue Nov 10, 2014 · 5 comments · Fixed by #10005
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes.

Comments

@pouar
Copy link
Contributor

pouar commented Nov 10, 2014

here's the output from gdb

[pouar@PouarArch Cataclysm-DDA]$ gdb ./cataclysm-tiles
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 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-unknown-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 ./cataclysm-tiles...done.
(gdb) run
Starting program: /home/pouar/Downloads/vcs-repos/git/Cataclysm-DDA/cataclysm-tiles 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7ffff4dbe700 (LWP 14241)]
[New Thread 0x7fffed251700 (LWP 14242)]
[New Thread 0x7fffe66b9700 (LWP 14243)]
[Thread 0x7fffe66b9700 (LWP 14243) exited]
terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_default_append

Program received signal SIGABRT, Aborted.
0x00007ffff6b198d7 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007ffff6b198d7 in raise () from /lib/libc.so.6
#1  0x00007ffff6b1ac6a in abort () from /lib/libc.so.6
#2  0x00007ffff73fbfcd in __gnu_cxx::__verbose_terminate_handler() () from /lib/libstdc++.so.6
#3  0x00007ffff73f9e56 in __cxxabiv1::__terminate(void (*)()) () from /lib/libstdc++.so.6
#4  0x00007ffff73f9ea1 in std::terminate() () from /lib/libstdc++.so.6
#5  0x00007ffff73fa0b8 in __cxa_throw () from /lib/libstdc++.so.6
#6  0x00007ffff7453c96 in std::__throw_length_error(char const*) () from /lib/libstdc++.so.6
#7  0x000000000060118b in std::__cxx1998::vector<curseline, std::allocator<curseline> >::_M_check_len (this=0x5ec5a08, __n=18446744073709551612, __s=0x102228d "vector::_M_default_append") at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/stl_vector.h:1425
#8  0x0000000000600d22 in std::__cxx1998::vector<curseline, std::allocator<curseline> >::_M_default_append (this=0x5ec5a08, __n=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/vector.tcc:555
#9  0x0000000000600be1 in std::__cxx1998::vector<curseline, std::allocator<curseline> >::resize (this=0x5ec5a08, __new_size=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/stl_vector.h:676
#10 0x00000000005f74df in std::__debug::vector<curseline, std::allocator<curseline> >::resize (this=0x5ec5a08, __sz=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/debug/vector:287
#11 0x0000000000b8e9d9 in newwin (nlines=-4, ncols=55, begin_y=72, begin_x=150) at src/cursesport.cpp:72
#12 0x000000000061f3d9 in game::init_ui (this=0x26dc030) at src/game.cpp:482
#13 0x00000000005f4aa8 in rescale_tileset (size=4) at src/sdltiles.cpp:1638
#14 0x0000000000687086 in game::zoom_in (this=0x26dc030) at src/game.cpp:9946
#15 0x0000000000638bef in game::handle_action (this=0x26dc030) at src/game.cpp:3935
#16 0x0000000000631dcb in game::do_turn (this=0x26dc030) at src/game.cpp:1424
#17 0x0000000000b3f1d1 in main (argc=0, argv=0x7fffffffdab0) at src/main.cpp:290
(gdb) 
@KA101 KA101 added the <Crash / Freeze> Fatal bug that results in hangs or crashes. label Nov 11, 2014
@narc0tiq
Copy link
Contributor

Woo, a -4 line window. That wasn't going to end well.

On Tue, Nov 11, 2014 at 1:56 AM, pouar notifications@github.com wrote:

here's the output from gdb

[pouar@PouarArch Cataclysm-DDA]$ gdb ./cataclysm-tiles
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 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-unknown-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 ./cataclysm-tiles...done.
(gdb) run
Starting program: /home/pouar/Downloads/vcs-repos/git/Cataclysm-DDA/cataclysm-tiles
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7ffff4dbe700 (LWP 14241)]
[New Thread 0x7fffed251700 (LWP 14242)]
[New Thread 0x7fffe66b9700 (LWP 14243)]
[Thread 0x7fffe66b9700 (LWP 14243) exited]
terminate called after throwing an instance of 'std::length_error'
what(): vector::_M_default_append

Program received signal SIGABRT, Aborted.
0x00007ffff6b198d7 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007ffff6b198d7 in raise () from /lib/libc.so.6
#1 0x00007ffff6b1ac6a in abort () from /lib/libc.so.6
#2 0x00007ffff73fbfcd in __gnu_cxx::__verbose_terminate_handler() () from /lib/libstdc++.so.6
#3 0x00007ffff73f9e56 in __cxxabiv1::__terminate(void (_)()) () from /lib/libstdc++.so.6
#4 0x00007ffff73f9ea1 in std::terminate() () from /lib/libstdc++.so.6
#5 0x00007ffff73fa0b8 in __cxa_throw () from /lib/libstdc++.so.6
#6 0x00007ffff7453c96 in std::_throw_length_error(char const) () from /lib/libstdc++.so.6
#7 0x000000000060118b in std::__cxx1998::vector<curseline, std::allocator >::_M_check_len (this=0x5ec5a08, __n=18446744073709551612, __s=0x102228d "vector::_M_default_append") at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/stl_vector.h:1425
#8 0x0000000000600d22 in std::__cxx1998::vector<curseline, std::allocator >::_M_default_append (this=0x5ec5a08, __n=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/vector.tcc:555
#9 0x0000000000600be1 in std::__cxx1998::vector<curseline, std::allocator >::resize (this=0x5ec5a08, __new_size=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/bits/stl_vector.h:676
#10 0x00000000005f74df in std::__debug::vector<curseline, std::allocator >::resize (this=0x5ec5a08, __sz=18446744073709551612) at /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/debug/vector:287
#11 0x0000000000b8e9d9 in newwin (nlines=-4, ncols=55, begin_y=72, begin_x=150) at src/cursesport.cpp:72
#12 0x000000000061f3d9 in game::init_ui (this=0x26dc030) at src/game.cpp:482
#13 0x00000000005f4aa8 in rescale_tileset (size=4) at src/sdltiles.cpp:1638
#14 0x0000000000687086 in game::zoom_in (this=0x26dc030) at src/game.cpp:9946
#15 0x0000000000638bef in game::handle_action (this=0x26dc030) at src/game.cpp:3935
#16 0x0000000000631dcb in game::do_turn (this=0x26dc030) at src/game.cpp:1424
#17 0x0000000000b3f1d1 in main (argc=0, argv=0x7fffffffdab0) at src/main.cpp:290
(gdb)


Reply to this email directly or view it on GitHub
#9967.

@pouar
Copy link
Contributor Author

pouar commented Nov 11, 2014

results of git bisect

8f550f06190e9dc20ff29d6c64f98a096b6f8206 is the first bad commit
commit 8f550f06190e9dc20ff29d6c64f98a096b6f8206
Author: Thomas Kirsten <tho_ki@gmx.de>
Date:   Sat Nov 8 00:27:21 2014 +0100

    Wide sidebar: make the message log go down to the bottom of the screen.

    This occupies the previously unused space and erases / redraws it when the sidebar is redrawn.
    The window w_hp goes also down to the same line as w_mesages, so it occupies and erases the space between the messages window and the terrain window.

:040000 040000 1ebb542ecb32b30217af6b72dd5ef545ee82dddb 0fed7b432820134dfee70ca42fd42a55aebe8ba2 M      src

@narc0tiq
Copy link
Contributor

Which brings us to PR #9904.

For reference, the relevant line in game.cpp where the invalid height was passed to newwin is contained in this context:

    }
    liveview.init(mouse_view_x, mouseview_y, sidebarWidth, mouseview_h);

    w_status2 = newwin(stat2H, stat2W, _y + stat2Y, _x + stat2X); // LINE 482 HERE
    werase(w_status2);
}

Where, a few lines earlier, stat2H = TERMY - stat2Y;. Incidentally, from the backtrace it looks like it was actually zooming in, not out, and had reached rescale_tileset(size=4).

@narc0tiq
Copy link
Contributor

So, @pouar, narrow sidebar or wide? I'm guessing the latter, since the former would just make stat2H = 2, which is quite a different number from -4.

@pouar
Copy link
Contributor Author

pouar commented Nov 11, 2014

wide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants