Hi,<br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Hello,</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">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.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Whenever a crash occurs, it always seems to be failing with
a similar stack trace (see below).</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The system is a 4 core cavium board (mips).</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The test application is using 4 gthreads to make upstart async
api calls to get upstart version in a while loop.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">We have started a separate gthread to that does a g_main_loop_run()
to handle responses from the async calls.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The application crashes after several successful api
requests (1000 +)</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The same code does not crash on a 2 core ppc based board.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The software versions we are using are as follows.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Upstart Version 0.5</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">dbus-glib Version 0.76</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">dbus Version
1.2.1</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">glib
Version 2.6.6</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">The code flow looks like this</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">main()</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">{</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">g_type_init ();</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">g_thread_init(NULL);</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">dbus_g_thread_init();</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Create dbus connection</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">connection = dbus_g_bus_get (DBUS_BUS_SYSTEM,&error);</span></font></p></div></div></blockquote><div><br>-- Could you check if you get the connection here, because in the bt it look like your connection object is NULL.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-US"><div><p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"></span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Create upstart proxy to be shared by the 4 threads.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">upstartProxy = dbus_g_proxy_new_for_name (connection,</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> UPSTART_SERVICE,
/*</span></font> <font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">"com.ubuntu.Upstart"*/</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> UPSTART_SERVICE_PATH,
/*</span></font> <font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">"/com/ubuntu/Upstart"*/</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> UPSTART_INTERFACE);
/*</span></font> <font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">"com.ubuntu.Upstart"*/</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Create mutex to lock/unlock before each of the threads
makes the async call.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">myMutex=g_mutex_new();</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Upstart Proxy and mutex are passed to all 4 threads.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Create 1 gthread that runs g_main_loop_run() to handle
callbacks for async calls.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//Create 4 gthreads to make async calls.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">//call g_thread_join() on all 5 threads.</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">}</span></font></p></div></div></blockquote><div><br>-- Well, did not understand, why you are creating so many threads.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"></span></font></p><br><p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Thanks,</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Sandeep</span></font></p>
</div>
</div>
-Br</blockquote><div>Naveen <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
<br></blockquote></div><br>