[Gambas-devel] Bug(?):Signal 6 on including the function GB.Hook in the code

chintan rao chintanraoh at ...176...
Thu Nov 2 15:28:42 CET 2006


hi guys,
I was just learning how to write components.
gbx2 exits with signal 6 on including the function.
   GB.Hook(GB_HOOK_MAIN, (void *)hook1_main);
This could possibly be a bug or a wrong implementation
Please tell me if you know where the error is
i just cant find out where
This bug is perfectly reproducable
I get "QPaintDevice: Must construct a QApplication before a QPaintDevice" in
the console of the IDe
this is what i did

static void hook1_main ( int *argc, char **argv )
{
return;
}

int EXPORT GB_INIT ( void )
{
   GB.Hook(GB_HOOK_MAIN, (void *)hook1_main);
    return 0;
}
I added the above code to main.c in my component
If i remove GB.Hook everything becomes allright

Here is the backtrace

(gdb) run
Starting program: /usr/local/bin/gbx2
[Thread debugging using libthread_db enabled]
[New Thread -1209042752 (LWP 21976)]
QPaintDevice: Must construct a QApplication before a QPaintDevice

Program received signal SIGABRT, Aborted.
[Switching to Thread -1209042752 (LWP 21976)]
0x0075a402 in __kernel_vsyscall ()
(gdb) backtrace
#0  0x0075a402 in __kernel_vsyscall ()
#1  0x00884159 in raise () from /lib/libc.so.6
#2  0x008856e3 in abort () from /lib/libc.so.6
#3  0x002e8716 in myMessageHandler (type=QtFatalMsg,
    msg=0xbfa128bc "QPaintDevice: Must construct a QApplication before a
QPaintDevice") at main.cpp:795
#4  0x06fbfda6 in qFatal () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#5  0x06c0dab2 in QPaintDevice::QPaintDevice () from /usr/lib/qt-3.3
/lib/libqt-mt.so.3
#6  0x06cff883 in QWidget::QWidget () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7  0x06dcd5c4 in QMainWindow::QMainWindow () from /usr/lib/qt-3.3
/lib/libqt-mt.so.3
#8  0x002f0315 in MyMainWindow (this=0x8ea94a0, parent=0x6, name=0x8ea7a48
"FMain", embedded=false)
    at CWindow.cpp:1239
#9  0x002f0dcc in CWINDOW_new (_object=0x8ea8458, _param=0x8e61f20) at
CWindow.cpp:232
#10 0x0804dae5 in EXEC_call_native (exec=0x2f0cec <CWINDOW_new(void*,
void*)>, object=0x8ea8458, type=0,
    param=0x8e61f20) at gbx_exec.c:783
#11 0x0804e1d1 in EXEC_native () at gbx_exec.c:901
#12 0x0804e74e in EXEC_spec (special=0, class=0x8e6fb68, object=0x55d8,
nparam=0, drop=1 '\001')
    at gbx_exec.c:1178
#13 0x0804e874 in EXEC_special_inheritance (special=0, class=0x6,
object=0x8ea8458, nparam=0, drop=1 '\001')
    at gbx_exec.c:1276
#14 0x0805f918 in OBJECT_create (object=0x8ea7ad0, class=0x8ea7a58,
name=0x0, parent=0x0, nparam=0)
    at gbx_object.c:312
#15 0x08051390 in CLASS_auto_create (class=0x8ea7a58, nparam=0) at
gbx_class.c:912
#16 0x002f1a23 in CFORM_main (_object=0x0, _param=0x8e61f20) at CWindow.cpp
:355
#17 0x0804dae5 in EXEC_call_native (exec=0x2f19f8 <CFORM_main(void*,
void*)>, object=0x0, type=0,
    param=0x8e61f20) at gbx_exec.c:783
#18 0x0804e1d1 in EXEC_native () at gbx_exec.c:901
#19 0x0805f064 in main (argc=1, argv=0xbfa14d64) at gbx.c:313

thanking you
Chintan Rao H
OPEN @ NITK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20061102/ddf9485b/attachment.html>


More information about the Devel mailing list