UNCONFIRMED 114689
Print file-name, line and function name while calling CRASH()
https://bugs.webkit.org/show_bug.cgi?id=114689
Summary Print file-name, line and function name while calling CRASH()
Arunprasad Rajkumar
Reported 2013-04-16 09:58:23 PDT
In embedded platforms(mostly debugger is missing) it very difficult(for us) to debug the issues without proper prints in CRASH macro. Though it has "WTFReportBacktrace();" due to some constraints we are not getting proper call stack information(debug build with -g is costlier for us) . So we are thinking to extend the functionality of WTFInvokeCrashHook by passing __FILE__ & __LINE__ and printing it.
Attachments
Patch (7.36 KB, text/plain)
2013-04-16 11:18 PDT, Arunprasad Rajkumar
no flags
Patch (7.39 KB, text/plain)
2013-04-16 11:25 PDT, Arunprasad Rajkumar
no flags
Patch (9.95 KB, patch)
2013-04-16 12:03 PDT, Arunprasad Rajkumar
benjamin: review-
benjamin: commit-queue-
Arunprasad Rajkumar
Comment 1 2013-04-16 11:18:07 PDT
Arunprasad Rajkumar
Comment 2 2013-04-16 11:25:40 PDT
Arunprasad Rajkumar
Comment 3 2013-04-16 12:03:16 PDT
Benjamin Poulain
Comment 4 2013-04-16 12:09:21 PDT
Comment on attachment 198385 [details] Patch Please keep this in your branch. Accidentally leaking filenames should not be a concern of engineers. We should not need this in release build.
Arunprasad Rajkumar
Comment 5 2013-04-16 21:42:35 PDT
(In reply to comment #4) > (From update of attachment 198385 [details]) > Please keep this in your branch. > > Accidentally leaking filenames should not be a concern of engineers. We should not need this in release build. Is it OK to pass __FILE__,__LINE__ to WTFInvokeCrashHook __without changing__ assertion behavior? So that we can register our own crash handler to print all these stuffs ? typedef void (*WTFCrashHookFunction)(const char* file, int line, const char* function); WTFInvokeCrashHook(__FILE__, __LINE__, WTF_PRETTY_FUNCTION)
Benjamin Poulain
Comment 6 2013-04-16 22:55:01 PDT
> Is it OK to pass __FILE__,__LINE__ to WTFInvokeCrashHook __without changing__ assertion behavior? So that we can register our own crash handler to print all these stuffs ? > > typedef void (*WTFCrashHookFunction)(const char* file, int line, const char* function); > WTFInvokeCrashHook(__FILE__, __LINE__, WTF_PRETTY_FUNCTION) I am not sure how that help(?), the filename is still gonna be in the binary.
Arunprasad Rajkumar
Comment 7 2013-04-16 23:02:11 PDT
> I am not sure how that help(?), the filename is still gonna be in the binary. Are you worrying about the binary size after? Hope it will be fewer KB(may be 10 to 20K). Atleast if we pass __FILE__,__LINE__ to WTFInvokeCrashHook we can install our own WTFCrashHookFunction using WTFSetCrashHook to print the stuffs.
Benjamin Poulain
Comment 8 2013-04-16 23:20:59 PDT
(In reply to comment #7) > Are you worrying about the binary size after? Hope it will be fewer KB(may be 10 to 20K). > > Atleast if we pass __FILE__,__LINE__ to WTFInvokeCrashHook we can install our own WTFCrashHookFunction using WTFSetCrashHook to print the stuffs. The part I am afraid is leaking private information unintentionally. Let say I add a file optimizing our pipeline for SGX680MP12 (fictitious SGX). I would have a file GraphicsContextSGX680MP12.cpp. Just by using CRASH() in that file, I would leak the name of unreleased hardware. I see little value in having the filename in release, because when developing, CRASH() is no different than a programming mistake causing a crash. On the other side, I see a risk for leaking information and increasing the binary size.
Arunprasad Rajkumar
Comment 9 2013-04-16 23:40:39 PDT
(In reply to comment #8) > On the other side, I see a risk for leaking information and increasing the binary size. Absolutely correct !!
Arunprasad Rajkumar
Comment 10 2013-04-16 23:57:24 PDT
(In reply to comment #8) > (In reply to comment #7) > > Are you worrying about the binary size after? Hope it will be fewer KB(may be 10 to 20K). > > > > Atleast if we pass __FILE__,__LINE__ to WTFInvokeCrashHook we can install our own WTFCrashHookFunction using WTFSetCrashHook to print the stuffs. > > The part I am afraid is leaking private information unintentionally. > Let say I add a file optimizing our pipeline for SGX680MP12 (fictitious SGX). I would have a file GraphicsContextSGX680MP12.cpp. Just by using CRASH() in that file, I would leak the name of unreleased hardware. > > I see little value in having the filename in release, because when developing, CRASH() is no different than a programming mistake causing a crash. > On the other side, I see a risk for leaking information and increasing the binary size. In-case WebKit as shared objects(DLL) we can get all these information right(full function name,including class name can be decoded using nm -C -D)?
Note You need to log in before you can comment on or make changes to this bug.