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

Crash on exit #135

Closed
Keno opened this issue Jul 16, 2015 · 1 comment · Fixed by JuliaLang/julia#17431
Closed

Crash on exit #135

Keno opened this issue Jul 16, 2015 · 1 comment · Fixed by JuliaLang/julia#17431

Comments

@Keno
Copy link
Collaborator

Keno commented Jul 16, 2015

While deleting: i32 ()* %__cxxjl_personality_v0
Use still stuck around after Def is destroyed:
; Function Attrs: noreturn
define void @julia_anonymous_21295(i8*, i8*) #0 personality i32 ()* @__cxxjl_personality_v0 {
top:
  %2 = alloca [4 x %jl_value_t*], align 8, !dbg !10
  %.sub = getelementptr inbounds [4 x %jl_value_t*], [4 x %jl_value_t*]* %2, i64 0, i64 0
  %3 = getelementptr [4 x %jl_value_t*], [4 x %jl_value_t*]* %2, i64 0, i64 2, !dbg !10
  %4 = getelementptr [4 x %jl_value_t*], [4 x %jl_value_t*]* %2, i64 0, i64 3, !dbg !10
  %5 = bitcast [4 x %jl_value_t*]* %2 to i64*, !dbg !10
  store i64 4, i64* %5, align 8, !dbg !10
  %6 = load i64, i64* bitcast (%jl_value_t*** @jl_pgcstack to i64*), align 8, !dbg !10
  %7 = getelementptr [4 x %jl_value_t*], [4 x %jl_value_t*]* %2, i64 0, i64 1, !dbg !10
  %8 = bitcast %jl_value_t** %7 to i64*, !dbg !10
  store i64 %6, i64* %8, align 8, !dbg !10
  store %jl_value_t** %.sub, %jl_value_t*** @jl_pgcstack, align 8, !dbg !10
  store %jl_value_t* null, %jl_value_t** %3, align 8, !dbg !10
  store %jl_value_t* null, %jl_value_t** %4, align 8, !dbg !10
  call void @llvm.dbg.value(metadata i8* %0, i64 0, metadata !11, metadata !16), !dbg !10
  call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !17, metadata !16), !dbg !10
  %9 = bitcast i8* %0 to %class.anon*, !dbg !10
  %call.i = call i8* @"_ZZ21gallium_error_handlerPvRKSsbENK3$_0clEv"(%class.anon* %9), !dbg !10
  %10 = bitcast i8* %1 to %class.anon.129*, !dbg !10
  %call.i.5 = call i64 @"_ZZ21gallium_error_handlerPvRKSsbENK3$_1clEv"(%class.anon.129* %10), !dbg !10
  %11 = icmp eq i8* %call.i, null, !dbg !10
  br i1 %11, label %if, label %L, !dbg !10

if:                                               ; preds = %top
  %12 = call %jl_value_t* @jl_gc_alloc_1w(), !dbg !10
  %13 = getelementptr inbounds %jl_value_t, %jl_value_t* %12, i64 -1, i32 0, !dbg !10
  store %jl_value_t* inttoptr (i64 140228191022256 to %jl_value_t*), %jl_value_t** %13, align 8, !dbg !10
  %14 = getelementptr inbounds %jl_value_t, %jl_value_t* %12, i64 0, i32 0, !dbg !10
  store %jl_value_t* inttoptr (i64 140228190134080 to %jl_value_t*), %jl_value_t** %14, align 8, !dbg !10
  call void @jl_throw_with_superfluous_argument(%jl_value_t* %12, i32 -1), !dbg !10
  unreachable, !dbg !10

L:                                                ; preds = %top
  %15 = icmp sgt i64 %call.i.5, -1, !dbg !10
  br i1 %15, label %pass.2, label %fail1, !dbg !10

fail1:                                            ; preds = %L
  %16 = load %jl_value_t*, %jl_value_t** @jl_inexact_exception, align 8, !dbg !10
  call void @jl_throw_with_superfluous_argument(%jl_value_t* %16, i32 -1), !dbg !10
  unreachable, !dbg !10

pass.2:                                           ; preds = %L
  %17 = call %jl_value_t* inttoptr (i64 140236889857584 to %jl_value_t* (i8*, i64)*)(i8* inreg %call.i, i64 inreg %call.i.5), !dbg !10
  store %jl_value_t* %17, %jl_value_t** %3, align 8, !dbg !10
  %.cast = ptrtoint %jl_value_t* %17 to i64, !dbg !10
  %18 = bitcast %jl_value_t** %4 to i64*, !dbg !10
  store i64 %.cast, i64* %18, align 8, !dbg !10
  %19 = call %jl_value_t* @jl_apply_generic(%jl_value_t* inttoptr (i64 140228218262896 to %jl_value_t*), %jl_value_t** %4, i32 1), !dbg !10
  %20 = load i64, i64* %8, align 8, !dbg !10
  store i64 %20, i64* bitcast (%jl_value_t*** @jl_pgcstack to i64*), align 8, !dbg !10
  ret void, !dbg !10
}

julia: /home/kfischer/julia/deps/llvm-svn/lib/IR/Value.cpp:82: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.

signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f8b6f18b03d)
unknown function (ip: 0x7f8b6f18b0f2)
unknown function (ip: 0x7f8b7076727f)
_ZN4llvm8FunctionD1Ev at /home/kfischer/julia/usr/bin/../lib/libLLVM-3.8svn.so (unknown line)
_ZN4llvm8FunctionD0Ev at /home/kfischer/julia/usr/bin/../lib/libLLVM-3.8svn.so (unknown line)
unknown function (ip: 0x7f8b7075c69b)
_ZN4llvm6ModuleD1Ev at /home/kfischer/julia/usr/bin/../lib/libLLVM-3.8svn.so (unknown line)
_ZN4llvm15LLVMContextImplD1Ev at /home/kfischer/julia/usr/bin/../lib/libLLVM-3.8svn.so (unknown line)
_ZN4llvm11LLVMContextD1Ev at /home/kfischer/julia/usr/bin/../lib/libLLVM-3.8svn.so (unknown line)
unknown function (ip: 0x7f893e0393e2)
~__shared_count at /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/shared_ptr_base.h:667
unknown function (ip: 0x7f896838f0a1)
destruct_C at /home/kfischer/.julia/Cxx/src/clanginstances.jl:19
jl_eh_restore_state at /home/kfischer/julia/src/./julia.h:1354
run_finalizers at /home/kfischer/julia/src/gc.c:339
jl_atexit_hook at /home/kfischer/julia/src/init.c:576
unknown function (ip: 0x4024f4)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4017d9)
unknown function (ip: (nil))
Aborted
@Keno
Copy link
Collaborator Author

Keno commented Jul 16, 2015

I suspect this is caused by the function mover not properly moving references in the personality function slot to external references in the new module, because it needs to be treated specially.

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 a pull request may close this issue.

1 participant