The test were enabled even if Backtracing was not enabled in the build
settings. Backtracing is enabled with the build script, but not in the
default CMake configuration.
With libdispatch executor, `level` function is called on non-main thread
because it does not specify main executor explicitly. Therefore, the
crash message from swift-backtrace says `Thread 1 crashed: ...`.
However, with single threaded executor, all jobs are executed on the
main thread, and main thread always has its name, so the message can be
thread name 'Thread 0 "CrashAsync" crashed:'.
This patch replaces the stateful generation of SILScope information in
SILGenFunction with data derived from the ASTScope hierarchy, which should be
100% in sync with the scopes needed for local variables. The goal is to
eliminate the surprising effects that the stack of cleanup operations can have
on the current state of SILBuilder leading to a fully deterministic (in the
sense of: predictible by a human) association of SILDebugScopes with
SILInstructions. The patch also eliminates the need to many workarounds. There
are still some accomodations for several Sema transformation passes such as
ResultBuilders, which don't correctly update the source locations when moving
around nodes. If these were implemented as macros, this problem would disappear.
This necessary rewrite of the macro scope handling included in this patch also
adds proper support nested macro expansions.
This fixes
rdar://88274783
and either fixes or at least partially addresses the following:
rdar://89252827
rdar://105186946
rdar://105757810
rdar://105997826
rdar://105102288
If ASAN is enabled, it will catch the crashes and the backtracing code
won't, so in that case the tests will fail. Fix by disabling them for
ASAN.
rdar://107129465
The CI nodes currently run an older macOS version that can't demangle the
async function names. So, to pass PR testing and CI, we'll need to turn
demangling off for this test for now. No big deal.
rdar://106363539
These weren't working correctly because I made the unwinder call
`_swift_task_getCurrent()`, but of course when out-of-process, it calls
that in `swift-backtrace`, which is wrong. Remove that for now.
While I'm here, I also tweaked the formatting slightly, and I noticed
that we were saying that all thunks were also system functions, which
seemed unnecessary and odd.
Plus there were a couple of extra system functions I added to make the
async crash backtraces nicer in friendly mode.
rdar://106363539
I'd inserted an extra line, which upset the line numbers in the backtracing
tests.
Also tweak the Python build script tests slightly so they work.
rdar://106234311
For some reason we don't see the dyld frames in CI. That's fine, don't
check for them.
Also turn NotImportedByDefault off for Windows as it needs a better
shell than the support provided there.
Added some extra code to AddSwiftStdlib.cmake so executable targets can
specify target SDKs the same way libraries currently can.
Updated the Backtracing targets to specify just OS X for now.
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
Fixed the colours so that they work with all of the default Terminal
presets. Also changed things so that when colour is off, we only use
ASCII characters in our source code displays.
rdar://105452194
This is Swift's external backtracer. It's written in Swift, and it's
responsible for generating nice backtraces when Swift programs crash.
It makes use of the new `_Backtracing` library, which is also (mostly,
aside from some assembly language) implemented in Swift.
rdar://103442000
Once the API has gone through Swift Evolution, we will want to implicitly
import the _Backtracing module. Add code to do that, but set it to off
by default for now.
rdar://105394140
Adds a new swift_Backtracing library, with a corresponding _Backtracing
module, to the build. Also add some tests.
This is not public API at this point, but will be used by the external
backtracing program, `swift-backtrace`.
rdar://104336548