-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
zig-0.11.0-dev.3050+05ceac52c.tar.xz
Steps to Reproduce and Observed Behavior
git clone --recurse-submodules https://github.com/cryi/eli-zig-os- build build container
podman build ./containers/build/ -t elibuild - run build
podman run -w "/root/luabuild" -v $(pwd):"/root/luabuild" -v "$(pwd)/toolchains:/opt/cross" -e TOOLCHAINS='zig:x86_64-linux-musl' -it elibuild
It produces binary release/eli-linux-x86_64. It complains about some dependencies missing during the build but ignore that. This is stripped version just for this issue.
Run produced binary:
4. release/eli-linux-x86_64
5. paste in: hash.sha256sum("aa",true) and hit enter to trigger segfault
Everything worked as expected with 0.11.0-dev.1928+3169f0529. I am not sure when was issue introduced but yesterday build (0.11.0-dev.3045+526065723) was affected too.
Notes:
- if I remove -Os produced binary works as expected
- to change used compiler edit
containers/build/Dockerfile - to change compile flags edit CMakeLists.txt#11
- the code we use to trigger segfault is in lua-mbed-hash module
Expected Behavior
Binaries compiled with -Os and -Oz should not segfault.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior