Status: New
Owner: ----
CC: [email protected], [email protected], [email protected]
Labels: Type-Defect Priority-Medium Component-ibus
New issue 959 by [email protected]: No safe way to destruct IBusConfig
object?
http://code.google.com/p/ibus/issues/detail?id=959
If IBusBus connection is already terminated, g_object_unref() call for
IBusConfig object results in SIGSEGV (older ibus) or SIGABRT (latest ibus).
Related to Issue 948, but a separate issue.
What steps will reproduce the problem?
1. start ibus-daemon
2. run the test program (see below)
3. while the test program is sleeping (it sleeps for 5 sec), stop
ibus-daemon
What is the expected output?
The test program exits with 0.
What do you see instead?
The program is terminated by assertion failure.
Please use labels and text to provide additional information.
The test code is:
$ cat ibus_config_crash2.cc
#include <ibus.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
ibus_init();
IBusBus* bus = ibus_bus_new();
if (ibus_bus_is_connected(bus)) {
IBusConfig* config = ibus_config_new(ibus_bus_get_connection(bus));
printf("please quit the ibus-daemon process\n");
usleep(5 * 1000 * 1000);
g_object_unref(config);
}
return 0;
}
Result:
$ g++ ibus_config_crash2.cc `pkg-config --libs --cflags ibus-1.0`
$ ./a.out
please quit the ibus-daemon process
<<<stop ibus-daemon here>>>
(process:28740): IBUS-WARNING **: org.freedesktop.DBus.Error.NoReply: Did
not receive a reply. Possible causes include: the remote application did
not send a reply, the message bus security policy blocked the reply, the
reply timeout expired, or the network connection was broken.
**
IBUS:ERROR:ibusconnection.c:741:ibus_connection_call_with_reply_valist:
assertion failed: (ibus_connection_is_connected (connection))
Aborted
Backtrace (with slightly old ibus, on Chromium OS):
Program terminated with signal 11, Segmentation fault.
#0 0x010bd240 in vfprintf () from /lib/libc.so.6
(gdb) bt
#0 0x010bd240 in vfprintf () from /lib/libc.so.6
#1 0x0115f222 in __vasprintf_chk () from /lib/libc.so.6
#2 0x00afb9af in g_vasprintf () from /usr/lib/libglib-2.0.so.0
#3 0x00ae7e86 in g_strdup_vprintf () from /usr/lib/libglib-2.0.so.0
#4 0x00acfa30 in g_logv () from /usr/lib/libglib-2.0.so.0
#5 0x00acfe96 in g_log () from /usr/lib/libglib-2.0.so.0
#6 0x040857a8 in ibus_proxy_destroy (proxy=0xab490c0) at ibusproxy.c:354
#7 0x040943f3 in ibus_config_real_destroy (config=0xab490c0)
at ibusconfig.c:166
#8 0x0045f7dc in g_cclosure_marshal_VOID__VOID ()
from /usr/lib/libgobject-2.0.so.0
--
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en