Opened 11 years ago

Closed 11 years ago

#11133 closed defect (fixed)

wx apps (including samples) hangs on start

Reported by: powerman Owned by:
Priority: critical Milestone: 2.9.1
Component: wxGTK Version: stable-latest
Keywords: fluxbox Cc: dghart@…
Blocked By: Blocking:
Patch: no

Description

On my system (Hardened Gentoo Linux, kernel 2.6.28, glibc-2.9, gcc-3.4.6, gtk+-2.14.7) wx samples apps from svn hangs on start (last stable wx 2.8.10 works ok).

According to strace, they all hangs at
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, -1

I'll attach full strace log for running samples/text/text (wx built with --enable-debug --disable-utf8 --disable-shared).

Attachments (1)

log download (101.1 KB) - added by powerman 11 years ago.
strace log for samples/text/text

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by powerman

strace log for samples/text/text

comment:1 Changed 11 years ago by vadz

  • Status changed from new to infoneeded_new

Unfortunately, strace is not very informative. Could you please rather run the application under gdb and press Ctrl-C when it hangs and send us the output from bt command?

Also, do you know what exact svn revision are you using?

Thanks!

comment:2 Changed 11 years ago by powerman

  • Status changed from infoneeded_new to new

I'm using svn revision 61725, but I've also checked several other revisions between 1st Apr 09 and today, all hangs in same way and only 2.8.10 works ok.

As for gdb, I has no experience with it. If you provide more detailed instructions I'll provide more informations. Backtrace I got doesn't very helpful and I've no idea where to get needed symbols, because wx already build in debug mode, and samples/text application built with -g flag:

wxWidgets-svn/samples/text $ make
/home/powerman/download/qsp/qsp-svn/wxWidgets-svn/bk-deps g++ -c -o text_text.o -DWXGTK -I. -I./../../samples -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -DWXDEBUG -I/home/powerman/download/qsp/qsp-svn/wxWidgets-svn/lib/wx/include/gtk2-unicode-debug-static-2.9 -I../../include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/X11R6/include -DWX_PRECOMP -pthread -g -O0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 ./text.cpp
g++ -o text text_text.o -L/home/powerman/download/qsp/qsp-svn/wxWidgets-svn/lib -pthread -L/usr/X11R6/lib -lwx_gtk2ud_core-2.9 -lwx_baseud-2.9 -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lXxf86vm -lSM -lpng -lz -ljpeg -ltiff -lwxregexud-2.9 -pthread -L/usr/X11R6/lib -lz -ldl -lm -lz -ldl -lm

$ ls -l text
-rwxr-xr-x 1 powerman users 57845390 Aug 21 22:17 text

wxWidgets-svn/samples/text $ gdb
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-linux-gnu".
(gdb) file text
Reading symbols from /usr/src/qsp/qsp-svn/wxWidgets-svn/samples/text/text...done.
(gdb) run
Starting program: /usr/src/qsp/qsp-svn/wxWidgets-svn/samples/text/text
C
Program received signal SIGINT, Interrupt.
0x506f3422 in ?? ()
(gdb) bt
#0 0x506f3422 in ?? ()
#1 0x4fbdde8d in ?? ()
#2 0x4ff97d38 in ?? ()
#3 0xffffffff in ?? ()
#4 0x15e04888 in ?? ()
#5 0x5d34b968 in ?? ()
#6 0x4feedba8 in ?? ()
#7 0x15eeb118 in ?? ()
#8 0x00000002 in ?? ()
#9 0x15eeb118 in ?? ()
#10 0x00000002 in ?? ()
#11 0x4fc6340e in ?? ()
#12 0x4feed7a8 in ?? ()
#13 0x15e0488c in ?? ()
#14 0x15eeac88 in ?? ()
#15 0x5d34b938 in ?? ()
#16 0x4fbdde50 in ?? ()
#17 0x4ff98160 in ?? ()
#18 0x4ff98158 in ?? ()
#19 0x4ff98588 in ?? ()
#20 0x15eeb118 in ?? ()
#21 0x00000002 in ?? ()
#22 0xffffffff in ?? ()
#23 0x7fffffff in ?? ()
#24 0x00000000 in ?? ()
(gdb) quit
The program is running. Exit anyway? (y or n) y

comment:3 Changed 11 years ago by powerman

Ok, I managed to get stack trace (had to switch off PaX protection, plus I've rebuild gtk+-2 and glib with debug symbols):

(gdb) run
Starting program: /usr/src/qsp/qsp-svn/wxWidgets-svn/samples/text/text
[Thread debugging using libthread_db enabled]
[New Thread 0xb697f700 (LWP 13691)]
C
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xb697f700 (LWP 13691)]
0xb795e422 in kernel_vsyscall ()
(gdb) bt
#0 0xb795e422 in
kernel_vsyscall ()
#1 0xb6ce2e8d in poll () from /lib/libc.so.6
#2 0xb6ffdcc0 in g_main_context_poll (context=0xb823c7f0, timeout=-1,

