Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbolize stack traces using code from lldb #16

Closed
ramosian-glider opened this issue Aug 31, 2015 · 20 comments
Closed

symbolize stack traces using code from lldb #16

ramosian-glider opened this issue Aug 31, 2015 · 20 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 16

We need to symbolize error messages in process. 
Looks like we can share some code with lldb. 
See http://comments.gmane.org/gmane.comp.debugging.lldb.devel/650

Such code will be useful for other dynamic tools as well. 

Reported by konstantin.s.serebryany on 2011-12-12 23:43:41

@ramosian-glider
Copy link
Member Author

Hello, do you have an estimate as to when this will be available?

Reported by mohamed.omar.bana on 2012-01-13 22:14:02

@ramosian-glider
Copy link
Member Author

Nope. We did not start yet, sorry. :( 
If asan_symbolize.py does not work for you, please let us know why (in a separate mail
or bug)

Reported by konstantin.s.serebryany on 2012-01-13 22:21:21

@ramosian-glider
Copy link
Member Author

we need this for tsan as well. 
Dmitry, could you please handle this? 

Reported by konstantin.s.serebryany on 2012-02-14 02:42:47

@ramosian-glider
Copy link
Member Author

I've created the lldb symbolizer prototype for tsan:
http://code.google.com/p/data-race-test/source/browse/trunk/v2/tsan/tsan_symbolize_lldb_linux.cc
It works. One needs to manually build liblldb.so first.
Several patches are committed to lldb, one still in flight (SBTarget::SetModuleLoadAddress()
may print spurious warnings, but must generally work otherwise).
LLDB does not work with -pie on Linux, reported but not fixed yet.
Symbolizer is unlikely to be separated from LLDB, so we will depend on LLDB if take
this route.
LLDB is a huge piece of C++ code, so we will need libstdc++ and will have recursive
interceptors (it calls malloc/etc).

Reported by [email protected] on 2012-03-26 09:09:15

  • Status changed: Started

@ramosian-glider
Copy link
Member Author

>LLDB does not work with -pie on Linux, reported but not fixed yet.

http://llvm.org/bugs/show_bug.cgi?id=12355

Reported by [email protected] on 2012-03-26 09:17:22

@ramosian-glider
Copy link
Member Author

>> and will have recursive interceptors
OMG. Hopefully not. We do not have to symbolize inside malloc.

Reported by konstantin.s.serebryany on 2012-03-26 14:31:59

@ramosian-glider
Copy link
Member Author

Also, is it possible to implement the symbolizer as an LD_PRELOAD-able library? 

Reported by konstantin.s.serebryany on 2012-03-26 14:36:37

@ramosian-glider
Copy link
Member Author

>>> and will have recursive interceptors
>OMG. Hopefully not. We do not have to symbolize inside malloc.
That was related to tsan.

>Also, is it possible to implement the symbolizer as an LD_PRELOAD-able library?
Generally I do not see any obstacles, however I am not sure whether it will work in
all our contexts.

Reported by [email protected] on 2012-03-26 14:41:54

@ramosian-glider
Copy link
Member Author

Could we make it dlopen()able instead? LD_PRELOAD sounds like a strange choice of an
interface between 2 libraries, both of which we control.

stdc++ dependency in the rtl is undesirable on Android, but definitely not a show stopper.


Reported by [email protected] on 2012-03-26 18:30:46

@ramosian-glider
Copy link
Member Author

>> Could we make it dlopen()able instead? 
I think so

Reported by konstantin.s.serebryany on 2012-03-26 18:38:10

@ramosian-glider
Copy link
Member Author

> Could we make it dlopen()able instead? LD_PRELOAD sounds like a strange choice of
an interface between 2 libraries, both of which we control.

Well, currently I have 3 separate source files with different symbolizers (null, addr2line,
lldb) in tsan. One of them is chosen during build. In every context we know which one
we need, so it looks fine as is. Do we really need to switch symbolizers dynamically?


Reported by [email protected] on 2012-03-26 19:51:16

@ramosian-glider
Copy link
Member Author

one reason to chose between null and lldb symbolizers at run-time is that lldb symbolizer
does not come for free (it has a run-time cost) and we may want to produce 
warnings with null symbolizer very fast. 

Reported by konstantin.s.serebryany on 2012-03-26 19:54:15

@ramosian-glider
Copy link
Member Author

Then we build with lldb symbolizer and turn off symbolization (but do not switch the
symbolizer) at runtime.

Reported by [email protected] on 2012-03-26 19:57:54

@ramosian-glider
Copy link
Member Author

I wish not to depend on libstc++ by default. 

Reported by konstantin.s.serebryany on 2012-03-26 20:21:22

@ramosian-glider
Copy link
Member Author

Issue 134 has been merged into this issue.

Reported by konstantin.s.serebryany on 2013-02-15 14:28:44

@ramosian-glider
Copy link
Member Author

Issue 206 has been merged into this issue.

Reported by konstantin.s.serebryany on 2013-10-04 10:39:54

@ramosian-glider
Copy link
Member Author

The goal of this issue seems to be changed to "Build isolated non-instrumented in-process
symbolizer" or so.

Reported by [email protected] on 2013-12-23 14:57:43

@ramosian-glider
Copy link
Member Author

Reported by ramosian.glider on 2015-07-30 09:05:30

  • Labels added: ProjectAddressSanitizer

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:06:54

@kcc
Copy link
Contributor

kcc commented Dec 1, 2015

We are using llvm-symbolizer by default, although out-of-process. Closing this bug.
Using llvm-symbolizer in-process is a separate story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants