JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.9k stars 5.49k forks source link

EXCEPTION_ACCESS_VIOLATION when interrupting a non-interactive readline #39699

Open Maurdekye opened 3 years ago

Maurdekye commented 3 years ago

Minimum example require to recreate: Create a Julia file with the line readline(), run it directly from the command line with julia read_bug.jl, and attempt to interrupt it with Ctrl+C. Intead of throwing an InterruptException, as it does in an interactive session, it produces this memory access violation:

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x668c70ea -- jl_mutex_unlock at /cygdrive/d/buildbot/worker/package_win64/build/src\locks.h:143 [inlined]
jl_get_binding_ at /cygdrive/d/buildbot/worker/package_win64/build/src\module.c:294
in expression starting at C:\Users\<me>\Desktop\read_bug.jl:1

Tested with Julia 1.5.1 on Windows 10 64-bit.

JeffBezanson commented 3 years ago

When running scripts, Ctrl+C does not throw an exception but just sends a sigint as in normal executables. There might be another windows-specific bug here though.

peteristhegreat commented 2 months ago

I ran into this today on windows with Julia 1.6.7.

I thought julia -i was only for REPL interaction.

I see now that if I am planning on