priority=2147483647, fds=0xb8323118, n_fds=2) at gmain.c:3091

#3 0xb6ffcf33 in g_main_context_iterate (context=0xb823c7f0, block=1,

dispatch=1, self=0xb8221940) at gmain.c:2773

#4 0xb6ffd805 in IAg_main_loop_run (loop=0xb8322c88) at gmain.c:2986
#5 0xb75a6559 in IA
gtk_main () at gtkmain.c:1200
#6 0xb7b83cc4 in wxGUIEventLoop::Run (this=0xb8322db8)

at ./src/gtk/evtloop.cpp:58

#7 0xb7c387f6 in wxAppConsoleBase::MainLoop (this=0xb821a7d0)

at ./src/common/appbase.cpp:290

#8 0xb7c384c8 in wxAppConsoleBase::OnRun (this=0xb821a7d0)

at ./src/common/appbase.cpp:231

#9 0xb7a89b69 in wxAppBase::OnRun (this=0xb821a7d0)

at ./src/common/appcmn.cpp:285

#10 0xb7c99a15 in wxEntry (argc=@0xb81f930c, argv=0xb8209858)

at ./src/common/init.cpp:447

#11 0xb7c99bbb in wxEntry (argc=@0xbfffe0d0, argv=0xbfffe164)

at ./src/common/init.cpp:459

#12 0xb79e86c5 in main (argc=1, argv=0xbfffe164) at ./text.cpp:420

comment:4 Changed 11 years ago by vadz

  • Component changed from base to wxGTK
  • Keywords unreproducible added

Let me paste a non-mangled backtrace for future reference:

 (gdb) run
 Starting program: /usr/src/qsp/qsp-svn/wxWidgets-svn/samples/text/text
 [Thread debugging using libthread_db enabled]
 [New Thread 0xb697f700 (LWP 13691)]
 ^C
 Program received signal SIGINT, Interrupt.
 [Switching to Thread 0xb697f700 (LWP 13691)]
 0xb795e422 in __kernel_vsyscall ()
 (gdb) bt
 #0  0xb795e422 in __kernel_vsyscall ()
 #1  0xb6ce2e8d in poll () from /lib/libc.so.6
 #2  0xb6ffdcc0 in g_main_context_poll (context=0xb823c7f0, timeout=-1,
     priority=2147483647, fds=0xb8323118, n_fds=2) at gmain.c:3091
 #3  0xb6ffcf33 in g_main_context_iterate (context=0xb823c7f0, block=1,
     dispatch=1, self=0xb8221940) at gmain.c:2773
 #4  0xb6ffd805 in IA__g_main_loop_run (loop=0xb8322c88) at gmain.c:2986
 #5  0xb75a6559 in IA__gtk_main () at gtkmain.c:1200
 #6  0xb7b83cc4 in wxGUIEventLoop::Run (this=0xb8322db8)
     at ./src/gtk/evtloop.cpp:58
 #7  0xb7c387f6 in wxAppConsoleBase::MainLoop (this=0xb821a7d0)
     at ./src/common/appbase.cpp:290
 #8  0xb7c384c8 in wxAppConsoleBase::OnRun (this=0xb821a7d0)
     at ./src/common/appbase.cpp:231
 #9  0xb7a89b69 in wxAppBase::OnRun (this=0xb821a7d0)
     at ./src/common/appcmn.cpp:285
 #10 0xb7c99a15 in wxEntry (argc=@0xb81f930c, argv=0xb8209858)
     at ./src/common/init.cpp:447
 #11 0xb7c99bbb in wxEntry (argc=@0xbfffe0d0, argv=0xbfffe164)
     at ./src/common/init.cpp:459
 #12 0xb79e86c5 in main (argc=1, argv=0xbfffe164) at ./text.cpp:420

Unfortunately I really don't see anything wrong with this, this is a perfectly normal stack and we ought to be getting events from GTK+ -- but it appears that we don't, somehow :-( What happens if you do "finish" now in gdb, does it really never return from poll()?

comment:5 Changed 11 years ago by powerman

It return from poll, but that took about a minute or so:

(gdb) run
Starting program: /usr/src/qsp/qsp-svn/wxWidgets-svn/samples/text/text 
[Thread debugging using libthread_db enabled]
[New Thread 0xb69c9700 (LWP 8906)]
^C
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xb69c9700 (LWP 8906)]
0xb7896422 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7896422 in __kernel_vsyscall ()
#1  0xb6d2ce8d in poll () from /lib/libc.so.6
#2  0xb703cbc4 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#3  0xb703cf84 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#4  0xb755fe6e in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0xb7abbcc4 in wxGUIEventLoop::Run (this=0xb825adb8)
    at ./src/gtk/evtloop.cpp:58
#6  0xb7b707f6 in wxAppConsoleBase::MainLoop (this=0xb81527d0)
    at ./src/common/appbase.cpp:290
