Skip to content

Commit

Permalink
Use libunwind to find local symbol address on FreeBSD
Browse files Browse the repository at this point in the history
Similar to Linux.
The LLVM fallback is currently not working on FreeBSD for some reason.

Fix: #20798
  • Loading branch information
iblislin authored and yuyichao committed Jun 26, 2017
1 parent 7b0313c commit 3891cca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ Some known issues on FreeBSD are:

* The x86 architecture does not support threading due to lack of compiler runtime library support, so you may need to
set `JULIA_THREADS=0` in your `Make.user` if you're on a 32-bit system.
* Some stack trace information is not available due to differences with libunwind.

### Windows

Expand Down
2 changes: 1 addition & 1 deletion src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static void get_function_name_and_base(const object::ObjectFile *object, bool in
bool needs_name = name && (!*name || untrusted_dladdr);
// Try platform specific methods first since they are usually faster
if (needs_saddr) {
#if defined(_OS_LINUX_) && !defined(JL_DISABLE_LIBUNWIND)
#if (defined(_OS_LINUX_) || defined(_OS_FREEBSD_)) && !defined(JL_DISABLE_LIBUNWIND)
unw_proc_info_t pip;
if (unw_get_proc_info_by_ip(unw_local_addr_space, pointer, &pip, NULL) == 0) {
*saddr = (void*)pip.start_ip;
Expand Down
7 changes: 1 addition & 6 deletions test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,7 @@ end
for precomp in ("yes", "no")
bt = readstring(pipeline(ignorestatus(`$(Base.julia_cmd()) --startup-file=no --precompiled=$precomp
-E 'include("____nonexistent_file")'`), stderr=catcmd))
if (is_bsd() && !is_apple()) && precomp == "yes"
# FIXME: #20798 (FreeBSD)
@test_broken contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
else
@test contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
end
@test contains(bt, "include_from_node1(::Module, ::String) at $(joinpath(".", "loading.jl"))")
lno = match(r"at \.[\/\\]loading\.jl:(\d+)", bt)
@test length(lno.captures) == 1
@test parse(Int, lno.captures[1]) > 0
Expand Down

0 comments on commit 3891cca

Please sign in to comment.