WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
202196
Don't try to use backtrace() on MIPS
https://bugs.webkit.org/show_bug.cgi?id=202196
Summary
Don't try to use backtrace() on MIPS
Guillaume Emont
Reported
2019-09-25 03:55:14 PDT
backtrace() on mips seems to always return 1 on mips/glibc (I tried with buildroot, debian stable and debian testing), which renders it useless and breaks a RELEASE_ASSERT in StackTrace::captureStackTrace().
Attachments
Patch
(1.58 KB, patch)
2019-09-25 04:01 PDT
,
Guillaume Emont
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Guillaume Emont
Comment 1
2019-09-25 04:01:29 PDT
Created
attachment 379535
[details]
Patch Patch implementing this.
Adrian Perez
Comment 2
2019-09-30 04:13:51 PDT
I have not checked glibc's code, but I expect that for code built without frame pointers (the default for MIPS) it's always returning an error because it's hard to walk the stack otherwise. For binaries with .eh_frame sections, libunwind should work, but that would still require building passing “-fasynchronous-unwind-tables” to GCC. That might be an option if we want to bring back support for backtraces on MIPS at some point. Therefore, the patch is r=me, because plain backtrace() will be useless 99% of the time for MIPS.
WebKit Commit Bot
Comment 3
2019-09-30 04:18:21 PDT
Comment on
attachment 379535
[details]
Patch Clearing flags on attachment: 379535 Committed
r250516
: <
https://trac.webkit.org/changeset/250516
>
WebKit Commit Bot
Comment 4
2019-09-30 04:18:22 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 5
2019-09-30 04:19:21 PDT
<
rdar://problem/55835215
>
Guillaume Emont
Comment 6
2019-09-30 04:54:08 PDT
(In reply to Adrian Perez from
comment #2
)
> I have not checked glibc's code, but I expect that for code built > without frame pointers (the default for MIPS) it's always returning > an error because it's hard to walk the stack otherwise. > > For binaries with .eh_frame sections, libunwind should work, but that > would still require building passing “-fasynchronous-unwind-tables” > to GCC. That might be an option if we want to bring back support for > backtraces on MIPS at some point. > > Therefore, the patch is r=me, because plain backtrace() will be useless > 99% of the time for MIPS.
Thanks for explaining the reasons behind backtrace() being useless on MIPS. Note that technically, it's not returning an error (AFAIK the backtrace()'s API does not allow for that), but it's just giving a stack trace of size one (the current function), which confuses WTF code (even though it has code to ignore backtrace() if it returns 0, a return of 1 is not an expected failure case).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug