-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
Starting Julia with the -b option ("Bare: don't load default startup files"), starts the Julia process with a few variables being uninitialized (e.g. jl_get_system_hooks is never called), leading to a segmentation violation upon e.g. any error (jl_errorf) since jl_new_struct expects to be able to dereference its first argument.
E.g.
julia> asdf
Program received signal SIGSEGV, Segmentation fault.
0x00000000004669ba in jl_new_struct (type=0x0) at alloc.c:82
82 if (type->instance != NULL) return type->instance;
(gdb) info stack
#0 0x00000000004669ba in jl_new_struct (type=0x0) at alloc.c:82
#1 0x000000000042cf99 in jl_errorf (fmt=0xbca5d0 "%s not defined") at builtins.c:40
#2 0x0000000000465af9 in eval (e=0x106b760, locals=0x0, nl=0) at interpreter.c:85
...
Instead of segfaulting upon error, I would have expected "julia -b" to behave like some kind of minimum/bare interpreter.