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
[SR-10265] Compiler segfault when building custom clang module code against a bson_t #52665
Comments
Hm, yeah, I wouldn't expect that to fail. Have you gotten a chance to try with Swift 5 yet? Any custom build instructions? |
Comment by Matt Broadstone (JIRA) Hey, thanks for the quick response. You can build this branch of the swift driver. It requires you to have libmongoc installed which you can easily install via homebrew, or from source (this is in our README.md for further details). I'm testing against source install on ubuntu 18.04 of libmongoc 1.13.0. I haven't tested against Swift 5 on linux yet, but should be able to shortly. |
Comment by Matt Broadstone (JIRA) I can confirm this issue is not present on Swift 5, but not with the same test since that branch doesn't include all the needed changes for using |
Comment by Matt Broadstone (JIRA) Hi again, it looks like this problem is indeed present with Swift 5 on Linux. Here is the stack trace: 1. While emitting IR SIL function "@$s10MongoSwift8DocumentV7rawBSON10Foundation4DataVvg".
for getter for rawBSON (at /home/mbroadst/Development/mongo-swift-driver/Sources/MongoSwift/BSON/Document.swift:293:16)
2. /home/mbroadst/Development/mongo-swift-driver/.build/checkouts/swift-bson/libbson.h:4:10: Generating code for declaration '_bson_get_len'
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x462b784]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x4629550]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x462b932]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f8876db9390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f88754f8428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f88754fa02a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7f88754f0bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f88754f0c82]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x6f28b5]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x7ca056]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x7b0649]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x7bdf24]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x7accb7]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x7b6851]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x8141f1]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x819992]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x800416]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x89d076]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x899c0f]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x8a397f]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x8e8c43]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x9027d2]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x8fc539]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x9057e4]
ersions/5.0/usr/bin/swift[0x6faf40]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x6962ab]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x5256de]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x62852a]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x60f082]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x5236c4]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x5e5f5b]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x5e6647]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x4eb41d]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x4e6706]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x48da7e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f88754e3830]
/home/mbroadst/.swiftenv/versions/5.0/usr/bin/swift[0x48b8b9]
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)
Makefile:13: recipe for target 'all' failed
make: *** [all] Error 1 This should be easier to test with
|
@swift-ci create |
Environment
Ubuntu 18.04, Swift 4.2
Additional Detail from JIRA
md5: 59e08a11c4a48295fc1a65793daa9393
Issue Description:
In Swift 5 we no longer have type information for
bson_t
due to the fact that by default the type is 128 byte aligned. Unfortunately, the libbson api doesn't provide us an accessor for thelen
field of abson_t
, so I figured in the meantime I'd provide one built into our libbson bindings. This works fine on OSX, but crashes the linux compiler in clang code that's generating code for accessing thebson_t
. The backtrace for that looks like:So this brings up a few questions:
Why can we access
bson_t
's fields directly, but not in a custom helper within the bindingIt's clear that
bson_t
's alignment is a big issue for us, but I assumed if we were careful then treating them as {{OpaquePointer}} s would be fine. Am I completely wrong about that?The text was updated successfully, but these errors were encountered: