Skip to content
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-12674] Cross Module Optimization Swift 5.2.2 crashes #55118

Closed
jdmcd opened this issue Apr 26, 2020 · 8 comments
Closed

[SR-12674] Cross Module Optimization Swift 5.2.2 crashes #55118

jdmcd opened this issue Apr 26, 2020 · 8 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@jdmcd
Copy link

jdmcd commented Apr 26, 2020

Previous ID SR-12674
Radar rdar://problem/62403317
Original Reporter @jdmcd
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 02cdb285ffef8018cc74958289ea2176

Issue Description:

I am running the following Dockerfile:

# ================================ 
# Build image 
# ================================ 
FROM vapor/swift:latest as build 
WORKDIR /build  
COPY --chown=root:root .ssh/* /root/.ssh/ 
RUN chmod 600 /root/.ssh/key 
COPY . . 
RUN swift build -c release Xswiftc -cross-module-optimization 

# ================================ 
# Run image 
# ================================ 
FROM vapor/ubuntu:18.04 
WORKDIR /app 

COPY --from=build /build/.build/release /app 
COPY --from=build /usr/lib/swift/ /usr/lib/swift/
COPY --from=build /build/Resources /app/Resources 
ENTRYPOINT ["./Run"] CMD ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "80"] 

I get the following crash:

swift: /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/lib/AST/Decl.cpp:3029: bool swift::ValueDecl::isUsableFromInline() const: Assertion `getFormalAccess() <= AccessLevel::Internal' failed.
Stack dump:
0.    Program arguments: /usr/bin/swift -frontend -c /build/.build/checkouts/queues/Sources/Queues/Application+Queues.swift (lots more files)
1.    Swift version 5.2.2 (swift-5.2.2-RELEASE)
2.    While running pass #&#8203;2015 SILModuleTransform "CrossModuleSerializationSetup".
@weissi
Copy link
Member

weissi commented Apr 26, 2020

@swift-ci create

@weissi
Copy link
Member

weissi commented Apr 26, 2020

CC @eeckstein

@jdmcd
Copy link
Author

jdmcd commented Apr 27, 2020

@weissi @eeckstein I’m happy to upload the full project to repro if needed but I’ll have to do it via a Feedback as it’s a private project.

@eeckstein
Copy link
Member

@jdmcd yes, that would be very helpful!

@jdmcd
Copy link
Author

jdmcd commented Apr 28, 2020

@eeckstein here you go! FB7679587

@jdmcd
Copy link
Author

jdmcd commented Apr 30, 2020

FYI - after I increased memory limits I got a different CMO error:

/usr/bin/ld.gold: error: /build/.build/x86_64-unknown-linux-gnu/release/AsyncHTTPClient.build/HTTPClient+HTTPCookie.swift.o: multiple definition of '$s3NIO15EventLoopFutureCyytGIego_ytADIegno_TR'
/usr/bin/ld.gold: /build/.build/x86_64-unknown-linux-gnu/release/App.build/Controllers/Consumer/Jobs/Activity/ActivityAttachmentsController.swift.o: previous definition here
/usr/bin/ld.gold: error: /build/.build/x86_64-unknown-linux-gnu/release/AsyncKit.build/ConnectionPool/ConnectionPoolError.swift.o: multiple definition of '$sIeg_ytytIegnr_TR'
/usr/bin/ld.gold: /build/.build/x86_64-unknown-linux-gnu/release/AsyncHTTPClient.build/HTTPClient+HTTPCookie.swift.o: previous definition here
/usr/bin/ld.gold: error: /build/.build/x86_64-unknown-linux-gnu/release/AsyncKit.build/ConnectionPool/ConnectionPoolError.swift.o: multiple definition of '$ss6ResultOyyts5Error_pGIegg_ADIegn_TR'
/usr/bin/ld.gold: /build/.build/x86_64-unknown-linux-gnu/release/AsyncHTTPClient.build/HTTPClient+HTTPCookie.swift.o: previous definition here
/usr/bin/ld.gold: error: /build/.build/x86_64-unknown-linux-gnu/release/RedisKit.build/Exports.swift.o: multiple definition of '$sSiSbIegyd_SiSbIegnr_TR'
/usr/bin/ld.gold: /build/.build/x86_64-unknown-linux-gnu/release/RediStack.build/ChannelHandlers/RedisByteDecoder.swift.o: previous definition here
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

@eeckstein
Copy link
Member

Both problems should be fixed by
#31395 (master)
#31397 (5.3)

@jdmcd
Copy link
Author

jdmcd commented Apr 30, 2020

Thank you so much!!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants