getting instance - help




Hi, first of all sorry about my English mistakes.

I've made a shared object (DLL) which is loaded by Mozilla Browser.
When I try to call a gtk_message_dialog_new() from this dll class instance
a SIGSEGV comes up.

I have a suspicion that there is a conflict with Mozilla GTK instance even
after a successful gtk_init_check() calling, indeed  this same code has
been successfully executed by a stand alone application (don't use GTK
functions).

Bellow is the snippet from the dll:

...
DlgSenha::DlgSenha()
{
    int argc = 0;
    char** argv = 0;

    if (gtk_init_check(&argc, &argv))
        GtkWidget* dialog = gtk_message_dialog_new (NULL,
                GTK_DIALOG_DESTROY_WITH_PARENT,
                GTK_MESSAGE_ERROR,
                GTK_BUTTONS_CLOSE,
                "Dummy message for test");
        gtk_dialog_run (GTK_DIALOG (dialog));
        gtk_widget_destroy (dialog);
        gtk_main();
    }
}


And this the error:

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion
`G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed,
use g_type_init() prior to this function

GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT
(object_type)' failed

Program received signal SIGSEGV, Segmentation fault.
0xb76e4df1 in gtk_message_dialog_new () from
/opt/gnome/lib/libgtk-x11-2.0.so.0



BACKTRACE :
(gdb) bt
#0  0xb76e4df1 in gtk_message_dialog_new () from
/opt/gnome/lib/libgtk-x11-2.0.so.0
#1  0xb7f86c04 in DlgSenha (this=0xb6b78834, rTitulo= 0xb6b78854,
rSenha= 0xb6b78838, senhaLen= 0xb6b78850, resumoCertif= 0xb2a06400,
conteudoCertif= 0xb2a06404) at DlgSenha.cpp:365
#2  0xb7fa5319 in P11PrivateKey::MostrarDlgCapturaSenhaP8
(this=0xb2a063c8, uiTentativas= 0xb6b78a74) at P11PrivateKey.cpp:186
#3  0xb7fa5819 in P11PrivateKey::ValidarSenha (this=0xb2a063c8) at
P11PrivateKey.cpp:134
#4  0xb7fb167b in P11Token::Sign (this=0xb7fd1780,
tipoMecanismo= 0xb2a3d900, hObj= 0xb2a3d904, pData=0xb6b78da0 "o\032
#5  0xb7fa8019 in P11Session::Sign (this=0xb2a3d8f4, pData=0xb6b78da0 "o\032
#6  0xb7f9b3c9 in P11Ctrl::C_Sign (this=0xb7fd15e0,
hSession= 0xb6b78ca0, pData=0xb6b78da0 "o\032
#7  0xb7f88069 in C_Sign (hSession=2, pData=0xb6b78da0 "o\032
#8  0xb2ce65c7 in PK11_Sign (key=0x85bfda0, sig=0xb6b78dd0,
hash=0xb6b78d40) at pk11obj.c:765
#9  0xb2c13336 in ssl3_SignHashes (hash=0xb6b78da0, key=0x85bfda0,
buf=0xb6b78dd0, isTLS=1) at ssl3con.c:823
#10 0xb2c1ac18 in ssl3_SendCertificateVerify (ss=0xb2a0da10) at
ssl3con.c:4365
#11 0xb2c1c6fc in ssl3_HandleServerHelloDone (ss=0xb2a0da10) at
ssl3con.c:5220
#12 0xb2c21633 in ssl3_HandleHandshakeMessage (ss=0xb2a0da10, b=0xb2a14fbc "
#13 0xb2c218f9 in ssl3_HandleHandshake (ss=0xb2a0da10,
origBuf=0xb2a0dc6c) at ssl3con.c:7791
#14 0xb2c221cc in ssl3_HandleRecord (ss=0xb2a0da10, cText=0xb6b78fb0,
databuf=0xb2a0dc6c) at ssl3con.c:8054
#15 0xb2c233bb in ssl3_GatherCompleteHandshake (ss=0xb2a0da10, flags=0)
at ssl3gthr.c:206
#16 0xb2c25d67 in ssl_GatherRecord1stHandshake (ss=0xb2a0da10) at
sslcon.c:1258
#17 0xb2c2d561 in ssl_Do1stHandshake (ss=0xb2a0da10) at sslsecur.c:149
#18 0xb2c2f47e in ssl_SecureSend (ss=0xb2a0da10, buf=0xb2a0d210 "GET /
HTTP/1.1\r\nHost: localhost:8443\r\nUser-Agent: Mozilla/5.0 (X11; U;
Linux i686; en-US; rv:1.7.13) Gecko/20060417\r\nAccept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q"...,
len=381, flags=0) at sslsecur.c:1090
#19 0xb2c2f5e8 in ssl_SecureWrite (ss=0xb2a0da10, buf=0xb2a0d210 "GET /
HTTP/1.1\r\nHost: localhost:8443\r\nUser-Agent: Mozilla/5.0 (X11; U;
Linux i686; en-US; rv:1.7.13) Gecko/20060417\r\nAccept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q"...,
len=381) at sslsecur.c:1128
#20 0xb2c352b0 in ssl_Write (fd=0xb47e87f0, buf=0xb2a0d210, len=381) at
sslsock.c:1454
#21 0xb2bcc0d3 in strcpy () from
/home/atm/bin/mozilla/components/libpipnss.so
#22 0xb47e87f0 in ?? ()
#23 0xb2a0d210 in ?? ()
#24 0x0000017d in ?? ()
#25 0x00000005 in ?? ()
#26 0xb7e7e78c in __pthread_mutex_unlock_usercnt () from
/lib/libpthread.so.0
#27 0xb7ec13d1 in PR_Write (fd=0xb47e65c8, buf=0xb2a0d210, amount=381)
at ../../../../../nsprpub/pr/src/io/priometh.c:146
#28 0xb6ba7724 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#29 0xb6c07572 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#30 0xb6c124cb in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#31 0xb6d8e46d in nsStringInputStream::ReadSegments () from
/home/atm/bin/mozilla/libxpcom.so
#32 0xb6c12558 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#33 0xb6c0777f in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#34 0xb6c080c8 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#35 0xb6ba7446 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#36 0xb6ba9d73 in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#37 0xb6babf6a in NSGetModule () from
/home/atm/bin/mozilla/components/libnecko.so
#38 0xb6da690b in nsThread::Main () from /home/atm/bin/mozilla/libxpcom.so
#39 0xb7ee40e6 in _pt_root (arg=0x81962c8) at
../../../../../nsprpub/pr/src/pthreads/ptthread.c:220
#40 0xb7e7b112 in start_thread () from /lib/libpthread.so.0
#41 0xb7af42ee in clone () from /lib/libc.so.6


Any ideas?
Is it possible to get the top level window instance such as Mozilla from
a dll ?

Thanks in advance

Alex Miro
alexander miro gmail com
Rio de Janeiro - Brazil



**********************************************************************
Informação transmitida destina-se apenas à pessoa a quem foi endereçada e pode conter informação 
confidencial, legalmente protegida e para conhecimento exclusivo do destinatário. Se o leitor desta 
advertência não for o seu destinatário, fica ciente de que sua leitura, divulgação ou cópia é estritamente 
proibida. Caso a mensagem tenha sido recebida por engano, favor comunicar ao remetente e apagar o texto de 
qualquer computador.

The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, 
or taking of any action in reliance upon this information, by person or entity other than the intended 
recipient is prohibited. If you received this in error, please contact the sender and delete the material 
from any computer.
***************************************************



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]