Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#40931 closed defect (fixed)

Programs using wxWidgets-3.0 @3.0.0_2 fails to show GUI on OS X 10.9 Mavericks

Reported by: jxy (Xiao-Yong) Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: mavericks Cc: jyrkiwahlstedt
Port: wxWidgets-3.0

Description

The program, gnuplot @4.6.4_0+luaterm+pangocairo+wxwidgets-aquaterm-x11, hangs before showing any plot window.

I also tried a simple hello-world program, which compiles and links fine, but fail to show any GUI window upon starting from the commandline. Backtrace upon ctrl-C shows the following,

(lldb) bt
* thread #1: tid = 0xf2999, 0x00007fff8710fa1a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
    frame #0: 0x00007fff8710fa1a libsystem_kernel.dylib`mach_msg_trap + 10
    frame #1: 0x00007fff8710ed18 libsystem_kernel.dylib`mach_msg + 64
    frame #2: 0x00007fff89b71315 CoreFoundation`__CFRunLoopServiceMachPort + 181
    frame #3: 0x00007fff89b70939 CoreFoundation`__CFRunLoopRun + 1161
    frame #4: 0x00007fff89b70275 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #5: 0x00007fff88c2cf0d HIToolbox`RunCurrentEventLoopInMode + 226
    frame #6: 0x00007fff88c2ccb7 HIToolbox`ReceiveNextEventCommon + 479
    frame #7: 0x00007fff88c2cabc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 65
    frame #8: 0x00007fff820ca28e AppKit`_DPSNextEvent + 1434
    frame #9: 0x00007fff820c98db AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    frame #10: 0x00007fff820bd9cc AppKit`-[NSApplication run] + 553
    frame #11: 0x00000001004474b7 libwx_osx_cocoau_core-3.0.dylib`wxApp::CallOnInit() + 71
    frame #12: 0x0000000100a84c26 libwx_baseu-3.0.dylib`wxEntry(int&, wchar_t**) + 47
    frame #13: 0x0000000100000f86 hworld`main + 38
    frame #14: 0x00007fff845ab5fd libdyld.dylib`start + 1

Attachments (3)

hw_wx.cpp (1.0 KB) - added by jxy (Xiao-Yong) 8 years ago.
hello-world using wxFrame
hw_wx_hack.cpp (1.5 KB) - added by jxy (Xiao-Yong) 8 years ago.
Minimum working code.
patch-wxt-mavericks.diff (904 bytes) - added by jxy (Xiao-Yong) 8 years ago.
Patch for gnuplot-4.6.4

Download all attachments as: .zip

Change History (18)

comment:1 Changed 8 years ago by ryandesign (Ryan Schmidt)

Cc: mojca@… added
Keywords: mavericks added
Owner: changed from macports-tickets@… to jwa@…

comment:2 Changed 8 years ago by mojca (Mojca Miklavec)

Can you please submit a ticket including the minimal hello world application to http://trac.wxwidgets.org?

(This is something that should be high priority to fix.)

Changed 8 years ago by jxy (Xiao-Yong)

Attachment: hw_wx.cpp added

hello-world using wxFrame

comment:3 Changed 8 years ago by jxy (Xiao-Yong)

I'm not familiar with wxwidgets. I attached the minimal hello-world program, `hw_wx.cpp', here. If you can reproduce the issue, and you have an account on their bug tracker, please submit a ticket for me.

Thank you!

PS. compile the program with

clang++ hw_wx.cpp `wx-config --libs` `wx-config --cxxflags` -o hw_wx

comment:4 Changed 8 years ago by jxy (Xiao-Yong)

I found a way to make the GUI window visible. A simple directory structure, or a so called app bundle works. After putting the binary, hw_wx, in a directory like the following

hw_wx.app
hw_wx.app/Contents
hw_wx.app/Contents/MacOS
hw_wx.app/Contents/MacOS/hw_wx

I can open the program without any issue.

But what can we do with a program like gnuplot?

comment:5 Changed 8 years ago by mojca (Mojca Miklavec)

I don't plan to install 10.9 soon enough to be able to test before the release of wxWidgets 3.0.

But I just realized that while gnuplot doesn't crash on 10.7, it doesn't display anything either. It seems that we need to figure out when this problem was introduced.

I submitted a a but report upstream.

http://trac.wxwidgets.org/ticket/15613

Given that it worked in 2.9.5 it should be easy enough to find the problematic commit.

Last edited 8 years ago by mojca (Mojca Miklavec) (previous) (diff)

Changed 8 years ago by jxy (Xiao-Yong)

Attachment: hw_wx_hack.cpp added

Minimum working code.

Changed 8 years ago by jxy (Xiao-Yong)

Attachment: patch-wxt-mavericks.diff added

Patch for gnuplot-4.6.4

comment:6 Changed 8 years ago by jxy (Xiao-Yong)

I attached patch-wxt-mavericks.diff​ for gnuplot. Works for me. Please check. The deprecated procedure SetFrontProcess brings the window to the front.

If you have account for gnuplot bug tracker, please propagate it upstream.

comment:7 Changed 8 years ago by mojca (Mojca Miklavec)

I'm a bit swamped in time to do any decent testing. While I can fix gnuplot in MacPorts, I still believe that this is a problem in wxWidgets, not a problem in all the other software.

Checking which commit caused the problem should be easy enough (just doing bisection between 2.9.5 and 3.0.0-rc1) and in addition to that I strongly suspect that http://trac.wxwidgets.org/changeset/74703 could be a serious candidate to blame. Do you have time/motivation to check if reversing that change makes any difference in unmodified gnuplot (or to check which commit between the two releases is to blame)?

Plus, I just noticed that that particular commit might be problematic for other reasons. It checks for WXOSX instead of WXGTK. And it only removes code from carbon, but not from cocoa. So I need to file a ticket to fix that too.

comment:9 Changed 8 years ago by mojca (Mojca Miklavec)

Cc: jwa@… added; mojca@… removed
Owner: changed from jwa@… to mojca@…

comment:10 Changed 8 years ago by mojca (Mojca Miklavec)

The following needs some testing: http://trac.wxwidgets.org/changeset/75142

comment:11 Changed 8 years ago by mojca (Mojca Miklavec)

Can you please test the patch in r113110? I forgot to reference the ticket and I didn't include it into the port yet, but I would like to know if it solves the problem on 10.9. I'm not yet sure, but there is a chance that wxWidgets dependencies need to be revbumped after this change.

comment:12 Changed 8 years ago by mojca (Mojca Miklavec)

Did you manage to test the patch on 10.9?

comment:13 Changed 8 years ago by jxy (Xiao-Yong)

Thanks, @mojca, for your effort. The new patch works perfectly. I guess we can close this ticket now.

comment:14 Changed 8 years ago by mojca (Mojca Miklavec)

Resolution: fixed
Status: newclosed

comment:15 Changed 8 years ago by mojca (Mojca Miklavec)

The fix is in r113320. The upstream is only partially fixed: it's fixed in trunk, but not entirely in 3.0.0.

Note: See TracTickets for help on using tickets.