Application crash when invoking upstart dbus api's.
Sandeep Puddupakkam (spuddupa)
spuddupa at cisco.com
Wed Jun 10 08:31:59 PDT 2009
Hi Naveen,
The program I am running is doing a stress test.
4 threads (configurable number from command line) are making the upstart
sync/asyncapi (upstart_get_version()) calls. 1 separate thread is
running the g_main_loop_run() to handle responses from the async calls.
The test runs fine for several hundreds of api call request per thread
and then crashes.
The initial dbus_g_bus_get() is successful. I do a null check. I did
not show it in my steps below.
The fact that connection is null after several api calls leads me to
think there is some memory corruption happening.
The same program runs fine for several thousands of successful api calls
on a ppc based board running 2 cores.
Output from a ppc based board
---------------------------------------------
[PTHREAD 2].Count[41352] sent async request
[PTHREAD 3].Count[41352] sent async request
[PTHREAD 2].Count[41352] Async CallBack. Got Version[init (upstart
0.5.0)]
[PTHREAD 3].Count[41352] Async CallBack. Got Version[init (upstart
0.5.0)]
[PTHREAD 1].Count[41352] sent async request
[PTHREAD 4].Count[41352] sent async request
[PTHREAD 1].Count[41352] Async CallBack. Got Version[init (upstart
0.5.0)]
[PTHREAD 4].Count[41352] Async CallBack. Got Version[init (upstart
0.5.0)]
Thanks,
Sandeep
________________________________
From: Naveen Verma [mailto:ernaveenverma at gmail.com]
Sent: Tuesday, June 09, 2009 11:27 PM
To: Sandeep Puddupakkam (spuddupa)
Cc: dbus at lists.freedesktop.org
Subject: Re: Application crash when invoking upstart dbus api's.
Hi,
Hello,
I am trying to investigate a crash in the dbus/dbus-glib code
when trying to use dbus-glib to communicate with upstart 0.5.
Whenever a crash occurs, it always seems to be failing with a
similar stack trace (see below).
The system is a 4 core cavium board (mips).
The test application is using 4 gthreads to make upstart async
api calls to get upstart version in a while loop.
We have started a separate gthread to that does a
g_main_loop_run() to handle responses from the async calls.
The application crashes after several successful api requests
(1000 +)
The same code does not crash on a 2 core ppc based board.
The software versions we are using are as follows.
Upstart Version 0.5
dbus-glib Version 0.76
dbus Version 1.2.1
glib Version 2.6.6
The code flow looks like this
main()
{
g_type_init ();
g_thread_init(NULL);
dbus_g_thread_init();
//Create dbus connection
connection = dbus_g_bus_get (DBUS_BUS_SYSTEM,&error);
-- Could you check if you get the connection here, because in the bt it
look like your connection object is NULL.
//Create upstart proxy to be shared by the 4 threads.
upstartProxy = dbus_g_proxy_new_for_name (connection,
UPSTART_SERVICE,
/* "com.ubuntu.Upstart"*/
UPSTART_SERVICE_PATH, /* "/com/ubuntu/Upstart"*/
UPSTART_INTERFACE); /* "com.ubuntu.Upstart"*/
//Create mutex to lock/unlock before each of the threads makes
the async call.
myMutex=g_mutex_new();
//Upstart Proxy and mutex are passed to all 4 threads.
//Create 1 gthread that runs g_main_loop_run() to handle
callbacks for async calls.
//Create 4 gthreads to make async calls.
//call g_thread_join() on all 5 threads.
}
-- Well, did not understand, why you are creating so many threads.
Thanks,
Sandeep
-Br
Naveen
_______________________________________________
dbus mailing list
dbus at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20090610/d1599f74/attachment.html
More information about the dbus
mailing list