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

juliac --trim on windows gives exception #57941

Open
Ininterrompue opened this issue Mar 30, 2025 · 1 comment
Open

juliac --trim on windows gives exception #57941

Ininterrompue opened this issue Mar 30, 2025 · 1 comment
Labels
system:windows Affects only Windows trimming Issues with trimming functionality or PR's relevant to its performance/functionality

Comments

@Ininterrompue
Copy link

module HelloWorld

Base.@ccallable function main()::Cint
    println(Core.stdout, "Hello world")
    return 0
end

end

1.13.0-DEV.325, Windows 11, Powershell:

julia juliac.jl --output-exe hello --trim --experimental hello.jl

Compiles to a 12.7 MB binary, but gives an error when run:

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 0x7ff959ffcd21 -- Hello world

After compiling without --trim --experimental the resulting exe works fine.

@Ininterrompue Ininterrompue changed the title juliac on windows gives exception juliac --trim on windows gives exception Mar 30, 2025
@nsajko nsajko added system:windows Affects only Windows trimming Issues with trimming functionality or PR's relevant to its performance/functionality labels Mar 30, 2025
@Ininterrompue
Copy link
Author

Ininterrompue commented Apr 3, 2025

On 1.12-beta1, compiles to 1.8 MB, gives the following exception:

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 0x7ff96dcafd6a -- jl_svecref at C:/workdir/src\julia.h:1292 [inlined]
new_array at C:/workdir/src\array.c:80 [inlined]
ijl_alloc_array_1d at C:/workdir/src\array.c:149
in expression starting at none:0
jl_svecref at C:/workdir/src\julia.h:1292 [inlined]
new_array at C:/workdir/src\array.c:80 [inlined]
ijl_alloc_array_1d at C:/workdir/src\array.c:149
jl_restore_system_image_from_stream_ at C:/workdir/src\staticdata.c:3786
jl_restore_system_image_from_stream at C:/workdir/src\staticdata.c:4360 [inlined]
ijl_restore_system_image_data at C:/workdir/src\staticdata.c:4425
jl_load_sysimg_so at C:/workdir/src\staticdata.c:685 [inlined]
ijl_restore_system_image at C:/workdir/src\staticdata.c:4396
_finish_julia_init at C:/workdir/src\init.c:884
static_init at C:/Users/user/AppData/Local/Temp/jl_Kq3HZt\init.c:5
__do_global_ctors at C:/M/B/src/mingw-w64/mingw-w64-crt/crt\gccmain.c:44
__tmainCRTStartup at C:/M/B/src/mingw-w64/mingw-w64-crt/crt\crtexe.c:260
mainCRTStartup at C:/M/B/src/mingw-w64/mingw-w64-crt/crt\crtexe.c:186
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 0 (Pool: 0; Big: 0); GC: 0

This is also occurring with the non-trimmed version, without --trim --experimental in the compile command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows trimming Issues with trimming functionality or PR's relevant to its performance/functionality
Projects
None yet
Development

No branches or pull requests

2 participants