Commit Graph

9 Commits

Author SHA1 Message Date
Michael Gottesman
3685cdd674 Fix backtrace test 2024-06-21 06:56:34 -07:00
John McCall
0a282c044f Unify all of the task-creation builtins coming out of SILGen.
We've been building up this exponential explosion of task-creation
builtins because it's not currently possible to overload builtins.
As long as all of the operands are scalar, though, it's pretty easy
to peephole optional injections in IRGen, which means we can at
least just use a single builtin in SIL and then break it apart in
IRGen to decide which options to set.

I also eliminated the metadata argument, which can easily be recreated
from the substitutions.  I also added proper verification for the builtin,
which required (1) getting `@Sendable` right more consistently and (2)
updating a bunch of tests checking for things that are not actually
valid, like passing a function that returns an Int directly.
2024-03-06 22:21:12 -05:00
Yuta Saito
059bbf51ef [test][Backtracing] Fix crash message pattern for single threaded mode
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:'.
2023-06-22 08:06:29 +00:00
Alastair Houghton
210ca2a067 [Backtracing][Tests] Fix tests to redirect output from stderr.
Some of the backtracing tests expected output on stdout.

rdar://110371557
2023-06-07 13:55:15 +01:00
Alastair Houghton
ee5596428f [Backtracing][Linux] Enable Linux backtracing, add tests.
Turn on the Linux backtracing implementation and update the tests.

rdar://101623265
2023-06-07 09:08:18 +01:00
Alastair Houghton
3e78f840f6 [Backtracing][Tests] Disable crashing tests under ASAN.
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
2023-03-23 12:09:21 +00:00
Alastair Houghton
fc9d0a02c5 [Backtracing][Tests] Don't fail CrashAsync for missing line numbers.
If libswift_Concurrency.dylib's line numbers couldn't be resolved, we'd
end up failing this test for no good reason.

rdar://106502985
2023-03-09 16:51:57 +00:00
Alastair Houghton
9061d4e874 [Backtracing][Tests] Don't demangle in CrashAsync.
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
2023-03-08 10:56:17 +00:00
Alastair Houghton
43375e7a23 [Backtracing] Fix out-of-process async backtraces.
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
2023-03-08 09:35:18 +00:00