Bug 160414 - [Tools] The GDB backtrace report tool don't checks the gdb return code.
Summary: [Tools] The GDB backtrace report tool don't checks the gdb return code.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-01 12:07 PDT by Carlos Alberto Lopez Perez
Modified: 2016-08-01 18:51 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.57 KB, patch)
2016-08-01 12:18 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (1.57 KB, patch)
2016-08-01 12:23 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2016-08-01 12:07:59 PDT
There is an issue with current Debug builds of WebKitGTK+ and GDB. Check #159919

GDB=7.7.1 segfaults when trying to analyze a core produced on a Debug build of WebKitGTK+ without producing any output.

The WebKit tooling don't checks the return code and assumes that an empty stdout means that the corefile was not generated as expected.

So, it returns this:


"""
crash log for WebKitWebProcess (pid 7371):

Coredump core-pid_7371.dump not found. To enable crash logs:

- run this command as super-user: echo "|Tools/Scripts/process-linux-coredump /home/clopez/webkit/cores/core-pid_%p.dump" > /proc/sys/kernel/core_pattern
- enable core dumps: ulimit -c unlimited
- set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=/home/clopez/webkit/cores


STDERR: 
STDERR: warning: core file may not match specified executable file.
STDERR: <empty>
"""

Which is at best, misleading.

We should detect the return code from GDB and inform about it when it is non-zero.
Comment 1 Carlos Alberto Lopez Perez 2016-08-01 12:18:47 PDT
Created attachment 285026 [details]
Patch
Comment 2 WebKit Commit Bot 2016-08-01 12:20:08 PDT
Attachment 285026 [details] did not pass style-queue:


ERROR: Tools/Scripts/webkitpy/port/linux_get_crash_log.py:49:  missing whitespace around operator  [pep8/E225] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Carlos Alberto Lopez Perez 2016-08-01 12:23:33 PDT
Created attachment 285028 [details]
Patch
Comment 4 Carlos Alberto Lopez Perez 2016-08-01 12:26:22 PDT
Example of -crash-log.txt file produced after this patch:

"""
crash log for WebKitWebProcess (pid 11081):

ERROR: The gdb process exited with non-zero return code -11


STDERR: 
STDERR: warning: core file may not match specified executable file.
STDERR: <empty>
"""


And if using gdb=>7.11.1 which don't segfaults but fails to generate the backtrace, we get:

"""
crash log for WebKitWebProcess (pid 12130):

ERROR: The gdb process exited with non-zero return code 1

[New LWP 12130]
[New LWP 12148]
[New LWP 12142]
[New LWP 12153]
[New LWP 12146]
[New LWP 12139]
[New LWP 12144]
[New LWP 12150]
[New LWP 12149]
[New LWP 12140]
[New LWP 12145]
[New LWP 12152]
[New LWP 12141]
[New LWP 12147]
[New LWP 12151]
cp-support.c:1615: demangler-warning: unable to demangle '_ZSt7forwardIRZN6WebKit29NetworkConnectionToWebProcess26writeBlobsToTemporaryFilesERKN3WTF6VectorINS2_6StringELm0ENS2_15CrashOnOverflowELm16EEEmEUlRT_E_EOS9_RNSt16remove_referenceIS9_E4typeE' (demangler failed with signal 11)
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

STDERR: 
STDERR: warning: core file may not match specified executable file.
STDERR: 
STDERR: warning: Could not load shared library symbols for linux-vdso.so.1.
STDERR: Do you need "set solib-search-path" or "set sysroot"?
"""
Comment 5 Carlos Alberto Lopez Perez 2016-08-01 18:51:37 PDT
Comment on attachment 285028 [details]
Patch

Clearing flags on attachment: 285028

Committed r204007: <http://trac.webkit.org/changeset/204007>
Comment 6 Carlos Alberto Lopez Perez 2016-08-01 18:51:46 PDT
All reviewed patches have been landed.  Closing bug.