Segmentation Fault involving FXMessageBox and sockets
-
lyle (at lylejohnson)
Ryan Melton added the following:
Here's the fix, the issue turned out to be very complicated related to how ruby handles the stack frames of its threads. In summary, you can't access stack variables between threads. FXMessageBox::warning creates the FXMessageBox on the stack. If the Garbage Collector running in another threads context tries to access the FXMessageBox, it blows up because the stack values are no longer in context. Below is the fix.
Add this method to FXRbApp.cpp:
FXWindow *FXApp::getFocusWindow() const { FXWindow *result=getActiveWindow(); VALUE value=FXRbGetRubyObj(result,true); if(!NIL_P(value)){ if(result){ while(result->getFocus()){ result=result->getFocus(); } } return result; } return NULL; }And modify the FXRbWindow::markfunc() function in markfuncs.cpp from this:
while(child!=NULL){to this:
while((child!=NULL) && (!(NIL_P(FXRbGetRubyObj(child,true))))){ -
lyle (at lylejohnson)
This solution requires patching FOX (replacing the implementation of getFocusWindow()) and that's something we need to avoid. Need to come up with an alternative solution.
-
lyle (at lylejohnson)
- Tag set to rubyforge
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.