magiblot / tvision

A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.
Other
2.04k stars 152 forks source link

Garbage and crash in Help window #1

Closed magiblot closed 5 years ago

magiblot commented 5 years ago

After a certain point in the commit history, the Help window started to trim its message from "No help is avaiable in this context." to "No help", often appended with garbage.

Screenshot_20190514_183817

I can also experience a crash when using the computers at college, reproducible by maximizing and then restoring the window without moving it around or resizing it.

Thread 1 "tvdemo" received signal SIGSEGV, Segmentation fault.
0x00007ffff6b891b2 in _int_free (av=0x7ffff6eae640 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4019

#0  0x00007ffff6b891b2 in _int_free (av=0x7ffff6eae640 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4019
#1  0x000000000043482e in deleteBlock (blk=0x7c0c10) at /dev/shm/tvision/source/tvision/new.cpp:188
#2  0x000000000043487a in operator delete[] (blk=0x7c0c10) at /dev/shm/tvision/source/tvision/new.cpp:200
#3  0x000000000040f5d5 in THelpViewer::draw (this=0x7be9a0) at /dev/shm/tvision/source/tvision/help.cpp:154
#4  0x000000000041356e in TView::drawView (this=0x7be9a0) at /dev/shm/tvision/source/tvision/tview.cpp:337
#5  0x00000000004171b0 in TScroller::changeBounds (this=0x7be9a0, bounds=...) at /dev/shm/tvision/source/tvision/tscrolle.cpp:65
#6  0x000000000040f1bb in THelpViewer::changeBounds (this=0x7be9a0, bounds=...) at /dev/shm/tvision/source/tvision/help.cpp:83
#7  0x0000000000423570 in doCalcChange (p=0x7be9a0, d=0x7fffffffd740) at /dev/shm/tvision/source/tvision/tgroup.cpp:65
#8  0x000000000043a1cf in TGroup::forEach (this=0x7be7b0, func=0x423514 <doCalcChange(TView*, void*)>, args=0x7fffffffd740) at /dev/shm/tvision/source/tvision/grp.cpp:51
#9  0x000000000042369f in TGroup::changeBounds (this=0x7be7b0, bounds=...) at /dev/shm/tvision/source/tvision/tgroup.cpp:97
#10 0x0000000000413d84 in TView::locate (this=0x7be7b0, bounds=...) at /dev/shm/tvision/source/tvision/tview.cpp:507
#11 0x0000000000410f98 in TWindow::zoom (this=0x7be7b0) at /dev/shm/tvision/source/tvision/twindow.cpp:229
#12 0x0000000000410ad9 in TWindow::handleEvent (this=0x7be7b0, event=...) at /dev/shm/tvision/source/tvision/twindow.cpp:139
#13 0x000000000042399e in TGroup::execute (this=0x7be7b0) at /dev/shm/tvision/source/tvision/tgroup.cpp:182
#14 0x0000000000423b06 in TGroup::execView (this=0x6a9cb0, p=0x7be7b0) at /dev/shm/tvision/source/tvision/tgroup.cpp:207
#15 0x0000000000407291 in TVDemo::getEvent (this=0x6a9cb0, event=...) at /dev/shm/tvision/examples/tvdemo/tvdemo1.cpp:145
#16 0x0000000000423980 in TGroup::execute (this=0x6a9cb0) at /dev/shm/tvision/source/tvision/tgroup.cpp:181
#17 0x0000000000419e5f in TProgram::run (this=0x6a9cb0) at /dev/shm/tvision/source/tvision/tprogram.cpp:279
#18 0x0000000000406adc in main (argc=1, argv=0x7fffffffdb08) at /dev/shm/tvision/examples/tvdemo/tvdemo1.cpp:63

Using openSUSE Leap 42.3, linux 4.4.165-81-default, gcc 4.8.5 and glibc 2.22.

magiblot commented 5 years ago

Fixed in b0121726853ea5d62430af0dd4ec3a4fbece7953 :) By looking at the trace I also realized new and delete are overloaded. I was completely unaware of it.