[llvm-bugs] [Bug 36364] New: [WebAssembly] assertion when an expression has relative offset (?)

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 13 06:28:09 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36364

            Bug ID: 36364
           Summary: [WebAssembly] assertion when an expression has
                    relative offset (?)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: patrickyccheng at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hopefully, I got the extra description correct. The assertion happens in
recordRelocation.

Here is a dump of some of the variables:
Target.isAbsolute: 0
Fixup.getKind(): 2
Fixup.getValue():
dumpMCExpr: Binary: opCode: Add
LHS
        dumpMCExpr:     Binary: opCode: Sub
        LHS
                dumpMCExpr:             Symbol: .L__unnamed_533
        RHS
                dumpMCExpr:             Symbol: l__swift5_reflection_descriptor

RHS
        dumpMCExpr:     Constant: -12

FixupSection.getSectionName(): swift3_capture
Target.getConstant: 0
Target.getSymB:
  l__swift5_reflection_descriptor : isInSection: true isRegistered: true
SymBOffset: 0
FixupOffset: 12



and looks like this is where 'swift5_reflection_descriptor symbol itself is
generated: 
https://github.com/apple/swift/blob/master-next/lib/IRGen/GenReflection.cpp#L267

Assertion failed: (!IsPCRel), function recordRelocation, file
/Users/pcheng/github/swift-source/llvm/lib/MC/WasmObjectWriter.cpp, line 578.
0  swift                    0x0000000111e95fa8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000111e94ef6 llvm::sys::RunSignalHandlers() +
86
2  swift                    0x0000000111e9656e SignalHandler(int) + 366
3  libsystem_platform.dylib 0x00007fff6f926f5a _sigtramp + 26
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 2423099584
5  libsystem_c.dylib        0x00007fff6f751312 abort + 127
6  libsystem_c.dylib        0x00007fff6f719368 basename_r + 0
7  swift                    0x0000000111c82142 (anonymous
namespace)::WasmObjectWriter::recordRelocation(llvm::MCAssembler&,
llvm::MCAsmLayout const&, llvm::MCFragment const*, llvm::MCFixup const&,
llvm::MCValue, unsigned long long&) + 4498
8  swift                    0x0000000111c42d12
llvm::MCAssembler::layout(llvm::MCAsmLayout&) + 1298
9  swift                    0x0000000111c43014 llvm::MCAssembler::Finish() + 52
10 swift                    0x0000000111c70a41 llvm::MCStreamer::Finish() + 145
11 swift                    0x00000001102bf5b2
llvm::AsmPrinter::doFinalization(llvm::Module&) + 3906
12 swift                    0x0000000111d789c0
llvm::FPPassManager::doFinalization(llvm::Module&) + 80
13 swift                    0x0000000111d78e2d
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1053
14 swift                    0x000000010eecf46b
swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*,
llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*,
llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef,
swift::UnifiedStatsReporter*) + 2379
15 swift                    0x000000010ed72dd7
performCompile(swift::CompilerInstance&, swift::CompilerInvocation&,
llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*,
swift::UnifiedStatsReporter*) + 14791
16 swift                    0x000000010ed6e51a
swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*,
swift::FrontendObserver*) + 3274
17 swift                    0x000000010ed2e16b main + 2315
18 libdyld.dylib            0x00007fff6f6a5115 start + 1
19 libdyld.dylib            0x000000000000002a start + 2425728790
Stack dump:
0.      Program arguments:
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swift
-frontend -c -filelist
/var/folders/xf/fkvz4dzj7ld993j9bh9pnlz40000gr/T/sources-80368c
-disable-objc-attr-requires-foundation-module -target
wasm32-unknown-unknown-wasm -disable-objc-interop -sdk
/Users/pcheng/github/swift-source/wasm-install/sysroot -I
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./lib/swift/webassembly/wasm32
-warn-swift3-objc-inference-complete -g -module-cache-path
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./module-cache
-module-link-name swiftCore -nostdimport -parse-stdlib -resource-dir
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/./lib/swift
-swift-version 3 -O -D INTERNAL_CHECKS_ENABLED -group-info-path
/Users/pcheng/github/swift-source/swift/stdlib/public/core/GroupInfo.json
-enable-sil-ownership -Xllvm -sil-inline-generics -Xllvm
-sil-partial-specialization -Xcc -D__SWIFT_CURRENT_DYLIB=swiftCore
-parse-as-library -module-name Swift -o
/Users/pcheng/github/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/core/webassembly/wasm32/Swift.o
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal 6 (use -v to see
invocation

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180213/7255ea89/attachment-0001.html>


More information about the llvm-bugs mailing list