Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: pierre-marc.fournier@polymtl.ca (Pierre-Marc Fournier)
Subject: [ltt-dev] UST - Problems in recording trace on a current process
Date: Wed, 10 Feb 2010 10:26:01 -0500	[thread overview]
Message-ID: <4B72D009.2060702@polymtl.ca> (raw)
In-Reply-To: <19fa8ef31002091650k3363add7s10be22658cfa8eec@mail.gmail.com>

Naren wrote:
> Hi Pierre,
> 
>>>So we have the answer to your problem. You cannot list the markers on your
>>>program (firefox) because it was not linked with libust. Linking a
> program to
>>>libust is essential in order to be able to trace it or to list markers.
> 
>>>There are two ways of doing this. Either you can link it with the gcc
>>>option -lust at compile time, or you can link it at runtime using
> LD_PRELOAD.
>>>For example:
> 
>>>LD_PRELOAD=/path/to/libust.so ./myprogram
> 
> I did a LD_PRELOAD on libust.so
> 
> Inside /usr/local/lib directory, i found three shared objects with the
> same name libust. I guess libust.so is the linker name and libust.so.0
> and libust.so.0.0.0 are fully qualified names with libust.so.0  being
> linked to libust.so.0 .0.0 .

In fact, libust.so is a linker script pointing to libust-initializer.o
and libust.so.0.0.0 (the "real" library). But you don't need to bother
about this. See below.

> 
> Having found that running LD_PRELOAD on libust.so, again unfortunately,
> gave this error. Moreover, the other alternative also gave the same one.
> 
>>>Another way to do the LD_PRELOAD trick is to use usttrace, which will
> do it
>>>automatically with -l:
> 
>>>usttrace -l ./myprogram
> 
> *ERROR: ld.so: object '/usr/local/lib/libust.so' from LD_PRELOAD cannot
> be preloaded: ignored.*
> *
> *
> *So, I tried LD_PRELOAD with libust.so.0.0.0, this time i didnt get any
> error.*

I see what happened. Indeed when you LD_PRELOAD, you should do it on
libust.so.0.0.0. This is my mistake. I am updating usttrace as well for
this. Thanks.

> *
> *
> *However, ustctl --list-markers /pid/ , I am getting segmentation fault.*
> *I did a strace on that, and found these interesting traces.*
> *
> *
> *
> *
> socket(PF_FILE, SOCK_STREAM, 0)         = 3
> *
> *connect(3, {sa_family=AF_FILE, path="/tmp/ust-app-socks/1709"}, 110) = 0*
> *send(3, "list_markers", 12, MSG_NOSIGNAL) = 12*
> *recv(3, "marker: metadata/core_marker_id "..., 1000, 0) = 1000*
> *--- SIGSEGV (Segmentation fault) @ 0 (0) ---*
> *+++ killed by SIGSEGV +++*
> 
> The full dump of strace can be found here http://pastebin.ca/1792101 . 
> 
> Is it a problem due to multiple shared objects, or does it necessitate
> another clean install of some libraries?
> 

I'm not sure what you could have done that would necessitate a clean
install. If you suspect your installation is dirty or composed of libs
of mixed versions, I suggest to do clean install as the situation can
result in segfaults.

But you might face a real bug. Based on the strace output, it is ustctl
that is segfaulting. Could you compile it with:

make clean
CFLAGS="-g3" ./configure
make
make install

Then run the same ustctl command within gdb and post the backtrace (bt
command) you get after the segfault.

Thanks!

pmf




  parent reply	other threads:[~2010-02-10 15:26 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 21:49 Naren
2010-02-08 21:49 ` Naren
2010-02-08 22:19 ` Pierre-Marc Fournier
     [not found]   ` <19fa8ef31002081428x1e215acfgd81d505ee359ce9@mail.gmail.com>
     [not found]     ` <201002081744.06912.pierre-marc.fournier@polymtl.ca>
2010-02-08 23:54       ` Naren
2010-02-08 23:54         ` Naren
2010-02-09  1:37         ` soumyakanti chakraborty
2010-02-09  1:37           ` soumyakanti chakraborty
2010-02-09  1:48           ` soumyakanti chakraborty
2010-02-09  1:48             ` soumyakanti chakraborty
2010-02-09  5:45             ` Pierre-Marc Fournier
2010-02-09 14:44               ` Naren
2010-02-09 14:44                 ` Naren
2010-02-09 14:51                 ` Douglas Santos
2010-02-09 14:51                 ` Douglas Santos
2010-02-09 16:43                   ` Naren
2010-02-09 16:43                     ` Naren
2010-02-09 17:11                     ` Pierre-Marc Fournier
2010-02-09 16:42             ` Pierre-Marc Fournier
2010-02-09 17:11               ` Naren
2010-02-09 17:11                 ` Naren
2010-02-09 17:25                 ` Pierre-Marc Fournier
2010-02-09 20:40                   ` Naren
2010-02-09 20:40                     ` Naren
2010-02-09 21:25                     ` Douglas Santos
2010-02-09 21:28                     ` Pierre-Marc Fournier
2010-02-10  0:50                       ` Naren
2010-02-10  0:50                         ` Naren
2010-02-10 15:26                         ` Pierre-Marc Fournier [this message]
2010-02-10 16:53                           ` Naren
2010-02-10 16:53                             ` Naren
2010-02-10 20:15                             ` Pierre-Marc Fournier
2010-02-10 22:08                               ` Naren
2010-02-10 22:08                                 ` Naren
2010-02-12  0:18                                 ` Pierre-Marc Fournier
2010-02-12  9:10                                   ` Naren
2010-02-12  9:10                                     ` Naren
2010-02-15  6:04                                 ` Pierre-Marc Fournier
2010-02-15  6:23                                   ` Naveh, Ido
2010-02-15 12:16                                     ` Mathieu Desnoyers
2010-02-15 11:42                                   ` Naren
2010-02-15 11:42                                     ` Naren
2010-02-15 14:53                                     ` Pierre-Marc Fournier
2010-02-18 17:47                                 ` Pierre-Marc Fournier
2010-02-18 22:58                                   ` Naren
2010-02-18 22:58                                     ` Naren
2010-02-18 22:58                                     ` Naren
2010-02-19 16:50                                     ` Pierre-Marc Fournier
2010-02-19 17:15                                       ` Naren
2010-02-19 17:15                                         ` Naren
2010-02-19 17:15                                         ` Naren
2010-02-22  0:46                                         ` soumyakanti chakraborty
2010-02-22  0:46                                           ` soumyakanti chakraborty
2010-02-22  0:46                                           ` soumyakanti chakraborty
2010-02-23 15:15                                           ` Pierre-Marc Fournier
2010-02-26  1:55                                             ` soumyakanti chakraborty
2010-02-26  1:55                                               ` soumyakanti chakraborty
2010-02-26  1:55                                               ` soumyakanti chakraborty
2010-02-26  5:35                                               ` Pierre-Marc Fournier
2010-02-09 14:46 ` Douglas Santos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B72D009.2060702@polymtl.ca \
    --to=pierre-marc.fournier@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox