FYI, the code in debug_util.h will generate a stack trace, but symbol resolution doesn't work on mac. Last I messed with it (~4 months ago), mac didn't work because most of the symbols are private. Mark Mentovai suggested trying to reimplement dladdr, but I could never get it working. Here's the uploaded code if anyone to mess with it:
http://codereview.chromium.org/164228 On windows and linux, assuming you actually have symbols generated (which I don't think you do for windows on the build bots), getting a trace should be as simple as creating one of those StackTrace objects in debug_util.h, and calling PrintBacktrace or OutputToStream on it. The hard part is knowing when to create the object, and making sure you're on the right thread. Also, these functions do some heap allocations so using them in a crash handler might be a bit unsafe...but if it's crashing, and there's already no way to get a core or something, making it crash harder isn't going to matter. -Albert On Sat, Aug 8, 2009 at 11:12 AM, Jeremy Orlow <jor...@chromium.org> wrote: > I'll take a look. > If anyone has ideas on how to implement this (beyond looking at > base/debug_util.h) please let me know! The last time I messed around with > programatic stack traces was 5+ years ago. :-) > > > On Sat, Aug 8, 2009 at 7:53 AM, Dimitri Glazkov <dglaz...@chromium.org>wrote: > >> Somebody please run with this! :) >> >> :DG< >> >> On Fri, Aug 7, 2009 at 8:45 PM, Darin Fisher<da...@chromium.org> wrote: >> > On Fri, Aug 7, 2009 at 8:39 PM, Ojan Vafai <o...@chromium.org> wrote: >> >> >> >> On Fri, Aug 7, 2009 at 8:45 PM, Jeremy Orlow <jor...@chromium.org> >> wrote: >> >>> >> >>> Has anyone ever looked into printing out stack traces when layout >> tests >> >>> crash? Of the couple layout test crashes I've investigated, I think >> most >> >>> could have been solved just by having a stack trace. I'm not really >> sure >> >>> what's involved or if anyone's looked into this, which is why I'm >> asking. >> >>> This could be especially helpful for flaky tests that crash. >> >> >> >> I don't remember anyone having looked into this. I agree that this >> would >> >> make tracking down and fixing these issues immensely easier, especially >> for >> >> tests that only sometimes crash. >> >> Ojan >> > >> > I've wanted this for a very long time. I think there might be a bug on >> it. >> > At any rate, we now have a nice utility in base/debug_util.h that can >> > provide a stack trace. I would love to see crash stacks on the >> buildbot. >> > It would probably help us eliminate a lot of flakiness! >> > -Darin >> > > >> > >> > > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---