Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 940500 - dev-lang/swift-5.10.1: Project using SQLite.swift crashes at runtime
Summary: dev-lang/swift-5.10.1: Project using SQLite.swift crashes at runtime
Status: RESOLVED FIXED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Itai Ferber
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-30 00:42 UTC by colin
Modified: 2024-10-13 15:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Sample project demonstrating the issue (sst.tar.gz,674 bytes, application/gzip)
2024-09-30 00:42 UTC, colin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description colin 2024-09-30 00:42:12 UTC
Works fine in the official Swift Docker image, but not on my Gentoo system

Reproducible: Always

Steps to Reproduce:
1. Create a project that uses SQLite.swift to open a database
2. `swift run`
Actual Results:  
Prints error at runtime:
```
sst: /var/tmp/portage/dev-lang/swift-5.10.1/work/swift/stdlib/public/runtime/Metadata.cpp:1577: (anonymous namespace)::FunctionCacheEntry::FunctionCacheEntry(const Key &): Assertion `false && "objc block without objc interop?"' failed.
fish: Job 1, 'swift run' terminated by signal SIGABRT (Abort)
```

Expected Results:  
It should successfully open the database
Comment 1 colin 2024-09-30 00:42:45 UTC
Created attachment 904223 [details]
Sample project demonstrating the issue
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-30 00:44:49 UTC
It's possible that the Docker image doesn't build Swift with assertions.
Comment 3 Itai Ferber 2024-10-09 17:57:06 UTC
Sorry about this! Indeed, I believe the Swift Docker images build without assertions, and we should be doing the same here too. I can confirm the crash trivially, but I haven't had the time yet to rebuild Swift 5.10.1 without assertions to confirm the fix (I'm still trying to get Swift 6.0.1 built and I have limited compute resources) — hoping to get to this soon!
Comment 4 Itai Ferber 2024-10-13 01:27:21 UTC
Confirmed that compiling Swift without assertions resolves the issue. Fix incoming in swift-5.10.1-r1.
Comment 5 Larry the Git Cow gentoo-dev 2024-10-13 14:51:32 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2a36ac399b06cd73f2be2c7d0df56dc82eb31fb4

commit 2a36ac399b06cd73f2be2c7d0df56dc82eb31fb4
Author:     Itai Ferber <itai@itaiferber.net>
AuthorDate: 2024-10-13 01:27:34 +0000
Commit:     Itai Ferber <itai@itaiferber.net>
CommitDate: 2024-10-13 01:31:25 +0000

    dev-lang/swift: build without compiler assertions
    
    Closes: https://bugs.gentoo.org/940500
    Signed-off-by: Itai Ferber <itai@itaiferber.net>

 dev-lang/swift/swift-5.10.1-r1.ebuild | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-13 14:52:33 UTC
This needs a new revision as it changes the installed binary (the bug itself involves runtime behaviour).
Comment 7 Itai Ferber 2024-10-13 15:22:25 UTC
Indeed, the change was introduced in a new revision (-r1)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-13 15:23:26 UTC
Ah, the commit didn't make it obvious, you're right of course: https://gitweb.gentoo.org/repo/proj/guru.git/log/dev-lang/swift/swift-5.10.1-r1.ebuild.
Comment 9 Itai Ferber 2024-10-13 15:25:05 UTC
Yeah, sorry — I had a few reasons to introduce -r1 and I didn't want the individual changes to get lost; agreed that it was unclear! (And thanks for checking!)