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

Compiler crashes when compiling with -target-features:soft-float #4868

Open
tlo9 opened this issue Feb 23, 2025 · 1 comment
Open

Compiler crashes when compiling with -target-features:soft-float #4868

tlo9 opened this issue Feb 23, 2025 · 1 comment

Comments

@tlo9
Copy link

tlo9 commented Feb 23, 2025

Context

System Info:

	Odin:    dev-2025-02
	OS:      Linux Mint 21.3, Linux 6.8.0-52-generic
	CPU:     AMD Ryzen 5 7600X 6-Core Processor             
	RAM:     63481 MiB
	Backend: LLVM 14.0.0

test.odin

package test

import "core:fmt"

main :: proc() {
    x: f32 = 3.0 / 12.0
    fmt.printfln("3 / 12 = %.2f", x)
}

Expected Behavior

The code should compile and run with the following being printed to stdout:

3 / 12 = 0.25

Current Behavior

After running odin run test.odin -file -target-features:soft-float, the compiler crashes. The file test.o is created, but it has a file size of 0. Similarly, executing odin build test.odin -file -target-features:soft-float results in a compiler crash.

Executing odin run test.odin -file, however, results in the expected behavior.

Failure Information (for bugs)

This is the output (likely due to a buffer overflow):

*** stack smashing detected ***: terminated
Aborted (core dumped)

Failure Logs

Feb 23 06:52:40 Case systemd[1]: Started Process Core Dump (PID 713913/UID 0).
Feb 23 06:52:41 Case systemd-coredump[713914]: Process 713900 (odin) of user 1000 dumped core.
                                               
                                               Found module /home/user/src/Odin-dev-2025-01/odin with build-id: 8c13b2e3ee216180deaa31c055457bc0b696c3b6
                                               Found module linux-vdso.so.1 with build-id: 01ded5aba9bc730203f9478e5241266163a868a2
                                               Found module libicudata.so.70 with build-id: b1c2496dd0543023c7a19c961bb7f3abc818f465
                                               Found module libmd.so.0 with build-id: cd2d2f71b3967ebde30e2aa43b8eb63339020c06
                                               Found module liblzma.so.5 with build-id: b85da6c48eb60a646615392559483b93617ef265
                                               Found module libicuuc.so.70 with build-id: bef3ff1d70aadd68aab07d858a759360c8b919ae
                                               Found module libbsd.so.0 with build-id: 9a6c72469251e2feb63e175ef5cb944ce6e00df3
                                               Found module libxml2.so.2 with build-id: 8d1673807d5b6cc31890cb3bcc5bcbc76e156304
                                               Found module libtinfo.so.6 with build-id: e22ba7829a55a0dec2201a0b6dac7ba236118561
                                               Found module libz.so.1 with build-id: 30840b79ac329ecbf1dec0bb60180eed256d319f
                                               Found module libedit.so.2 with build-id: 9fcc3490de1a1f4919b1f6e398c99c7fa25f6863
                                               Found module libffi.so.8 with build-id: 59c2a6b204f74f358ca7711d2dfd349d88711f6a
                                               Found module ld-linux-x86-64.so.2 with build-id: e4de036b19e4768e7591b596c4be9f9015f2d28a
                                               Found module libc.so.6 with build-id: cd410b710f0f094c6832edd95931006d883af48e
                                               Found module libgcc_s.so.1 with build-id: e3a44e0da9c6e835d293ed8fd2882b4c4a87130c
                                               Found module libLLVM-14.so.1 with build-id: 2bc68177e1745130d2e10f07f1644b9def97578b
                                               Found module libstdc++.so.6 with build-id: e37fe1a879783838de78cbc8c80621fa685d58a2
                                               Found module libm.so.6 with build-id: 7d8778fca8ea4621b268cc03662855d0cd983439
                                               Stack trace of thread 713900:
                                               #0  0x000074fb628969fc __pthread_kill_implementation (libc.so.6 + 0x969fc)
                                               #1  0x000074fb62842476 __GI_raise (libc.so.6 + 0x42476)
                                               #2  0x000074fb628287f3 __GI_abort (libc.so.6 + 0x287f3)
                                               #3  0x000074fb62889677 __libc_message (libc.so.6 + 0x89677)
                                               #4  0x000074fb6293659a __GI___fortify_fail (libc.so.6 + 0x13659a)
                                               #5  0x000074fb62936566 __stack_chk_fail (libc.so.6 + 0x136566)
                                               #6  0x000074fb6625ba4c n/a (libLLVM-14.so.1 + 0x365ba4c)
                                               #7  0x000074fb642034cb _ZNK4llvm14TargetLowering21LowerOperationWrapperEPNS_6SDNodeERNS_15SmallVectorImplINS_7SDValueEEERNS_12SelectionDAGE (libLLVM-14.so.1 + 0x16034cb)
                                               #8  0x000074fb64169afd n/a (libLLVM-14.so.1 + 0x1569afd)
                                               #9  0x000074fb6418a560 n/a (libLLVM-14.so.1 + 0x158a560)
                                               #10 0x000074fb64167089 n/a (libLLVM-14.so.1 + 0x1567089)
                                               #11 0x000074fb6416acbf _ZN4llvm12SelectionDAG13LegalizeTypesEv (libLLVM-14.so.1 + 0x156acbf)
                                               #12 0x000074fb64258150 _ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv (libLLVM-14.so.1 + 0x1658150)
                                               #13 0x000074fb642579c8 _ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE (libLLVM-14.so.1 + 0x16579c8)
                                               #14 0x000074fb64255557 _ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE (libLLVM-14.so.1 + 0x1655557)
                                               #15 0x000074fb661f7a0d n/a (libLLVM-14.so.1 + 0x35f7a0d)
                                               #16 0x000074fb63dc628e _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE (libLLVM-14.so.1 + 0x11c628e)
                                               #17 0x000074fb63b7a390 _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE (libLLVM-14.so.1 + 0xf7a390)
                                               #18 0x000074fb63b81983 _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE (libLLVM-14.so.1 + 0xf81983)
                                               #19 0x000074fb63b7af36 _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE (libLLVM-14.so.1 + 0xf7af36)
                                               #20 0x000074fb654b337c n/a (libLLVM-14.so.1 + 0x28b337c)
                                               #21 0x000074fb654b3174 LLVMTargetMachineEmitToFile (libLLVM-14.so.1 + 0x28b3174)
                                               #22 0x00005b9521937ce0 n/a (/home/user/src/Odin-dev-2025-01/odin + 0x73ce0)
                                               #23 0x00005b95218ffc57 n/a (/home/user/src/Odin-dev-2025-01/odin + 0x3bc57)
                                               #24 0x0000000000000011 n/a (n/a + 0x0)
@laytan
Copy link
Collaborator

laytan commented Feb 24, 2025

Want to note we don't support soft floats currently, see #4143

That being said we shouldn't crash and burn like that though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants