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

Validate more on assertion builds, and abort on errors #52830

Merged
merged 5 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make internal errors abort on assertions builds.
  • Loading branch information
maleadt committed Jan 13, 2024
commit c406d8adfaf7f20b0dd2c361f92537af2ac2ce4f
3 changes: 3 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9187,6 +9187,9 @@ jl_llvm_functions_t jl_emit_code(
jl_static_show((JL_STREAM*)STDERR_FILENO, jl_current_exception());
jl_printf((JL_STREAM*)STDERR_FILENO, "\n");
jlbacktrace(); // written to STDERR_FILENO
#ifndef JL_NDEBUG
abort();
#endif
}

return decls;
Expand Down
3 changes: 3 additions & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ jl_code_info_t *jl_type_infer(jl_method_instance_t *mi, size_t world, int force)
jlbacktrace(); // written to STDERR_FILENO
}
src = NULL;
#ifndef JL_NDEBUG
abort();
#endif
}
ct->world_age = last_age;
ct->reentrant_timing -= 0b10;
Expand Down
5 changes: 4 additions & 1 deletion stdlib/InteractiveUtils/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ let _true = Ref(true), f, g, h
end

# manually generate a broken function, which will break codegen
# and make sure Julia doesn't crash
# and make sure Julia doesn't crash (when using a non-asserts build)
is_asserts() = ccall(:jl_is_assertsbuild, Cint, ()) == 1
if !is_asserts()
@eval @noinline Base.@constprop :none f_broken_code() = 0
let m = which(f_broken_code, ())
let src = Base.uncompressed_ast(m)
Expand Down Expand Up @@ -371,6 +373,7 @@ let err = tempname(),
rm(err)
end
end
end

# Issue #33163
A33163(x; y) = x + y
Expand Down