You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Sep 20, 2016
· 1 comment
Assignees
Labels
armArchitecture: any ARMarmv7Architecture: ARMv7bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareregressionswift 3.0
Raspberry Pi 2 (32-bit armv7) running Raspbian Jessie
Built Swift 3 from source. (A bunch of components failed to build, but the Swift compiler got built.)
I've tested this code on Mac, iOS, Linux x86_64, and Android. The code compiles and works for all these other platforms. So this bug seems to be arm specific. (iOS and Android use x86_64 platforms to cross-compile, whereas I am directly compiling on the arm device to generate arm binaries which is the big difference there.)
I'm trying to use Swift 3 on a Raspberry Pi 2 (armv7). On code that used to compile in Swift 2.3, and code that currently compiles correctly on Swift 3 for Mac/Xcode 8, Linux x86_64, and for Android, I'm getting a compiler assertion failure and stack dump.
The simple pattern that seems to trigger this seems to come down to:
letpos_vec = cpv(0.0, 0.0);
cpBodySetPosition(body, pos_vec); // also tried explicit nil for body to try to suggest that it is the cpVect causing the problem
I'm attaching my slightly modified file trying to isolate the problem. It is line 1178 that trips up the compiler. (But if I comment this out, there are other instances of the code that trigger this.)
The full source code is in BlurrrMain.swift which can be found here. bitbucket.org/blurrr/flappyblurrrswift/src The project has a bunch of dependencies. I'm developing a cross-platform SDK that makes this easy to build. I'm happy to give you access to the SDK if it helps you debug this.
I have created a minimal, reproducible test case that can demonstrate this bug. It seems to be related to using a bridged C struct and function in Swift.
So in Swift, I have a simple function like which will cause the compiler to hit the assertion failure:
In this case, LastArgWritten is 2 and adustedArg.size() is 3
I am attaching a reproducible project called SwiftArmCompileBug.tar.gz.
There is a build.sh script to help build it, but if you want to jump directly to the failing part, the command is the 3rd one which is:
swift -frontend -c -targetarmv7-unknown-linux-gnueabihf -primary-fileBlurrrMain.swiftmain.swiftBlurrrMain.swift -import-objc-headerMySwiftBridgingHeader.h -emit-module -module-nameMyBlurrrProject -oBlurrrMain.swift.o
The text was updated successfully, but these errors were encountered:
armArchitecture: any ARMarmv7Architecture: ARMv7bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfcrashBug: A crash, i.e., an abnormal termination of softwareregressionswift 3.0
Attachment: Download
Environment
Raspberry Pi 2 (32-bit armv7) running Raspbian Jessie
Built Swift 3 from source. (A bunch of components failed to build, but the Swift compiler got built.)
I've tested this code on Mac, iOS, Linux x86_64, and Android. The code compiles and works for all these other platforms. So this bug seems to be arm specific. (iOS and Android use x86_64 platforms to cross-compile, whereas I am directly compiling on the arm device to generate arm binaries which is the big difference there.)
Additional Detail from JIRA
md5: 8f2abfe8f8520f432ecc0169bea57a0a
Issue Description:
I'm trying to use Swift 3 on a Raspberry Pi 2 (armv7). On code that used to compile in Swift 2.3, and code that currently compiles correctly on Swift 3 for Mac/Xcode 8, Linux x86_64, and for Android, I'm getting a compiler assertion failure and stack dump.
=======
______
I think Swift is having trouble with C-bindings. As far as I can tell, the compiler is breaking with stuff related to a type called cpVect defined as:
My code typically used a convenience function provided by the library defined as:
The simple pattern that seems to trigger this seems to come down to:
I'm attaching my slightly modified file trying to isolate the problem. It is line 1178 that trips up the compiler. (But if I comment this out, there are other instances of the code that trigger this.)The full source code is in BlurrrMain.swift which can be found here.bitbucket.org/blurrr/flappyblurrrswift/srcThe project has a bunch of dependencies. I'm developing a cross-platform SDK that makes this easy to build. I'm happy to give you access to the SDK if it helps you debug this.________________________________________________________________________
Update:
________________________________________________________________________
I have new/additional information for this bug.
I have created a minimal, reproducible test case that can demonstrate this bug. It seems to be related to using a bridged C struct and function in Swift.
So in Swift, I have a simple function like which will cause the compiler to hit the assertion failure:
In C, I have a header like so:
I make sure to include this header in my bridging header.
Compiling this on Pi is sufficient enough to trigger the Swift compiler assertion.
I know this code builds and works for Mac, iOS, Linux x86_64, and Android. I’m only having this problem with the Pi.
As a reminder, the assertion says:
In this case, LastArgWritten is 2 and adustedArg.size() is 3
I am attaching a reproducible project called SwiftArmCompileBug.tar.gz.
There is a build.sh script to help build it, but if you want to jump directly to the failing part, the command is the 3rd one which is:
The text was updated successfully, but these errors were encountered: