Yuriy Shevchuk wrote:
> Hello all!
> Can anyone, please,suggest me what to do with this kind of error:

(1) run it with valgrind
(2) compile and run it with FLTK 1.3

See comments below ...

> Thread 1 (Thread 0xb7a286d0 (LWP 25230)):
> #0  0xb7b95c13 in _int_malloc () from /lib/libc.so.6
> #1  0xb7b97b2d in malloc () from /lib/libc.so.6
> #2  0xb7dbeccb in ?? () from /usr/lib/libX11.so.6
> #3  0x00000010 in ?? ()
> #4  0x081133d0 in ?? ()
> #5  0xbfb165e8 in ?? ()
> #6  0xb7dbf473 in XUnionRectWithRegion () from /usr/lib/libX11.so.6
> #7  0xb7dbf51e in XIntersectRegion () from /usr/lib/libX11.so.6

The code above is in libX11, we can assume that this is okay (but of course not 
for sure ;-) )

> #8  0x080b5991 in fl_push_clip ()
> #9  0x080a614e in Fl_Input_::drawtext ()
> #10 0x080a4658 in Fl_Input::draw ()

This shows that Fl_Double_Window::flush() calls Fl_Input::draw(). That's okay 
and ought to work, unless something like a wrong pointer or deleted widget is 
used here. Since it happens in fl_push_clip(), it looks like something with the 
widget coordinates and/or size might be wrong.

> #11 0x080a2deb in Fl_Group::update_child ()
> #12 0x080a2ecf in Fl_Group::draw_children ()
> #13 0x080ab257 in Fl_Window::draw ()
> #14 0x080a1397 in Fl_Double_Window::flush ()
> #15 0x080a1426 in Fl_Double_Window::flush ()
> #16 0x0809d1ae in Fl::flush ()
> #17 0x0809d40d in Fl::wait ()
> #18 0x0809d497 in Fl::run ()
> #19 0x08089f52 in main (argc=-1078823452, argv=0x0) at main.cpp:1120
> 
> 
> I have two threads in my program. This is backtrace from GDB.
> I had problems with threads some time ago. I used FL::flush in not 
> appropriate place in thread #2. I've changed it to FL::awake. For some time 
> there were no problems, but now I have above-mentioned error. I use FLTK 
> 1.1.9.

The threads look okay. So, if you can run your program with valgrind, and if 
you 
are deleting a widget where it shouldn't be deleted, then valgrind can show you 
the point where it is deleted. This can (e.g.) happen if you allocate widgets 
as 
local variables in a subroutine, and these widgets go out of scope at the end 
of 
the subroutine.

FLTK 1.3 has a new feature to remove widgets that are deleted from their parent 
groups. If this happens in your program, then you should see that there are 
some 
widgets missing. You can compile and link your program with FLTK 1.3 without 
"installing" FLTK 1.3. If you need help with this, please ask again.

Of course there are lots of other possibilities to overwrite pointers or other 
variables.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to