-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Trying to assemble ldr r0, =0xfefaff leads to a SEGFAULT in LLVM.
Reproduce with ./nyxstone --arch armv8m -A ldr r0, =0xfefaff. Stack trace:
==48173==The signal is caused by a READ memory access.
==48173==Hint: address points to the zero page.
#0 0x64b7826a51f6 in llvm::ARMTargetStreamer::addConstantPoolEntry(llvm::MCExpr const*, llvm::SMLoc) (/home/stuxnot/nyxstone/build/nyxstone+0xc5a1f6) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#1 0x64b78261d009 in (anonymous namespace)::ARMAsmParser::processInstruction(llvm::MCInst&, llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand> > > const&, llvm::MCStreamer&) (/home/stuxnot/nyxstone/build/nyxstone+0xbd2009) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#2 0x64b782601203 in (anonymous namespace)::ARMAsmParser::MatchAndEmitInstruction(llvm::SMLoc, unsigned int&, llvm::SmallVectorImpl<std::unique_ptr<llvm::MCParsedAsmOperand, std::default_delete<llvm::MCParsedAsmOperand> > >&, llvm::MCStreamer&, unsigned long&, bool) (/home/stuxnot/nyxstone/build/nyxstone+0xbb6203) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#3 0x64b78367abda in (anonymous namespace)::AsmParser::parseAndMatchAndEmitTargetInstruction((anonymous namespace)::ParseStatementInfo&, llvm::StringRef, llvm::AsmToken, llvm::SMLoc) (/home/stuxnot/nyxstone/build/nyxstone+0x1c2fbda) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#4 0x64b78366dd7f in (anonymous namespace)::AsmParser::parseStatement((anonymous namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) (/home/stuxnot/nyxstone/build/nyxstone+0x1c22d7f) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#5 0x64b78366723c in (anonymous namespace)::AsmParser::Run(bool, bool) (/home/stuxnot/nyxstone/build/nyxstone+0x1c1c23c) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#6 0x64b781fb5f8a in nyxstone::Nyxstone::assemble_impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, std::vector<nyxstone::Nyxstone::LabelDefinition, std::allocator<nyxstone::Nyxstone::LabelDefinition> > const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<nyxstone::Nyxstone::Instruction, std::allocator<nyxstone::Nyxstone::Instruction> >*) const (/home/stuxnot/nyxstone/build/nyxstone+0x56af8a) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#7 0x64b781faf112 in nyxstone::Nyxstone::assemble_to_instructions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, std::vector<nyxstone::Nyxstone::LabelDefinition, std::allocator<nyxstone::Nyxstone::LabelDefinition> > const&) const (/home/stuxnot/nyxstone/build/nyxstone+0x564112) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#8 0x64b781f3f85d in main (/home/stuxnot/nyxstone/build/nyxstone+0x4f485d) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
#9 0x759926c41d49 (/usr/lib/libc.so.6+0x25d49) (BuildId: 915eeec6439cfded1125deefc44a8d73e57873d9)
#10 0x759926c41e0b in __libc_start_main (/usr/lib/libc.so.6+0x25e0b) (BuildId: 915eeec6439cfded1125deefc44a8d73e57873d9)
#11 0x64b781f3c614 in _start (/home/stuxnot/nyxstone/build/nyxstone+0x4f1614) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/stuxnot/nyxstone/build/nyxstone+0xc5a1f6) (BuildId: 95b68f8e1575f8feb3ea63dd5c274ff0124ca25b) in llvm::ARMTargetStreamer::addConstantPoolEntry(llvm::MCExpr const*, llvm::SMLoc)
Metadata
Metadata
Assignees
Labels
No labels