#7  0xb7b704c8 in wxAppConsoleBase::OnRun (this=0xb81527d0)
    at ./src/common/appbase.cpp:231
#8  0xb79c1b69 in wxAppBase::OnRun (this=0xb81527d0)
    at ./src/common/appcmn.cpp:285
#9  0xb7bd1a15 in wxEntry (argc=@0xb813130c, argv=0xb8141858)
    at ./src/common/init.cpp:447
#10 0xb7bd1bbb in wxEntry (argc=@0xbfffe2b0, argv=0xbfffe344)
    at ./src/common/init.cpp:459
#11 0xb79206c5 in main (argc=1, argv=0xbfffe344) at ./text.cpp:420
(gdb) finish 
Run till exit from #0  0xb7896422 in __kernel_vsyscall ()
0xb6d2ce8d in poll () from /lib/libc.so.6
(gdb)

I've tried to start ./text and wait 3 minutes - no changes, it still hang.
Then I attached strace to it and got this:

Process 10330 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>) = 1

30-60 seconds later I got this:

ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1\17\222!\4\0\30\10\0\20\1\0\0\0\0\1\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1\337\227!\4\0\30\10\0\20\0\0\0\0\0\0\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1\240\317!\4\0\30\10\0\20\1\0\0\0\0\1\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1#\323!\4\0\30\10\0\20\0\0\0\0\0\0\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1

and it hangs again... then, 60-120 seconds later it continue:

) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1j\233#\4\0\30\10\0\20\1\0\0\0\0\1\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1) = 1 ([{fd=4, revents=POLLIN}])
ioctl(4, FIONREAD, [32])                = 0
read(4, "d\2j\1p\236#\4\0\30\10\0\20\0\0\0\0\0\0\30\30\30\30\30\0\0\220\0\0\0\226\5"..., 32) = 32
ioctl(4, FIONREAD, [0])                 = 0
poll([{fd=5, events=POLLIN}, {fd=4, events=POLLIN}], 2, -1

and hangs again.

comment:6 Changed 11 years ago by dghart

  • Cc dghart@… added

Which window-manager do you use? I'm chasing a similar problem atm that occurs since r50435 when using fluxbox.

comment:7 Changed 11 years ago by powerman

Yeah, I'm using fluxbox-1.1.1.

comment:8 Changed 11 years ago by vadz

  • Keywords fluxbox added
  • Status changed from new to confirmed

I don't see how could r50435 could result in this when this code is not used at all in the text sample but it's nice to know at least that the problem is fluxbox-specific. And if you could try to bisect the history further to find the revision which really introduced the problem it would, of course, be great. Otherwise I'll probably have to install it here to debug it myself, right now I can only say that wx apps run fine under openbox (which I thought was similar to fluxbox but I could be wrong) on my Linux netbook.

comment:9 Changed 11 years ago by powerman

On my system r50435 works ok, r50436 hangs. The r50436 changes src/gtk/toplevel.cpp.

comment:10 Changed 11 years ago by vadz

  • Cc pcor added

Sorry, I didn't realize I had to look at the next revision, not this one. And thanks for finding the change which introduced the bug!

Unfortunately I don't really understand this code well enough to see what is wrong with it. I hope Paul (cc'd) might have a look at it, if not I'll try to get back to it before 2.9.1.

comment:11 Changed 11 years ago by powerman

To fix this issue it's enough to comment these two lines in trunk:
http://trac.wxwidgets.org/browser/wxWidgets/trunk/src/gtk/toplevel.cpp#L855
http://trac.wxwidgets.org/browser/wxWidgets/trunk/src/gtk/toplevel.cpp#L856

But I've no idea is that change will broke anything else.

comment:12 Changed 11 years ago by dghart

Sorry, I didn't realize I had to look at the next revision

My apologies; I'd accidentally taken the revision number from the wrong side of the viewvc diff.

The problem is in wxTopLevelWindowGTK::Show. I've now had a chance to step through the code. Using kde, the call to gdk_x11_screen_supports_net_wm_hint on line 804 returns false, so deferShow stays false and the code block at 821 isn't run.

Using fluxbox gdk_x11_screen_supports_net_wm_hint returns true, so 821 is run, line 855 sets m_isShown true, then the function returns without calling wxTopLevelWindowBase::Show. The app then proceeds to the event-loop, where it remains.

Presumably there was supposed to be another call to wxTopLevelWindowGTK::Show to check for m_deferShow being true. I don't know where it should come from, though.

comment:13 Changed 11 years ago by pcor

  • Cc pcor removed

It appears this WM's support for _NET_FRAME_EXTENTS is broken. I'll look into it.

comment:14 Changed 11 years ago by pcor

  • Keywords unreproducible removed
  • Resolution set to fixed
  • Status changed from confirmed to closed

Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken. Workaround committed in r61769.

Note: See TracTickets for help on using tickets.