Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2002 21:31:55 +1100 (EST)
From:      Tony Maher <tonym@biolateral.com.au>
To:        ports@freebsd.org
Subject:   visual python port
Message-ID:  <200201231031.g0NAVtw62798@c31516.thorn1.nsw.optusnet.com.au>

next in thread | raw e-mail | index | archive | help
Hello,

I am trying to port the visual python module (http://www.vpython.org/).
It compiles with one trivial change to Makefile (gtk-config -> gtk12-config)
but trying to run any associated demo causes a segfault.

> python ~/vpython/Programs/Demos/wave.py
 Visual-2001-11-18
 segmentation fault (core dumped)

gdb> where
#0  0x28591e11 in _XimParseStringFile () from /usr/X11R6/lib/libX11.so.6
#1  0x28590855 in _XimCreateDefaultTree () from /usr/X11R6/lib/libX11.so.6
#2  0x28590928 in _XimLocalOpenIM () from /usr/X11R6/lib/libX11.so.6
#3  0x2858fc03 in _XimOpenIM () from /usr/X11R6/lib/libX11.so.6
#4  0x28567ef9 in XOpenIM () from /usr/X11R6/lib/libX11.so.6
#5  0x284ca9c3 in gdk_im_real_open () from /usr/X11R6/lib/libgdk12.so.2
#6  0x284caacf in gdk_im_open () from /usr/X11R6/lib/libgdk12.so.2
#7  0x284bb0c9 in gdk_init_check () from /usr/X11R6/lib/libgdk12.so.2
#8  0x284161ce in gtk_init_check () from /usr/X11R6/lib/libgtk12.so.2
#9  0x28416631 in gtk_init () from /usr/X11R6/lib/libgtk12.so.2
#10 0x282c931b in mainloop ()
   from /home/staff/tonym/vpython/cvisual/cvisualmodule.so
#11 0x28121f93 in _thread_start () from /usr/lib/libc_r.so.4
#12 0x0 in ?? ()

After checking some other ports that use gtk and the documentation 
(BTW is there a reason why the gtk port does not install the documentation?)
it appears gtk_init is normally called as gtk_init(&argc, &argv).
In this case (in platlinux.cpp) it is called as gtk_int(NULL, NULL).
Thinking this could be problem I made up an argc/argv

and from x11-toolkits/py-gtk/work/gnome-python-1.4.2/pygtk/gtk.py

# initialize GTK (only if it can find the display -- this avoids segfaults)
if '--display' in sys.argv or os.environ.has_key('DISPLAY'):
        _gtk.gtk_init()

suggested the following arguments

int argc = 3;
char **argv;
argv = (char**) malloc(argc * sizeof(char *));
argv[0] =  "program";
argv[1] =  "--display";
argv[2] =  ":0.0";
gtk_init (&argc, &argv);

It fails in the same way.
If I set argc=2 then gtk complains that display requires an argument
so it appears everything is being sent ok.

XOpenIM relates display and locale info but I dont know why that would be
failing.  Could it be related to the fact that this is a threaded
application and environment vars are not available to it? 

Other gtk apps (gtkfind, gtkdiff) all work fine.

Any clues?
Otherwise its a weekend job to recompile all with -g and step thru.

thanks
--
tonym

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201231031.g0NAVtw62798>