Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stack pointer retrieval in jl_backtrace_from_here #42585

Merged
merged 29 commits into from
Nov 18, 2021
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2635252
Take pointer after grow
tkf Oct 10, 2021
2990b77
Align stack and instruction pointers
tkf Oct 10, 2021
6ca4eb5
Can we just always (up)cast pointers to UInt64?
tkf Oct 10, 2021
ac3468d
Alternative/proper fix; use WORD_SIZE
tkf Oct 10, 2021
458cb89
Actually allocate nbytes
tkf Oct 11, 2021
7a338ae
Skip closure-based tests on ARM etc.
tkf Oct 11, 2021
4eb674d
Don't use closure
tkf Oct 11, 2021
e4a1edd
Pass a function as Any
tkf Oct 11, 2021
fcae973
Further simplify llvmcall
tkf Oct 11, 2021
a935c7a
Revert "Further simplify llvmcall"
tkf Oct 11, 2021
d284a34
Revert "Pass a function as Any"
tkf Oct 11, 2021
b51e198
Move _reformat_sp to test suite and fix the typos
tkf Oct 13, 2021
24c2aa1
Use llvm.frameaddress
tkf Oct 13, 2021
03e5129
Merge branch 'master' into fix-sp
tkf Oct 14, 2021
4fcda37
Use inferencebarrier to be extra sure
tkf Oct 14, 2021
9270661
Revert "Use inferencebarrier to be extra sure"
tkf Oct 14, 2021
778def1
Revert "Use llvm.frameaddress"
tkf Oct 14, 2021
d0cedca
Merge branch 'master' into fix-sp
tkf Oct 31, 2021
6194475
Use llvm.frameaddress
tkf Oct 13, 2021
0a07e32
Use Int32 as LangRef mentions
tkf Oct 31, 2021
9e80b08
Update test/backtrace.jl
tkf Nov 13, 2021
715c673
Call llvm.frameaddress using Intrinsics.llvmcall
tkf Nov 13, 2021
de860b2
Directly invoke llvmcall in withframeaddress
tkf Nov 13, 2021
e37c0d5
Put back missing `@eval`
tkf Nov 14, 2021
3f8868a
Add dummy frames
tkf Nov 14, 2021
4b6a27f
Revert "Add dummy frames"
tkf Nov 15, 2021
66ff7e9
Check `sp[1] < ptr1`, not `sp[2] < ptr1`
tkf Nov 15, 2021
4c62333
Merge branch 'master' into fix-sp
tkf Nov 16, 2021
df9d96d
Merge branch 'master' into fix-sp
tkf Nov 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Directly invoke llvmcall in withframeaddress
  • Loading branch information
tkf committed Nov 13, 2021
commit de860b25ce32876880a7833e096e506413212df0
21 changes: 8 additions & 13 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@ function _reformat_sp(
end
end

@eval @inline function frameaddr()
"""
withframeaddress(f)

Call function `f` with an address `ptr::Ptr{Cvoid}` of an independent frame
immediately outer to `f`.
"""
@noinline function withframeaddress(f)
sp = Core.Intrinsics.llvmcall(
($"""
declare i8* @llvm.frameaddress(i32)
Expand All @@ -314,18 +320,7 @@ end
UInt,
Tuple{},
)
return Ptr{Cvoid}(sp)
end

"""
withframeaddress(f)

Call function `f` with an address `ptr::Ptr{Cvoid}` of an independent frame
immediately outer to `f`.
"""
@noinline function withframeaddress(f)
sp = frameaddr()
@noinline f(sp)
@noinline f(Ptr{Cvoid}(sp))
end

function sandwiched_backtrace()
Expand Down