Commit Graph

10 Commits

Author SHA1 Message Date
Alastair Houghton
2dcaa6f14f [Backtracing][Linux] Add Linux crash handler to the runtime.
This also adds a function to demangle a symbol, and a way for the
backtracing code to report warning messages to the same place as
the main runtime.

I'd like to rename the _swift_isThunkFunction() SPI also, but we
can't do that until we've made the changes to the _Backtracing
library, so we'll do that there instead.

rdar://110261430
2023-06-05 15:39:50 +01:00
Alastair Houghton
0261a29fee [Backtracing] Support specifying a hard-coded path for swift-backtrace.
Add a way to disable dynamic lookup of the backtracer path, for situations
where a hard-coded path makes more sense.

rdar://107360391
2023-03-29 15:08:48 +01:00
Alastair Houghton
9209bdd8c4 [Backtracing] Add an option to output to stderr.
In CI, it would be better if the backtraces went to stderr rather than
stdout, so provide an option for that.

rdar://107192120
2023-03-24 17:13:52 +00:00
Alastair Houghton
725d2e1d1b [Backtracing] Disable the warning about not finding swift-backtrace.
This needs to be disabled for now.  We'll re-enable it later.

rdar://106813646
2023-03-16 17:13:10 +00:00
Alastair Houghton
1258d45152 [Backtracing] Build work.
Additional shimming required for some builds, as well as a few other build
related tweaks.

rdar://106234311
2023-03-04 15:46:30 +00:00
Alastair Houghton
43ac069ad0 [Backtracing] Add control over symbol caching.
Some symbolication frameworks have a symbol cache; we probably don't want
to use that for test cases, to avoid running into problems where the cache
holds stale information.

rdar://105409147
2023-03-04 08:00:09 +00:00
Alastair Houghton
0c5aedaaf2 [Backtracing][Runtime] Fix Linux build to use getauxval(AT_SECURE).
Linux doesn't have `issetugid()`, so use `getauxval(AT_SECURE)` there
instead.

rdar://105391747
2023-03-04 07:56:03 +00:00
Alastair Houghton
b63a227a2e [Backtracing][Runtime] Renamed getAuxiliaryExecutablePath upstream.
Need to change this to `swift_copyAuxiliaryExecutablePath()`.

rdar://105391747
2023-03-04 07:56:03 +00:00
Alastair Houghton
44be8cfc21 [Backtracing][Runtime] Disable backtraces for setuid binaries.
We really, really shouldn't be running the external backtracer for setuid
binaries.  It's just too dangerous.

So don't do that.  And if someone tries to force us, emit a warning.

rdar://105391747
2023-03-04 07:56:03 +00:00
Alastair Houghton
8a29657f4c [Runtime] [Darwin] Add code to trigger the external backtracer.
When a Swift program crashes, we should catch the crash and execute the
external backtracer.

rdar://105391747
2023-03-04 07:56:02 +00:00