-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[ms] [llvm-ml] SIGSEGV in checkForValidSection
in MasmParser
#123189
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
Comments
checkForValidSection
in MasmParsercheckForValidSection
in MasmParser
Taking the liberty of pinging @ericastor too as you've committed this code. |
#97635 ended up not being an actual issue in llvm. |
Thanks! It looks like this was missed in db48f1a, which changed the safety of calling Once that's fixed, it looks like you're still going to run into at least a couple of issues.
Thanks for finding another practical use case for |
Hi! Thanks a lot for the quick answer and fix! Unfortunately, I don't think I have enough time to invest into patching LLVM (or learning MASM, LLVM internals, and C++)… we'll see. Note for later: Incidentally, does this make sense to you? Do we still need NEAR/FAR for amd64? # llvm-ml-20 doesn't understand NEAR
sed -E -e 's/(EXTRN.*):.*NEAR/\1:PROC/g' -i runtime/amd64nt.asm |
I haven't had occasion to see a case where NEAR/FAR mattered... so I haven't gone through & implemented all the variations on that. Unfortunately, MASM is less well-documented than we might like, so it takes work (and a motivating example!) to figure out its exact semantics. For example, the |
I'm trying to cross-compile the OCaml compiler with a Debian host, targeting
x86_64-pc-windows
withclang-cl
. I'm running into a segfault fromllvm-ml
(the MASM assembler), a drop-in replacement for Microsoft'sml64
. I hit the issue with LLVM 18 and LLVM 20 (ea14bdb as the time of writing). Here is a reproducer, as a Dockerfile (build withdocker build --platform linux/amd64 .
), and the backtrace. I'm also attaching the offending asm file as a text file.amd64nt.txt
llvm-project/llvm/lib/MC/MCParser/MasmParser.cpp
Lines 1456 to 1463 in 628976c
Presumably
getStreamer()
returns anullptr
.It's possibly similar to #97635, I'll ping the participants: @sivan-shani @MaskRay.
Thanks for any help!
The text was updated successfully, but these errors were encountered: