[fxruby-users] FXRuby and multithreading

ujb1 at gmx.de ujb1 at gmx.de
Fri Sep 2 04:27:39 EDT 2005


Hello,

the problem can be reproduced with the groupbox.rbw example:
- take the example file groupbox.rbw
- add a GC.start in the clockThread
- start the programm
- Open the About dialog

--> the About box shows: FOX is a really, really cool C++ library!
--> Windows XP says: Access Violation at address 0x02cd05a3

I'm using Ruby 1.8.2

Best regards

Dirk


Hi,

some more information:
the error described in the last mail is a consecutive fault of another
error:
FXRuby crashed in FXRbWindow::markfunc:
    // Mark child windows
    register FXWindow* child=self->getFirst();
    while(child!=NULL){
      FXRbGcMark(child);
      child=child->getNext();   <------ child is 0x00000004!!!!
      }
    }
The error is catched by the ruby error handler. The handler calls abort.
Abort shows another message box and FXRuby crashes a second time with this
box.
Maybe this is a Qnil??? How does it get into the list of children?

FXRbWindow::markfunc(FX::FXWindow * 0x037b8f28) line 170 + 3 bytes
FXRbComposite::markfunc(FX::FXComposite * 0x037b8f28) line 117 + 9 bytes
FXRbRootWindow::markfunc(FX::FXRootWindow * 0x037b8f28) line 839 + 9 bytes
FXRbApp::markfunc(FX::FXApp * 0x032049a8) line 310 + 24 bytes
MSVCRT-RUBY18! 1003d300()
MSVCRT-RUBY18! 1003cf50()
MSVCRT-RUBY18! 1003cf6e()
FXRbGcMark(void * 0x032049a8) line 340 + 9 bytes
FXRbId::markfunc(FX::FXId * 0x037c20b0) line 130 + 18 bytes
FXRbDrawable::markfunc(FX::FXDrawable * 0x037c20b0) line 122 + 9 bytes
FXRbWindow::markfunc(FX::FXWindow * 0x037c20b0) line 152 + 9 bytes
FXRbComposite::markfunc(FX::FXComposite * 0x037c20b0) line 117 + 9 bytes
FXRbTextField::markfunc(FX::FXTextField * 0x037c20b0) line 881 + 9 bytes


Hello fxruby-users,

does anybody have experience with FXRuby and multithreading?
My Problem:
- I populate a FXTreeList widget with items. This is done in an extra worker
thread, as this task takes some minutes
- In the meantime, the user can continue to work with the application.

All works fine, until the user opens a modal window (e.g. a FXMessageBox).
Sometimes FXRuby crashes with an acess violation in FXWindow::getShell:

while((p=win->parent) && p->parent) win=p;
p seems to be invalid in this situation
The this-pointer seems to be ok and points to the MXMessageBox.
The processed message is a WM_KILLFOCUS message


FX::FXWindow::getShell() line 383 + 18 bytes
FX::FXApp::dispatchEvent(void * 0x002b1b58, unsigned int 8, unsigned int 0,
long 0) line 3943 + 8 bytes
FX::FXApp::wndproc(void * 0x002b1b58, unsigned int 8, unsigned int 0, long
0) line 3446
USER32! InternalCallWinProc at 20 + 27 bytes
USER32! UserCallWinProcCheckWow at 32 + 183 bytes
USER32! DispatchClientMessage at 20 + 77 bytes
USER32! __fnDWORD at 4 + 34 bytes
NTDLL! KiUserCallbackDispatcher at 12 + 19 bytes
USER32! 77d49105()
USER32! SoftModalMessageBox at 4 + 1380 bytes
USER32! MessageBoxWorker at 4 + 314 bytes
USER32! MessageBoxTimeoutW at 24 + 89 bytes
USER32! SoftModalMessageBox at 4 + 1380 bytes
USER32! MessageBoxWorker at 4 + 314 bytes
USER32! MessageBoxTimeoutW at 24 + 89 bytes
USER32! MessageBoxWorker at 4 + 314 bytes
USER32! MessageBoxTimeoutA at 24 + 111 bytes
NTDLL! RtlImageDirectoryEntryToData at 16 + 61 bytes
023f83dc()

ruby 1.8.2
fxruby 1.2.6

regards

Dirk

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

-- 
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++


More information about the fxruby-users mailing list