[lttng-dev] lttng-tools-2.0.0: lttng segmentation fault bug

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Apr 3 10:05:33 EDT 2012


* Ryan.Kyser at jci.com (Ryan.Kyser at jci.com) wrote:
>    I have found a bug in lttng-tools-2.0.0/src/bin/lttng/lttng.c
> 
>    I cross compiled this for one of our embedded linux platforms, but I get a
>    segmentation fault when running it. I have determined that this is due to
>    the getenv() function call in line 527 (see excerpt below). It assumes
>    that the environment variable USER is present. In my system this variable
>    is not present, and so getenv() was returning NULL.
> 
>    //----------------------------------------------------
>    //        Excerpt from lttng.c
>    //----------------------------------------------------
>    519 int main(int argc, char *argv[])
>    520 {
>    521         int ret;
>    522
>    523         progname = argv[0] ? argv[0] : "lttng";
>    524
>    525         /* For Mathieu Desnoyers a.k.a. Dr. Tracing */
>    526         if (strncmp(progname, "drtrace", 7) == 0 ||
>    527                         strncmp("compudj", getenv("USER"), 7) == 0) {
>    528                 MSG("%c[%d;%dmWelcome back Dr Tracing!%c[%dm\n",
>    27,1,33,27,0);
>    529         }

I have to admit that finding a bug in David's easter egg is hilarious.
:-)

Thanks for reporting it!

Mathieu

> 
>    Thank you,
>    Ryan Kyser

> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list