segfault in gtk::input_add callback, cvs

From: Date: Mon, 02 Dec 2002 23:40:15 +0000
Subject: segfault in gtk::input_add callback, cvs
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-2772@lists.php.net to get a copy of this message
G'day, My code receives a segmentation fault while (apparently) trying to execute the callback function I've registered using gtk::input_add(). It had executed it fine 20 or so times, as data arrives on a pipe, but then it fails. I can make it do this reliably. I'm using current CVS code, just checked then that there are no updates. PHP is 4.1.2, on Linux. Could one of the gurus please have a look? Or make a recommendation? Here's the gdb backtrace. The source is on http://quozl.netrek.org/pptp/php-gtk/ (Plenty of work yet to do on it!) Program received signal SIGSEGV, Segmentation fault. _zval_ptr_dtor (zval_ptr=0x63452050) at zend_execute_API.c:272 272 (*zval_ptr)->refcount--; (gdb) bt #0 _zval_ptr_dtor (zval_ptr=0x63452050) at zend_execute_API.c:272 #1 0x080e0518 in zend_hash_destroy (ht=0x84c81a4) at zend_hash.c:541 #2 0x080db884 in _zval_dtor (zvalue=0x84c5634) at zend_variables.c:57 #3 0x080d63a5 in _zval_ptr_dtor (zval_ptr=0x84c6eb8) at zend_execute_API.c:274 #4 0x080e0518 in zend_hash_destroy (ht=0x84c2884) at zend_hash.c:541 #5 0x080db8c0 in _zval_dtor (zvalue=0x84c78b4) at zend_variables.c:51 #6 0x080d63a5 in _zval_ptr_dtor (zval_ptr=0x84c8578) at zend_execute_API.c:274 #7 0x080e0518 in zend_hash_destroy (ht=0x84a7434) at zend_hash.c:541 #8 0x080d6ae5 in call_user_function_ex (function_table=0x8146fb0, object_pp=0x0, function_name=0x0, retval_ptr_ptr=0xbfffdd30, param_count=3, params=0x84c82bc, no_separation=0, symbol_table=0x0) at zend_execute_API.c:519 #9 0x402a4b16 in php_gtk_input_marshal (a=0x0, data=0x84c82bc, nargs=2, args=0xbfffdd70) at gen_gtk.c:1123 #10 0x405a3c60 in gtk_invoke_input () from /usr/lib/libgtk-1.2.so.0 #11 0x404d8fd2 in gdk_io_invoke () from /usr/lib/libgdk-1.2.so.0 #12 0x404a9076 in g_io_unix_dispatch () from /usr/lib/libglib-1.2.so.0 #13 0x404aa97e in g_main_dispatch () from /usr/lib/libglib-1.2.so.0 #14 0x404aae59 in g_main_iterate () from /usr/lib/libglib-1.2.so.0 #15 0x404ab0f4 in g_main_run () from /usr/lib/libglib-1.2.so.0 #16 0x405a26df in gtk_main () from /usr/lib/libgtk-1.2.so.0 #17 0x402a439d in zif_gtk_main (ht=0, return_value=0x80d636c, this_ptr=0x0, return_value_used=0) at gen_gtk.c:885 #18 0x080f7140 in execute (op_array=0x816d0ec) at zend_execute.c:1590 #19 0x080dcae7 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:814 #20 0x0805f89c in php_execute_script (primary_file=0xbffffaa0) at main.c:1307 #21 0x0805dadb in main (argc=2, argv=0xbffffb24) at cgi_main.c:738 #22 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 If more is needed from this, I can obtain it ... e.g. p *params The program has two gtk::input_add calls, it is the second that is relevant. It runs pppd in a pipe. Wishes: a) a way to check a file descriptor or stream for input, then I could call fgets() again, in reader(), b) that setting the file descriptor non-blocking would work, c) to know for sure whether it is line buffering or not. -- James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/

« previous php.gtk.general (#2772) next »