midgardproject/midgard-core — Issue #126: `set_guid()` crashes object creation
Author: bergie
Created: 2011-11-04 16:13:26+00:00
State: open

PHP code to reproduce:

read_file_at_path($filepath);
$mgd = midgard_connection::get_instance();
$mgd->open_config($config);
$mgd->set_loglevel('debug');

$person = new midgard_person();
$person->set_guid("d1eeb24ae38c11df92307f77dcafaed7aed7");
// Crash
$person->create();

Debug log:

midgard-core (pid:14040):(debug): midgard_person::__construct(...)
midgard-core (pid:14040):(debug): midgard_person::set_guid(...)
midgard-core (pid:14040):(debug):QuerySelect: SELECT
t1.guid AS reference,
t1.typename AS type,
t1.object_action AS action,
t1.midgard_ws_id AS workspace,
t1.midgard_ws_oid_id AS workspaceoid
FROM repligard AS t1
WHERE (t1.guid = 'd1eeb24ae38c11df92307f77dcafaed7aed7') AND 0<1
midgard-core (pid:14040):(debug): midgard_person::create(...)

Backtrace:

(gdb) run -c php.ini test.php
Starting program: /usr/bin/php -c php.ini test.php
[Thread debugging using libthread_db enabled]
PHP Warning: Module 'midgard2' already loaded in Unknown on line 0

(process:13974): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed

(process:13974): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(process:13974): GLib-GObject-WARNING **: invalid cast from `midgard_person' to `(null)'

(process:13974): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.28.8/./gobject/gsignal.c:2924: signal id `10' is invalid for instance `0x106b200'

(process:13974): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.28.8/./gobject/gsignal.c:2924: signal id `9' is invalid for instance `0x106b200'

(process:13974): GLib-GObject-CRITICAL **: g_param_spec_get_redirect_target: assertion `G_IS_PARAM_SPEC (pspec)' failed

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff44b8fb1 in g_type_instance_get_private ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(gdb) bt full
#0 0x00007ffff44b8fb1 in g_type_instance_get_private ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#1 0x00007ffff46ef2be in ?? () from /usr/lib/libmidgard2.so.2010
No symbol table info available.
#2 0x00007ffff4499304 in g_object_get_valist ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#3 0x00007ffff4499704 in g_object_get ()
from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
No symbol table info available.
#4 0x00007ffff4733671 in midgard_core_object_is_valid ()
from /usr/lib/libmidgard2.so.2010
No symbol table info available.
#5 0x00007ffff46f0859 in _midgard_object_create ()
from /usr/lib/libmidgard2.so.2010
No symbol table info available.
#6 0x00007ffff46f11dd in midgard_object_create ()
from /usr/lib/libmidgard2.so.2010
No symbol table info available.
#7 0x00007ffff4982d00 in zif__midgard_php_object_create ()
from /usr/lib/php5/20090626/midgard2.so
No symbol table info available.
#8 0x00007ffff4bbcc5d in xdebug_execute_internal (
current_execute_data=0x7ffff7eb7068, return_value_used=0)
at /build/buildd/xdebug-2.1.0/build-php5/xdebug.c:1339
edata = 0x7ffff7eb7068
fse = 0x1596a60
cur_opcode = 0xdd28e0
do_return = 0
function_nr = 9
#9 0x00000000006de2dc in ?? ()
No symbol table info available.
#10 0x00000000006b8044 in execute ()
No symbol table info available.
#11 0x00007ffff4bbc8b5 in xdebug_execute (op_array=0x11bf210)
---Type to continue, or q to quit---
at /build/buildd/xdebug-2.1.0/build-php5/xdebug.c:1272
dummy = 0x7fffffffe060
edata = 0x0
fse = 0x11e1120
xfse = 0x687972
magic_cookie = 0x0
do_return = 0
function_nr = 0
le = 0x0
eval_id = 0
#12 0x0000000000692f29 in zend_execute_scripts ()
No symbol table info available.
#13 0x000000000063fc83 in php_execute_script ()
No symbol table info available.
#14 0x000000000072d644 in ?? ()
No symbol table info available.
#15 0x00007ffff55f5eff in __libc_start_main (main=0x72bf70, argc=4,
ubp_av=0x7fffffffe268, init=,
fini=, rtld_fini=,
stack_end=0x7fffffffe258) at libc-start.c:226
result =
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0,
-6393718823463822328, 4360240, 140737488347744, 0, 0,
6393718824475417608, 6393730639966886920},
mask_was_saved = 0}}, priv = {pad = {0x0, 0x0,
0x7ffff7deaa17, 0x0}, data = {prev = 0x0, cleanup = 0x0,
canceltype = -136402409}}}
not_first_call =
#16 0x0000000000428859 in _start ()
No symbol table info available.