|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-22 03:19 UTC] isotop at gmail dot com
Description:
------------
Im using php-gtk2 from cvs.
when im trying to get an Hebrew letters from GtkEntry and put int in other GtkEntry i get a Segmentation fault.
i think its a pango related maybe?
Reproduce code:
---------------
#!/usr/bin/php-gtk
<?php
function delete_event()
{
return false;
}
function shutdown()
{
print("Shutting down...\n");
gtk::main_quit();
}
function hello()
{
global $window;
print "Hello World!\n";
$window->destroy();
}
/*
$window = new GtkWindow();
$window->connect('destroy', 'shutdown');
$window->connect('delete-event', 'delete_event');
$window->set_border_width(10);
$button = new GtkButton(phpversion());
$button->connect('clicked', 'hello');
$window->add($button);
*/
function on_button1_clicked()
{
global $php,$zend;
$php->set_text($zend->get_text());
//gtk::main_quit();
}
$glade = new GladeXML( dirname( __FILE__) . "/xml.glade");
$glade->signal_connect("shutdown","shutdown");
$glade->signal_connect("on_button1_clicked","on_button1_clicked");
$php = $glade->get_widget("php");
$php->set_text(phpversion());
$zend = $glade->get_widget("zend");
$zend->set_text(zend_version());
//$window->show_all();
gtk::main();
?>
Actual result:
--------------
#0 0x00002aaaab561bc0 in memcpy () from /lib/libc.so.6
#1 0x00000000005a4ce0 in _estrndup (s=0x0, length=9)
at /home/isotop/php-gtk/php5-200510212230/Zend/zend_alloc.c:424
#2 0x00002aaaab80cf3c in zif_GtkEntry_get_text (ht=21206904,
return_value=0x14193c8, return_value_ptr=0x9, this_ptr=0x0,
return_value_used=0) at gtk.overrides:1236
#3 0x00000000005e2baa in zend_do_fcall_common_helper_SPEC (
execute_data=0x7ffffffe04f0) at zend_vm_execute.h:188
#4 0x00000000005e255c in execute (op_array=0x1249ff0) at zend_vm_execute.h:88
#5 0x00000000005b0458 in zend_call_function (fci=0x7ffffffe0690,
fci_cache=0x1243008)
at /home/isotop/php-gtk/php5-200510212230/Zend/zend_execute_API.c:880
#6 0x00000000005b0ec6 in call_user_function_ex (function_table=0x1439778,
object_pp=0x0, function_name=0x9, retval_ptr_ptr=0x9, param_count=0,
params=0x8, no_separation=0, symbol_table=0x0)
at /home/isotop/php-gtk/php5-200510212230/Zend/zend_execute_API.c:578
#7 0x00002aaaab86324b in phpg_closure_marshal (closure=0x1412840,
return_value=0x0, n_param_values=1, param_values=0x0, invocation_hint=0x0,
marshal_data=0x8) at /home/isotop/php-gtk/php-gtk/main/phpg_closure.c:113
#8 0x00002aaaac6a9a79 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#9 0x00002aaaac6bcfe4 in g_signal_has_handler_pending ()
from /usr/lib/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#10 0x00002aaaac6be2a7 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#11 0x00002aaaac6be613 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#12 0x00002aaaabb8a428 in gtk_button_get_alignment ()
from /usr/lib/libgtk-x11-2.0.so.0
#13 0x00002aaaac6a9a79 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#14 0x00002aaaac6bcd94 in g_signal_has_handler_pending ()
from /usr/lib/libgobject-2.0.so.0
#15 0x00002aaaac6be2a7 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#16 0x00002aaaac6be613 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#17 0x00002aaaabb89959 in gtk_button_set_relief ()
from /usr/lib/libgtk-x11-2.0.so.0
#18 0x00002aaaabc45488 in gtk_marshal_VOID__UINT_STRING ()
from /usr/lib/libgtk-x11-2.0.so.0
#19 0x00002aaaac6a9a79 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#20 0x00002aaaac6bd6cc in g_signal_has_handler_pending ()
from /usr/lib/libgobject-2.0.so.0
#21 0x00002aaaac6be009 in g_signal_emit_valist ()
from /usr/lib/libgobject-2.0.so.0
#22 0x00002aaaac6be613 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#23 0x00002aaaabd286a0 in gtk_widget_activate ()
---Type <return> to continue, or q <return> to quit---
from /usr/lib/libgtk-x11-2.0.so.0
#24 0x00002aaaabc43841 in gtk_propagate_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#25 0x00002aaaabc43b8c in gtk_main_do_event ()
from /usr/lib/libgtk-x11-2.0.so.0
#26 0x00002aaaabf89440 in gdk_event_get_graphics_expose ()
from /usr/lib/libgdk-x11-2.0.so.0
#27 0x00002aaaac9074e6 in g_main_context_dispatch ()
from /usr/lib/libglib-2.0.so.0
#28 0x00002aaaac908f08 in g_main_context_acquire ()
from /usr/lib/libglib-2.0.so.0
#29 0x00002aaaac90926a in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#30 0x00002aaaabc43061 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#31 0x00000000005e2baa in zend_do_fcall_common_helper_SPEC (
execute_data=0x7ffffffe1f00) at zend_vm_execute.h:188
#32 0x00000000005e255c in execute (op_array=0x1243008) at zend_vm_execute.h:88
#33 0x00000000005bc3c9 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/isotop/php-gtk/php5-200510212230/Zend/zend.c:1087
#34 0x0000000000580f49 in php_execute_script (primary_file=0x7ffffffe4690)
at /home/isotop/php-gtk/php5-200510212230/main/main.c:1677
#35 0x000000000064dca9 in main (argc=2, argv=0x7ffffffe47d8)
at /home/isotop/php-gtk/php5-200510212230/sapi/cli/php_cli.c:1042
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
1) Where is the Hebrew text? This script doesn't have any.. and the Zend and PHP versions are hard-coded in English.. I need to be able to reproduce what you're seeing before I can fix anything. 2) What is your codepage setting (in your php.ini)? 3) Shorter scripts are very much welcomed. Example: <?php function shutdown() { print("Shutting down...\n"); gtk::main_quit(); } function on_button1_clicked($php, $zend) { $php->set_text($zend->get_text()); } $glade = new GladeXML( dirname( __FILE__) . "/xml.glade"); $glade->signal_autoconnect(); $php = $glade->get_widget("php"); $php->set_text(phpversion()); $zend = $glade->get_widget("zend"); $zend->set_text(zend_version()); gtk::main(); ?>OK, I spent some time now doing battle with my (UK) setup and the contents of an old email with a Hebrew date on it: <?php function shutdown() { print("Shutting down...\n"); gtk::main_quit(); } function on_button1_clicked() { global $php, $zend; $php->set_text($zend->get_text()); } $glade = new GladeXML( dirname( __FILE__) . "/xml.glade"); $glade->signal_autoconnect(); $php = $glade->get_widget("php"); $php->set_text("??? ????? 18 ???????"); $zend = $glade->get_widget("zend"); $zend->set_text("??? ????? 10 ???????"); gtk::main(); ?> (forgive the Unicode - assuming that's what it comes out as after I press submit - on my laptop and in my codepage setting it's ISO-8859-8) All I can think is that a) you've skipped the codepage setting or b) you didn't install Pango's runtime Hebrew support, because it works perfectly here. I'm therefore closing this report.