[lttng-dev] Segmentation fault in lttng-sessiond which is fixed in master

David OShea David.OShea at quantum.com
Sun Dec 2 23:39:55 EST 2012


Hi all,

I'm using lttng-tools-2.0.4.  I got a segmentation fault in lttng-sessiond with this stack trace:

"""
#0  delete_ust_app_session (sock=-1, ua_sess=0xffffffffffffffff) at ust-app.c:147
#1  0x000000000040cab5 in create_ust_app_session (usess=0x148adc10, app=0x148c0ef0) at ust-app.c:914
#2  0x000000000040db14 in ust_app_global_update (usess=0x148adc10, sock=187) at ust-app.c:2309
#3  0x0000000000412c96 in update_ust_app (app_sock=<optimized out>) at main.c:855
#4  thread_manage_apps (data=<optimized out>) at main.c:1257
#5  0x00002b872bffb617 in start_thread () from /lib64/libpthread.so.0
#6  0x00002b872c2e3c2d in clone () from /lib64/libc.so.6
#7  0x0000000000000000 in ?? ()
"""

It looks like in create_ust_app_session() this code must have executed:

"""
	if (ua_sess->handle == -1) {
		ret = ustctl_create_session(app->sock);
		if (ret < 0) {
			ERR("Creating session for app pid %d", app->pid);
			/* This means that the tracer is gone... */
			ua_sess = (void*) -1UL;
			goto error;
"""

as this is the location of the call to delete_ust_app_session():

"""
error:
	delete_ust_app_session(-1, ua_sess);
"""

I see that in git master, this seems to have been fixed by:

"""
commit 0f83395d5e0e927fdab025eae023e68e9021af26
Author: David Goulet <dgoulet at efficios.com>
Date:   Mon Oct 29 14:49:50 2012 -0400

    Fix: Cleanup UST app session on ustctl create session error
"""

which ensures that ua_sess is not set to -1 until after delete_ust_app_session() is called.

I have two queries about this:

1. Why is this error handling code being reached - what does the comment /* This means that the tracer is gone... */ mean - does it mean lttng-ust in a user process connected to the session daemon but the process went away or something like that?

2. Should the above commit be merged into the stable branch?  I'm not concerned either way as I'll probably just apply the patch to 2.0.4 when I get a chance.

Thanks!
David

----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt.



More information about the lttng-dev mailing list