From: Marco T. G. e S. <marcot@r. net> - 2008-07-01 21:17:33
|
Hello, I'm trying to ltrace a simple haskell glade test, but when I use zenity's glade, I can't ltrace it, but with the "same" test in C, ltrace goes with no problem: This haskell test is ltraceable: import Control.Monad import Data.Maybe import Graphics.UI.Gtk import Graphics.UI.Gtk.Glade main :: IO () main = do initGUI glade <- liftM fromJust $ xmlNew "teste.glade" window <- xmlGetWidget glade castToWindow "window1" onDestroy window mainQuit widgetShow window mainGUI $ ghc --make -Wall testeglade.hs $ ltrace ./testeglade http://marcotmarcot.googlepages.com/testeglade.txt This one is not: import Control.Monad import Data.Maybe import Graphics.UI.Gtk import Graphics.UI.Gtk.Glade main :: IO () main = do initGUI glade <- liftM fromJust $ xmlNew "/usr/local/share/zenity/zenity.glade" window <- xmlGetWidget glade castToWindow "zenity_error_dila" onDestroy window mainQuit widgetShow window mainGUI $ ghc --make -Wall teste.hs $ ltrace ./teste http://marcotmarcot.googlepages.com/teste.txt And this C code is ltraceable: #include <gtk/gtk.h> #include <glade/glade.h> void destroy(GtkWidget *widget, gpointer user_data) { gtk_main_quit(); } int main(int argc, char *argv[]) { GladeXML *xml; GtkWidget *window; gtk_init(&argc, &argv); xml = glade_xml_new("/usr/share/zenity/zenity.glade", NULL, NULL); window = glade_xml_get_widget(xml, "zenity_error_dialog"); gtk_signal_connect(GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (destroy), NULL); gtk_widget_show_all(window); gtk_main(); return 0; } $ gcc test.c -o test `pkg-config --cflags --libs libglade-2.0` $ ltrace ./test http://marcotmarcot.googlepages.com/test.txt I'm using gtk2hs 0.9.13. Can you reproduce that? -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.blogspot.com/ Correio: ma...@ri... XMPP: ma...@ja... IRC: ma...@ir... Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil |
From: Axel S. <Axe...@en...> - 2008-07-01 22:51:14
|
On Jul 1, 2008, at 23:18, Marco Túlio Gontijo e Silva wrote: > Hello, > > I'm trying to ltrace a simple haskell glade test, but when I use > zenity's glade, I can't ltrace it, but with the "same" test in C, > ltrace > goes with no problem: [..] > This one is not: [..] > window <- xmlGetWidget glade castToWindow "zenity_error_dila" The dialog name seems incorrect. You're trace says that the program segfaults. It might be that a NULL pointer is dereferenced. This is a bug in Gtk2Hs in that we should throw an exception instead. Does that answer your question? > window = glade_xml_get_widget(xml, "zenity_error_dialog"); > Axel. |
From: Marco T. G. e S. <marcot@r. net> - 2008-07-01 23:11:59
|
Em Qua, 2008-07-02 às 00:50 +0200, Axel Simon escreveu: > On Jul 1, 2008, at 23:18, Marco Túlio Gontijo e Silva wrote: > > This one is not: > [..] > > window <- xmlGetWidget glade castToWindow "zenity_error_dila" > > The dialog name seems incorrect. You're trace says that the program > segfaults. It might be that a NULL pointer is dereferenced. This is a > bug in Gtk2Hs in that we should throw an exception instead. Does that > answer your question? I get the same problem with "zenity_error_dialog". I'm sorry for pasting wrong in the first time, but I've made a lot of tests before mailing here, and it was probably only the last one that I missed it. I've changed it and the problem persists. Upated ltrace: http://marcotmarcot.googlepages.com/teste.txt Thanks for the answer. -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.blogspot.com/ Correio: ma...@ri... XMPP: ma...@ja... IRC: ma...@ir... Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil |
From: Axel S. <Axe...@en...> - 2008-07-03 18:57:38
|
On Jul 2, 2008, at 1:12, Marco Túlio Gontijo e Silva wrote: > Em Qua, 2008-07-02 às 00:50 +0200, Axel Simon escreveu: >> On Jul 1, 2008, at 23:18, Marco Túlio Gontijo e Silva wrote: >>> This one is not: >> [..] >>> window <- xmlGetWidget glade castToWindow "zenity_error_dila" >> >> The dialog name seems incorrect. You're trace says that the program >> segfaults. It might be that a NULL pointer is dereferenced. This is a >> bug in Gtk2Hs in that we should throw an exception instead. Does that >> answer your question? > > I get the same problem with "zenity_error_dialog". I'm sorry for > pasting wrong in the first time, but I've made a lot of tests before > mailing here, and it was probably only the last one that I missed it. > > I've changed it and the problem persists. > > Upated ltrace: http://marcotmarcot.googlepages.com/teste.txt > Hm, it seems nobody else is willing to download all those files and give it a go. Since your trace file shows that the program is terminated by a segfault, maybe you could run it in gdb and look at the C function where it terminates. If the program does not terminate in a C function then I could have a look. Otherwise, you can probably tell what's going wrong and then we might be able to fix that without this specific glade file. A. |