NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Julia on NetBSD?



Martin Husemann <martin%duskware.de@localhost> wrote:

> So ifdef and port it to our libunwind ;-)

It does not seems obvious. 

I now have this:

// stacktrace using libunwind
DLLEXPORT size_t rec_backtrace(ptrint_t *data, size_t maxsize)
{
#ifdef __NetBSD__
    return backtrace(data, maxsize);
#else
    unw_context_t uc;
    unw_getcontext(&uc);
    return rec_backtrace_ctx(data, maxsize, &uc);
#endif
}   

It gets a SIGSEGV in backtrace() and crashes again in signal handler for the
same reason. I am not sure why __builtin_frame_address(3)  meets trouble.

#0  0x00007f7ff520d26e in getframeaddr (level=2) at stacktraverse.c:153
#1  0x00007f7ff5200939 in backtrace (buffer=<optimized out>, size=80000)
    at execinfo.c:60
#2  0x00007f7ff6c17dcf in rec_backtrace_ctx (data=<optimized out>, 
    maxsize=<optimized out>, uc=<optimized out>) at task.c:599
#3  0x00007f7ff6c16311 in sigdie_handler (context=0x7f7ff4d4fce0, 
    info=<optimized out>, sig=11) at init.c:172
#4  segv_handler (sig=11, info=<optimized out>, context=0x7f7ff4d4fce0)
    at init.c:203
#5  <signal handler called>
#6  0x00007f7ff520d26e in getframeaddr (level=2) at stacktraverse.c:153
#7  0x00007f7ff5200939 in backtrace (buffer=<optimized out>, size=80000)
    at execinfo.c:60
#8  0x00007f7ff6c17dc2 in rec_backtrace (data=<optimized out>, 
    maxsize=<optimized out>) at task.c:587
#9  0x00007f7ff6c18256 in record_backtrace () at task.c:640
#10 jl_throw (e=0x7f7ff454f500) at task.c:744
#11 0x00007f7ff6bd5a71 in jl_type_error_rt (
    fname=0x7f7ff7535e8b "type parameter", context=<optimized out>, 
    ty=0x7f7ff454f4d8, got=0x7f7ff5533460) at builtins.c:84
#12 0x00007f7ff6bc6b1a in inst_type_w_ (t=0x7f7ff454f4d8, env=0x7f7ff44f9c90, 
    n=<optimized out>, stack=0x0, check=<optimized out>) at jltypes.c:1804
#13 0x00007f7ff6bc6860 in inst_type_w_ (t=0x7f7ff43c07c0, env=0x7f7ff44f9c90, 
    n=2, stack=0x0, check=<optimized out>) at jltypes.c:1818
#14 0x00007f7ff6bcc278 in jl_instantiate_type_with (n=<optimized out>, 
    env=<optimized out>, t=<optimized out>) at jltypes.c:1982
#15 jl_type_intersection_matching (a=0x7f7ff43c06e0, b=0x7f7ff4426a40, 
    penv=0x7f7fffffc178, tvars=0x7f7ff553b000) at jltypes.c:1472
#16 0x00007f7ff6bcc5a9 in jl_type_intersection (a=<optimized out>, 
    b=<optimized out>) at jltypes.c:1084
#17 0x00007f7ff6bd035a in check_ambiguous (linfo=0x7f7ff43b4ea0, 
    fname=0x7f7ff5545690, type=0x7f7ff43c06e0, ml=0x7f7ff43948f8, 
    oldmeth=<optimized out>) at gf.c:1059
#18 jl_method_list_insert (pml=0x7f7ff43b4ea0, type=<optimized out>, 
    method=0x7f7ff43c0720, tvars=0x7f7ff454f4d8, check_amb=1) at gf.c:1158
#19 0x00007f7ff6bd2462 in jl_method_table_insert (mt=0x7f7ff4418980, 
    type=0x7f7ff43c06e0, method=<optimized out>, tvars=<optimized out>)
    at gf.c:1229
#20 0x00007f7ff6c21e53 in jl_method_def (name=0x7f7ff5545690, 
    bp=0x7f7ff4dcfe10, bnd=0x7f7ff4dcfe08, argtypes=0x7f7ff43c06e0, 
    f=0x7f7ff43c0720) at toplevel.c:705
#21 0x00007f7ff6c11ca2 in eval (e=0x7f7ff43c0440, locals=0x0, nl=0)
    at interpreter.c:288
#22 0x00007f7ff6c20b0d in jl_toplevel_eval_flex (e=<optimized out>, fast=1)
    at toplevel.c:496
#23 0x00007f7ff6c21978 in jl_parse_eval_all (fname=0x7f7ff4d23d70 "bool.jl")
    at toplevel.c:544
#24 0x00007f7ff6c21b48 in jl_load (fname=0x7f7ff4d23d70 "bool.jl")
    at toplevel.c:578
#25 0x00007f7ff7f5d163 in ?? ()
#26 0x00007f7fffffc818 in ?? ()
#27 0x00007f7ff4d18d40 in ?? ()
#28 0x00007f7fffffc7f0 in ?? ()
#29 0x00007f7ff6bd21f3 in jl_apply (nargs=1, args=0x7f7ff7f4d070, 
    f=0x7f7ff4d7b500) at julia.h:981
#30 jl_apply_generic (F=<optimized out>, args=0x7f7ff7f4d070, nargs=1)
    at gf.c:1411
Backtrace stopped: frame did not save the PC
(gdb) frame 6
#6  0x00007f7ff520d26e in getframeaddr (level=2) at stacktraverse.c:153
153         case 2: return __builtin_frame_address(3);

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index