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

debug info problems #41

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

debug info problems #41

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

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 41

This is a meta bug to track all our problems with debug info in asan.
These problems together form one of our major issues. 

- Stability: wrong debug info hurts code with exceptions. 
http://llvm.org/bugs/show_bug.cgi?id=11468

- Debug info quality (can't use gdb properly): http://llvm.org/bugs/show_bug.cgi?id=11818
likely caused by stack realignment and related to the one above. 

- Huge size of debug info.  http://llvm.org/bugs/show_bug.cgi?id=7554
I am not sure if the problem is well understood. 
LLVM's debug info on linux is much bigger than with gcc. asan makes it worse. 

- gmlt (minimal line tables). Consider adding a flag similar to gcc's -gmlt (http://old.nabble.com/-patch--Add-new--gmlt-option-for-min.-debug-info-with-line-tables-(issue4440072)-td31482851.html).
This will allow to have fully symbolized stacks traces with smaller debug info. 
One option it to implement this as an LLVM pass which will strip all irrelevant metadata.




Reported by konstantin.s.serebryany on 2012-02-14 19:52:49

@ramosian-glider
Copy link
Member Author

-Stability+1: crashes in the libc stack unwinder on Android. Only happen when main()
is instrumented. I can only explain this by the incorrect debug info. May be related
to http://llvm.org/bugs/show_bug.cgi?id=11468 (incorrect debug info with aligned stack
variables).

Reported by eugenis@google.com on 2012-04-06 17:21:00

@ramosian-glider
Copy link
Member Author

Notes on the progress:
Exceptions (PR11468): Call frame information is incorrect in case the stack is aligned.
I see no short quick fix for this bug at the moment. eugenis@, does this happen on
ARM? The code that emits function prologue is target-specific, so probably it's incorrect
both on X86 and ARM.

Debug Info Quality: fixed little bug with debug info in presence of aligned stack,
but it didn't help ASan - have to dig deeper.

Debug Info Size: Clang option -gline-tables-only submitted to trunk and is being tested.
This option increases the size of the binary by about 2x (instead of 4-5x with regular
-g) and produces stack traces with files and line numbers.

Reported by samsonov@google.com on 2012-05-05 13:36:01

@ramosian-glider
Copy link
Member Author

Thanks for working on this. The "Debug info quality" problem (11818) seems to be the
most severe for us at the moment because it makes it pretty much impossible to debug
any ASan failures with GDB in Firefox or Spidermonkey.

Reported by decoder.oh on 2012-05-05 13:44:00

@ramosian-glider
Copy link
Member Author

-gline-tables-only looks good so far, with the only problem that it does not save the

full function names.
I.e. instead of AAA::BBB::CCC(int, int) it will just have CCC.
This is not a big deal if we can extract the function name from the symbol in the binary,
but it hurts if we have some inlined frames.
-gline-tables-only can be fixed to actually store the full function names, but it will
cost some debug info size. 
Alexey, please measure the difference and update this bug. 

Reported by konstantin.s.serebryany on 2012-05-30 10:11:10

@ramosian-glider
Copy link
Member Author

PR11468 is fixed in r160248.

Reported by samsonov@google.com on 2012-07-30 09:02:08

@ramosian-glider
Copy link
Member Author

Is there any update on the second point? I'm still seeing lots of "<optimized out>"
in debug-only builds. I was just trying again to debug an ASan failure under GDB but
it's pretty much impossible.

Reported by decoder.oh on 2012-08-28 17:11:26

@ramosian-glider
Copy link
Member Author

No, full debug info (the ability to trace variable/argument values) is still broken
with ASan. We hope to fix this soon, but I can't give the exact date when it is done...

Reported by samsonov@google.com on 2012-08-29 08:48:18

@ramosian-glider
Copy link
Member Author

r169984 makes ASan + "-g" + gdb much more usable (I can now observe values of local
variables and function arguments). I would be happy to hear from decoder.oh if it works
for Firefox/Spidermonkey. Closing this issue for now. Feel free to file debug info
problems or bugs as separate (hopefully, not major) issues.

Reported by samsonov@google.com on 2012-12-12 14:56:15

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

Can we get Chromium's clang revision rolled past this change. Please. Pretty please.

Right now Chromium is at clang r169803, according to tools/clang/scripts/update.sh

Reported by schenney@chromium.org on 2012-12-20 15:39:22

@ramosian-glider
Copy link
Member Author

Stephen, you need this for debugging, right?
You can refer to http://dev.chromium.org/developers/testing/addresssanitizer for the
instructions on how to build Chromium with a custom Clang (and code.google.com/p/address-sanitizer/wiki/HowToBuild
for Clang build instructions).

Reported by ramosian.glider on 2012-12-20 15:44:35

@ramosian-glider
Copy link
Member Author

Moreover, you can fix tools/clang/scripts/update.sh to point to this revision (you'll
also need to work around the Android flag in that script). Then running update.sh will
download and build the corresponding Clang version for you.

Reported by ramosian.glider on 2012-12-20 15:45:56

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

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

  • Labels added: ProjectAddressSanitizer

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

1 participant