Skip to content

Commit 428d242

Browse files
authored
threads: during abrupt thread-exit, cleanup anyways (#48223)
Closes #47590 (pthread_cancel still forbidden though, since async mode will corrupt or deadlock the process, and synchronously tested with cancelation disabled whenever this is a lock is just a slow implementation of a boolean) Refs #47201 (only deals with thread exit, not other case where this is an issue, like cfunction exit and gc-safe-leave) May help #46537, by blocking jl_wake_libuv before uv_library_shutdown, and other tweaks to GC mode. For example, avoiding: [4011824] signal (6.-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) uv__async_send at /workspace/srcdir/libuv/src/unix/async.c:198 uv_async_send at /workspace/srcdir/libuv/src/unix/async.c:73 jl_wake_libuv at /data/vtjnash/julia1/src/jl_uv.c:44 [inlined] JL_UV_LOCK at /data/vtjnash/julia1/src/jl_uv.c:64 [inlined] ijl_iolock_begin at /data/vtjnash/julia1/src/jl_uv.c:72 iolock_begin at ./libuv.jl:48 [inlined] _trywait at ./asyncevent.jl:140 wait at ./asyncevent.jl:155 [inlined] profile_printing_listener at /data/vtjnash/julia1/usr/share/julia/stdlib/v1.10/Profile/src/Profile.jl:39 jfptr_YY.3_58617 at /data/vtjnash/julia1/usr/lib/julia/sys.so (unknown line) _jl_invoke at /data/vtjnash/julia1/src/gf.c:2665 [inlined] ijl_apply_generic at /data/vtjnash/julia1/src/gf.c:2866 jl_apply at /data/vtjnash/julia1/src/julia.h:1870 [inlined] start_task at /data/vtjnash/julia1/src/task.c:1093 Aborted Fixes #37400
1 parent faa37a6 commit 428d242

18 files changed

Lines changed: 142 additions & 84 deletions

src/Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ $(BUILDDIR)/julia_flisp.boot: $(addprefix $(SRCDIR)/,jlfrontend.scm flisp/aliase
286286

287287
# additional dependency links
288288
$(BUILDDIR)/codegen-stubs.o $(BUILDDIR)/codegen-stubs.dbg.obj: $(SRCDIR)/intrinsics.h
289-
$(BUILDDIR)/aotcompile.o $(BUILDDIR)/aotcompile.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/debug-registry.h
289+
$(BUILDDIR)/aotcompile.o $(BUILDDIR)/aotcompile.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h
290290
$(BUILDDIR)/ast.o $(BUILDDIR)/ast.dbg.obj: $(BUILDDIR)/julia_flisp.boot.inc $(SRCDIR)/flisp/*.h
291291
$(BUILDDIR)/builtins.o $(BUILDDIR)/builtins.dbg.obj: $(SRCDIR)/iddict.c $(SRCDIR)/builtin_proto.h
292292
$(BUILDDIR)/codegen.o $(BUILDDIR)/codegen.dbg.obj: $(addprefix $(SRCDIR)/,\
293-
intrinsics.cpp jitlayers.h debug-registry.h intrinsics.h llvm-codegen-shared.h cgutils.cpp ccall.cpp abi_*.cpp processor.h builtin_proto.h)
293+
intrinsics.cpp jitlayers.h intrinsics.h llvm-codegen-shared.h cgutils.cpp ccall.cpp abi_*.cpp processor.h builtin_proto.h)
294294
$(BUILDDIR)/datatype.o $(BUILDDIR)/datatype.dbg.obj: $(SRCDIR)/support/htable.h $(SRCDIR)/support/htable.inc
295295
$(BUILDDIR)/debuginfo.o $(BUILDDIR)/debuginfo.dbg.obj: $(addprefix $(SRCDIR)/,debuginfo.h processor.h jitlayers.h debug-registry.h)
296296
$(BUILDDIR)/disasm.o $(BUILDDIR)/disasm.dbg.obj: $(SRCDIR)/debuginfo.h $(SRCDIR)/processor.h
@@ -301,13 +301,13 @@ $(BUILDDIR)/gc-heap-snapshot.o $(BUILDDIR)/gc-heap-snapshot.dbg.obj: $(SRCDIR)/g
301301
$(BUILDDIR)/gc-alloc-profiler.o $(BUILDDIR)/gc-alloc-profiler.dbg.obj: $(SRCDIR)/gc.h $(SRCDIR)/gc-alloc-profiler.h
302302
$(BUILDDIR)/init.o $(BUILDDIR)/init.dbg.obj: $(SRCDIR)/builtin_proto.h
303303
$(BUILDDIR)/interpreter.o $(BUILDDIR)/interpreter.dbg.obj: $(SRCDIR)/builtin_proto.h
304-
$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/debug-registry.h
304+
$(BUILDDIR)/jitlayers.o $(BUILDDIR)/jitlayers.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/llvm-codegen-shared.h
305305
$(BUILDDIR)/jltypes.o $(BUILDDIR)/jltypes.dbg.obj: $(SRCDIR)/builtin_proto.h
306306
$(build_shlibdir)/libllvmcalltest.$(SHLIB_EXT): $(SRCDIR)/llvm-codegen-shared.h $(BUILDDIR)/julia_version.h
307307
$(BUILDDIR)/llvm-alloc-helpers.o $(BUILDDIR)/llvm-alloc-helpers.dbg.obj: $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/llvm-pass-helpers.h $(SRCDIR)/llvm-alloc-helpers.h
308308
$(BUILDDIR)/llvm-alloc-opt.o $(BUILDDIR)/llvm-alloc-opt.dbg.obj: $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/llvm-pass-helpers.h $(SRCDIR)/llvm-alloc-helpers.h
309-
$(BUILDDIR)/llvm-cpufeatures.o $(BUILDDIR)/llvm-cpufeatures.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/debug-registry.h
310-
$(BUILDDIR)/llvm-demote-float16.o $(BUILDDIR)/llvm-demote-float16.dbg.obj: $(SRCDIR)/jitlayers.h $(SRCDIR)/debug-registry.h
309+
$(BUILDDIR)/llvm-cpufeatures.o $(BUILDDIR)/llvm-cpufeatures.dbg.obj: $(SRCDIR)/jitlayers.h
310+
$(BUILDDIR)/llvm-demote-float16.o $(BUILDDIR)/llvm-demote-float16.dbg.obj: $(SRCDIR)/jitlayers.h
311311
$(BUILDDIR)/llvm-final-gc-lowering.o $(BUILDDIR)/llvm-final-gc-lowering.dbg.obj: $(SRCDIR)/llvm-pass-helpers.h $(SRCDIR)/llvm-codegen-shared.h
312312
$(BUILDDIR)/llvm-gc-invariant-verifier.o $(BUILDDIR)/llvm-gc-invariant-verifier.dbg.obj: $(SRCDIR)/llvm-codegen-shared.h
313313
$(BUILDDIR)/llvm-julia-licm.o $(BUILDDIR)/llvm-julia-licm.dbg.obj: $(SRCDIR)/llvm-codegen-shared.h $(SRCDIR)/llvm-alloc-helpers.h $(SRCDIR)/llvm-pass-helpers.h
@@ -323,7 +323,7 @@ $(BUILDDIR)/signal-handling.o $(BUILDDIR)/signal-handling.dbg.obj: $(addprefix $
323323
$(BUILDDIR)/staticdata.o $(BUILDDIR)/staticdata.dbg.obj: $(SRCDIR)/staticdata_utils.c $(SRCDIR)/precompile_utils.c $(SRCDIR)/processor.h $(SRCDIR)/builtin_proto.h
324324
$(BUILDDIR)/toplevel.o $(BUILDDIR)/toplevel.dbg.obj: $(SRCDIR)/builtin_proto.h
325325
$(BUILDDIR)/ircode.o $(BUILDDIR)/ircode.dbg.obj: $(SRCDIR)/serialize.h
326-
$(BUILDDIR)/pipeline.o $(BUILDDIR)/pipeline.dbg.obj: $(SRCDIR)/passes.h $(SRCDIR)/jitlayers.h $(SRCDIR)/debug-registry.h
326+
$(BUILDDIR)/pipeline.o $(BUILDDIR)/pipeline.dbg.obj: $(SRCDIR)/passes.h $(SRCDIR)/jitlayers.h
327327

328328
$(addprefix $(BUILDDIR)/,threading.o threading.dbg.obj gc.o gc.dbg.obj init.c init.dbg.obj task.o task.dbg.obj): $(addprefix $(SRCDIR)/,threading.h)
329329
$(addprefix $(BUILDDIR)/,APInt-C.o APInt-C.dbg.obj runtime_intrinsics.o runtime_intrinsics.dbg.obj): $(SRCDIR)/APInt-C.h
@@ -437,8 +437,14 @@ $(build_shlibdir)/lib%Plugin.$(SHLIB_EXT): $(SRCDIR)/clangsa/%.cpp $(LLVM_CONFIG
437437
# before attempting this static analysis, so that all necessary headers
438438
# and dependencies are properly installed:
439439
# make -C src install-analysis-deps
440+
ANALYSIS_DEPS := llvm clang llvm-tools libuv utf8proc
441+
ifeq ($(OS),Darwin)
442+
ANALYSIS_DEPS += llvmunwind
443+
else ifneq ($(OS),WINNT)
444+
ANALYSIS_DEPS += unwind
445+
endif
440446
install-analysis-deps:
441-
$(MAKE) -C $(JULIAHOME)/deps install-llvm install-clang install-llvm-tools install-libuv install-utf8proc install-unwind
447+
$(MAKE) -C $(JULIAHOME)/deps $(addprefix install-,$(ANALYSIS_DEPS))
442448

443449
analyzegc-deps-check: $(BUILDDIR)/julia_version.h $(BUILDDIR)/julia_flisp.boot.inc $(BUILDDIR)/jl_internal_funcs.inc
444450
ifeq ($(USE_BINARYBUILDER_LLVM),0)

src/codegen-stubs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ JL_DLLEXPORT int jl_compile_extern_c_fallback(LLVMOrcThreadSafeModuleRef llvmmod
5858
return 0;
5959
}
6060

61-
JL_DLLEXPORT void jl_teardown_codegen_fallback(void)
61+
JL_DLLEXPORT void jl_teardown_codegen_fallback(void) JL_NOTSAFEPOINT
6262
{
6363
}
6464

src/codegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8874,7 +8874,7 @@ extern "C" JL_DLLEXPORT void jl_init_codegen_impl(void)
88748874
init_jit_functions();
88758875
}
88768876

8877-
extern "C" JL_DLLEXPORT void jl_teardown_codegen_impl()
8877+
extern "C" JL_DLLEXPORT void jl_teardown_codegen_impl() JL_NOTSAFEPOINT
88788878
{
88798879
// output LLVM timings and statistics
88808880
reportAndResetTimings();

src/debug-registry.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <llvm/IR/DataLayout.h>
44

55
#include "julia.h"
6-
#include "julia_internal.h"
7-
#include "processor.h"
86

97
#include <map>
108
#include <mutex>

src/debuginfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ using namespace llvm;
3939
#include <set>
4040
#include <mutex>
4141
#include "julia_assert.h"
42+
#include "debug-registry.h"
4243

44+
static JITDebugInfoRegistry DebugRegistry;
4345

4446
static JITDebugInfoRegistry &getJITDebugRegistry() JL_NOTSAFEPOINT {
45-
return jl_ExecutionEngine->getDebugInfoRegistry();
47+
return DebugRegistry;
4648
}
4749

4850
struct debug_link_info {

src/dlload.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ const char *jl_crtdll_name = CRTDLL_BASENAME ".dll";
7070

7171
#define PATHBUF 4096
7272

73-
#define JL_RTLD(flags, FLAG) (flags & JL_RTLD_ ## FLAG ? RTLD_ ## FLAG : 0)
74-
7573
#ifdef _OS_WINDOWS_
7674
void win32_formatmessage(DWORD code, char *reason, int len) JL_NOTSAFEPOINT
7775
{
@@ -160,12 +158,21 @@ JL_DLLEXPORT void *jl_dlopen(const char *filename, unsigned flags) JL_NOTSAFEPOI
160158
if (!len) return NULL;
161159
WCHAR *wfilename = (WCHAR*)alloca(len * sizeof(WCHAR));
162160
if (!MultiByteToWideChar(CP_UTF8, 0, filename, -1, wfilename, len)) return NULL;
163-
HANDLE lib = LoadLibraryExW(wfilename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
164-
if (lib)
165-
needsSymRefreshModuleList = 1;
161+
HANDLE lib;
162+
if (flags & JL_RTLD_NOLOAD) {
163+
lib = GetModuleHandleW(wfilename);
164+
}
165+
else {
166+
lib = LoadLibraryExW(wfilename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
167+
if (lib)
168+
needsSymRefreshModuleList = 1;
169+
}
166170
return lib;
167171
}
168172
#else
173+
174+
#define JL_RTLD(flags, FLAG) (flags & JL_RTLD_ ## FLAG ? RTLD_ ## FLAG : 0)
175+
169176
JL_DLLEXPORT JL_NO_SANITIZE void *jl_dlopen(const char *filename, unsigned flags) JL_NOTSAFEPOINT
170177
{
171178
/* The sanitizers break RUNPATH use in dlopen for annoying reasons that are
@@ -186,7 +193,7 @@ JL_DLLEXPORT JL_NO_SANITIZE void *jl_dlopen(const char *filename, unsigned flags
186193
dlclose(libdl_handle);
187194
assert(dlopen);
188195
}
189-
// The real interceptors check the validty of the string here, but let's
196+
// The real interceptors check the validity of the string here, but let's
190197
// just skip that for the time being.
191198
#endif
192199
void *hnd = dlopen(filename,

src/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static _Atomic(int) support_conservative_marking = 0;
145145
* threads that enters `jl_gc_collect()` at the same time (or later calling
146146
* from unmanaged code) will wait in `jl_gc_collect()` until the GC is finished.
147147
*
148-
* Before starting the mark phase the GC thread calls `jl_safepoint_gc_start()`
148+
* Before starting the mark phase the GC thread calls `jl_safepoint_start_gc()`
149149
* and `jl_gc_wait_for_the_world()`
150150
* to make sure all the thread are in a safe state for the GC. The function
151151
* activates the safepoint and wait for all the threads to get ready for the

src/gf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,21 +2320,23 @@ jl_value_t *jl_fptr_const_return(jl_value_t *f, jl_value_t **args, uint32_t narg
23202320

23212321
jl_value_t *jl_fptr_args(jl_value_t *f, jl_value_t **args, uint32_t nargs, jl_code_instance_t *m)
23222322
{
2323+
jl_fptr_args_t invoke = jl_atomic_load_relaxed(&m->specptr.fptr1);
23232324
while (1) {
2324-
jl_fptr_args_t invoke = jl_atomic_load_relaxed(&m->specptr.fptr1);
23252325
if (invoke)
23262326
return invoke(f, args, nargs);
2327+
invoke = jl_atomic_load_acquire(&m->specptr.fptr1); // require forward progress with acquire annotation
23272328
}
23282329
}
23292330

23302331
jl_value_t *jl_fptr_sparam(jl_value_t *f, jl_value_t **args, uint32_t nargs, jl_code_instance_t *m)
23312332
{
23322333
jl_svec_t *sparams = m->def->sparam_vals;
23332334
assert(sparams != jl_emptysvec);
2335+
jl_fptr_sparam_t invoke = jl_atomic_load_relaxed(&m->specptr.fptr3);
23342336
while (1) {
2335-
jl_fptr_sparam_t invoke = jl_atomic_load_relaxed(&m->specptr.fptr3);
23362337
if (invoke)
23372338
return invoke(f, args, nargs, sparams);
2339+
invoke = jl_atomic_load_acquire(&m->specptr.fptr3); // require forward progress with acquire annotation
23382340
}
23392341
}
23402342

src/init.c

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static void jl_close_item_atexit(uv_handle_t *handle)
199199

200200
// This prevents `ct` from returning via error handlers or other unintentional
201201
// means by destroying some old state before we start destroying that state in atexit hooks.
202-
void jl_task_frame_noreturn(jl_task_t *ct);
202+
void jl_task_frame_noreturn(jl_task_t *ct) JL_NOTSAFEPOINT;
203203

204204
// cause this process to exit with WEXITSTATUS(signo), after waiting to finish all julia, C, and C++ cleanup
205205
JL_DLLEXPORT void jl_exit(int exitcode)
@@ -246,26 +246,26 @@ JL_DLLEXPORT void jl_atexit_hook(int exitcode) JL_NOTSAFEPOINT_ENTER
246246

247247
jl_task_t *ct = jl_get_current_task();
248248

249-
// we are about to start tearing everything down, so lets try not to get
250-
// upset by the local mess of things when we run the user's _atexit hooks
251-
if (ct)
249+
if (ct) {
250+
if (exitcode == 0)
251+
jl_write_compiler_output();
252+
// we are about to start tearing everything down, so lets try not to get
253+
// upset by the local mess of things when we run the user's _atexit hooks
254+
// this also forces us into a GC-unsafe region without a safepoint
252255
jl_task_frame_noreturn(ct);
256+
}
253257

254258
if (ct == NULL && jl_base_module)
255259
ct = container_of(jl_adopt_thread(), jl_task_t, gcstack);
260+
else if (ct != NULL)
261+
jl_gc_safepoint_(ct->ptls);
256262

257-
if (exitcode == 0)
258-
jl_write_compiler_output();
259263
jl_print_gc_stats(JL_STDERR);
260264
if (jl_options.code_coverage)
261265
jl_write_coverage_data(jl_options.output_code_coverage);
262266
if (jl_options.malloc_log)
263267
jl_write_malloc_log();
264268

265-
int8_t old_state;
266-
if (ct)
267-
old_state = jl_gc_unsafe_enter(ct->ptls);
268-
269269
if (jl_base_module) {
270270
jl_value_t *f = jl_get_global(jl_base_module, jl_symbol("_atexit"));
271271
if (f != NULL) {
@@ -334,19 +334,25 @@ JL_DLLEXPORT void jl_atexit_hook(int exitcode) JL_NOTSAFEPOINT_ENTER
334334
// force libuv to spin until everything has finished closing
335335
loop->stop_flag = 0;
336336
while (uv_run(loop, UV_RUN_DEFAULT)) { }
337-
JL_UV_UNLOCK();
337+
jl_wake_libuv(); // set the async pending flag, so that future calls are immediate no-ops on other threads
338+
// we would like to guarantee this, but cannot currently, so there is still a small race window
339+
// that needs to be fixed in libuv
340+
}
341+
if (ct)
342+
(void)jl_gc_safe_enter(ct->ptls); // park in gc-safe
343+
if (loop != NULL) {
344+
// TODO: consider uv_loop_close(loop) here, before shutdown?
345+
uv_library_shutdown();
346+
// no JL_UV_UNLOCK(), since it is now torn down
338347
}
339348

340-
// TODO: Destroy threads
349+
// TODO: Destroy threads?
341350

342-
jl_destroy_timing();
351+
jl_destroy_timing(); // cleans up the current timing_stack for noreturn
343352
#ifdef ENABLE_TIMINGS
344353
jl_print_timings();
345354
#endif
346-
347-
jl_teardown_codegen();
348-
if (ct)
349-
jl_gc_unsafe_leave(ct->ptls, old_state);
355+
jl_teardown_codegen(); // prints stats
350356
}
351357

352358
JL_DLLEXPORT void jl_postoutput_hook(void)
@@ -713,13 +719,32 @@ JL_DLLEXPORT int jl_default_debug_info_kind;
713719

714720
JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
715721
{
716-
jl_default_debug_info_kind = 0;
717-
722+
// initialize many things, in no particular order
723+
// but generally running from simple platform things to optional
724+
// configuration features
718725
jl_init_timing();
719726
// Make sure we finalize the tls callback before starting any threads.
720727
(void)jl_get_pgcstack();
721-
jl_safepoint_init();
728+
729+
// initialize backtraces
730+
jl_init_profile_lock();
731+
#ifdef _OS_WINDOWS_
732+
uv_mutex_init(&jl_in_stackwalk);
733+
SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_LOAD_LINES | SYMOPT_IGNORE_CVREC);
734+
if (!SymInitialize(GetCurrentProcess(), "", 1)) {
735+
jl_safe_printf("WARNING: failed to initialize stack walk info\n");
736+
}
737+
needsSymRefreshModuleList = 0;
738+
#else
739+
// nongnu libunwind initialization is only threadsafe on architecture where the
740+
// author could access TSAN, per https://github.com/libunwind/libunwind/pull/109
741+
// so we need to do this once early (before threads)
742+
rec_backtrace(NULL, 0, 0);
743+
#endif
744+
722745
libsupport_init();
746+
jl_safepoint_init();
747+
jl_page_size = jl_getpagesize();
723748
htable_new(&jl_current_modules, 0);
724749
JL_MUTEX_INIT(&jl_modules_mutex);
725750
jl_precompile_toplevel_module = NULL;
@@ -732,7 +757,6 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
732757
restore_signals();
733758
jl_init_intrinsic_properties();
734759

735-
jl_page_size = jl_getpagesize();
736760
jl_prep_sanitizers();
737761
void *stack_lo, *stack_hi;
738762
jl_init_stack_limits(1, &stack_lo, &stack_hi);
@@ -746,17 +770,12 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
746770
(HMODULE*)&jl_libjulia_handle)) {
747771
jl_error("could not load base module");
748772
}
749-
jl_ntdll_handle = jl_dlopen("ntdll.dll", 0); // bypass julia's pathchecking for system dlls
750-
jl_kernel32_handle = jl_dlopen("kernel32.dll", 0);
751-
jl_crtdll_handle = jl_dlopen(jl_crtdll_name, 0);
752-
jl_winsock_handle = jl_dlopen("ws2_32.dll", 0);
753-
uv_mutex_init(&jl_in_stackwalk);
754-
SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_LOAD_LINES | SYMOPT_IGNORE_CVREC);
755-
if (!SymInitialize(GetCurrentProcess(), "", 1)) {
756-
jl_printf(JL_STDERR, "WARNING: failed to initialize stack walk info\n");
757-
}
773+
jl_ntdll_handle = jl_dlopen("ntdll.dll", JL_RTLD_NOLOAD); // bypass julia's pathchecking for system dlls
774+
jl_kernel32_handle = jl_dlopen("kernel32.dll", JL_RTLD_NOLOAD);
775+
jl_crtdll_handle = jl_dlopen(jl_crtdll_name, JL_RTLD_NOLOAD);
776+
jl_winsock_handle = jl_dlopen("ws2_32.dll", JL_RTLD_NOLOAD);
777+
HMODULE jl_dbghelp = (HMODULE) jl_dlopen("dbghelp.dll", JL_RTLD_NOLOAD);
758778
needsSymRefreshModuleList = 0;
759-
HMODULE jl_dbghelp = (HMODULE) jl_dlopen("dbghelp.dll", 0);
760779
if (jl_dbghelp)
761780
jl_dlsym(jl_dbghelp, "SymRefreshModuleList", (void **)&hSymRefreshModuleList, 1);
762781
#else
@@ -774,7 +793,6 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel)
774793
}
775794

776795
jl_init_rand();
777-
jl_init_profile_lock();
778796
jl_init_runtime_ccall();
779797
jl_init_tasks();
780798
jl_init_threading();

src/jitlayers.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
#include <llvm/Target/TargetMachine.h>
2121
#include "julia_assert.h"
22-
#include "debug-registry.h"
22+
#include "julia.h"
23+
#include "julia_internal.h"
2324
#include "platform.h"
2425

2526
#include <stack>
@@ -487,10 +488,6 @@ class JuliaOJIT {
487488

488489
size_t getTotalBytes() const JL_NOTSAFEPOINT;
489490

490-
JITDebugInfoRegistry &getDebugInfoRegistry() JL_NOTSAFEPOINT {
491-
return DebugRegistry;
492-
}
493-
494491
jl_locked_stream &get_dump_emitted_mi_name_stream() JL_NOTSAFEPOINT {
495492
return dump_emitted_mi_name_stream;
496493
}
@@ -512,8 +509,6 @@ class JuliaOJIT {
512509
orc::JITDylib &GlobalJD;
513510
orc::JITDylib &JD;
514511

515-
JITDebugInfoRegistry DebugRegistry;
516-
517512
//Map and inc are guarded by RLST_mutex
518513
std::mutex RLST_mutex{};
519514
int RLST_inc = 0;

0 commit comments

Comments
 (0)