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

implement jl_rec_backtrace stackwalk for more platform configurations #45110

Merged
merged 1 commit into from
May 3, 2022

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Apr 27, 2022

This adds support for most of the default configuration on most common
platforms (combinations of glibc/Darwin + AArch64/ARM/x86/x86_64). It
was already fully supported for Windows x86 and x86_64.

I would add support here for musl (since it is trivial), but they explicitly prohibit doing so, via their header design, as an intentional choice, so I don't know how to auto-detect support for it in the build to work around that.

A simple demo is:

julia> for t in ccall(:jl_live_tasks, Any, ()); println(t); ccall(:jlbacktracet, Cvoid, (Any,), t); println(); end

This adds support for most of the default configuration on most common
platforms (combinations of glibc/Darwin + AArch64/ARM/x86/x86_64). It
was already fully supported for Windows x86 and x86_64.

I would add support here for musl (since it is trivial), but they
explicitly prohibit via their headers as a design choice, so I don't
know how to auto-detect support for it in the build.
{
#if defined(__GLIBC__)
#if defined(_CPU_X86_)
// from https://github.com/bminor/glibc/blame/master/sysdeps/unix/sysv/linux/i386/sysdep.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nicer to use permalinks instead of referencing master

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these intentionally reference blame, since if the code changes any, I want that to be very obvious there to the reader

@jpsamaroo
Copy link
Member

jpsamaroo commented Apr 27, 2022

Is it possible to just assume that non-glibc means musl? It's most likely far more common than uClibc and other libc's on Linux. And if other libc's have a way to identify themselves, then assuming anything else is musl seems reasonably safe.

@vtjnash
Copy link
Member Author

vtjnash commented Apr 28, 2022

musl explicitly does not want to be given support in this (this PR is "badly wrong"). Unless they change their position, I am inclined not to support it therefore (https://www.openwall.com/lists/musl/2013/03/29/13)

@giordano
Copy link
Contributor

This PR introduced a lot of new compilation warnings on aarch64-linux-gnu, including "outside array bounds": #45400 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants