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-4613] Build failure on ARM: "Cannot destroy a value that still has uses!" #47190

Bouke opened this issue Apr 17, 2017 · 4 comments

[SR-4613] Build failure on ARM: "Cannot destroy a value that still has uses!" #47190

Bouke opened this issue Apr 17, 2017 · 4 comments


Copy link

@Bouke Bouke commented Apr 17, 2017

Previous ID SR-4613
Radar None
Original Reporter @Bouke
Type Bug
Status Closed
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, arm, armv7
Assignee None
Priority Medium

md5: 3c12dd6ff752f2642cec661d6b8b7c61

Issue Description:

I'm trying to build Swift 3.1 on Raspberry Pi 3 / Raspbian Jessie. I'm building from "swift-3.1-branch" using

When compiling I got stuck on the following point:

[625/683] Compiling /home/pi/swift-source...neSupport/linux/armv7/SwiftOnoneSupport.o

I ran the compilation of that specific file from gdb, and it fails somewhere on an assertion. Any clues on why this happens, and what I might be able to do about it?

$ sudo gdb --args /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/bin/swift
-frontend -c /home/pi/swift-source/swift/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift -disable-objc-attr-requires-foundation-module -target armv7-unknown-linux-gnueabihf -
disable-objc-interop -sdk / -I /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/./lib/swift/linux/armv7 -module-cache-path /home/pi/swift-source/build/buildbot_linux/swif
t-linux-armv7/./module-cache -module-link-name swiftSwiftOnoneSupport -parse-stdlib -resource-dir /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/./lib/swift -D INTERNAL
_CHECKS_ENABLED -sil-serialize-all -color-diagnostics -O -parse-as-library -module-name SwiftOnoneSupport -o /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/stdlib/publi
GNU gdb (Raspbian 7.7.1+dfsg-5+rpi1) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/bin/swift...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/bin/swift -frontend -c /home/pi/swift-source/swift/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.sw
ift -disable-objc-attr-requires-foundation-module -target armv7-unknown-linux-gnueabihf -disable-objc-interop -sdk / -I /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/.
/lib/swift/linux/armv7 -module-cache-path /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/./module-cache -module-link-name swiftSwiftOnoneSupport -parse-stdlib -resource
-dir /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/./lib/swift -D INTERNAL_CHECKS_ENABLED -sil-serialize-all -color-diagnostics -O -parse-as-library -module-name Swift
OnoneSupport -o /home/pi/swift-source/build/buildbot_linux/swift-linux-armv7/stdlib/public/SwiftOnoneSupport/linux/armv7/SwiftOnoneSupport.o
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/".
[New Thread 0x75615410 (LWP 2545)]
swift: /home/pi/swift-source/swift/include/swift/SIL/SILValue.h:139: swift::ValueBase::~ValueBase(): Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x75615410 (LWP 2545)]
0x76c5df70 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#&#8203;0  0x76c5df70 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#&#8203;1  0x76c5f324 in __GI_abort () at abort.c:89
#&#8203;2  0x76c56d98 in __assert_fail_base (fmt=0x0,
    assertion=0x3b44b61 "use_empty() && \"Cannot destroy a value that still has uses!\"", assertion@entry=0x0, file=0x1 <error: Cannot access memory at address 0x1>,
    file@entry=0x75615410 "\001", line=139, line@entry=1993793684,
    function=function@entry=0x3b44b9e "swift::ValueBase::~ValueBase()")
    at assert.c:92
#&#8203;3  0x76c56e74 in __GI___assert_fail (assertion=0x0, file=0x75615410 "\001",
    line=1993793684, function=0x3b44b9e "swift::ValueBase::~ValueBase()")
    at assert.c:101
#&#8203;4  0x00c31854 in swift::SILVisitor<(anonymous namespace)::InstructionDestroyer, void>::visit(swift::ValueBase*) ()
#&#8203;5  0x00c2e6e4 in swift::SILInstruction::destroy(swift::SILInstruction*) ()
#&#8203;6  0x00c1768c in swift::SILFunction::~SILFunction() ()
#&#8203;7  0x00c4867c in swift::SILModule::~SILModule() ()
#&#8203;8  0x000a3e4c in std::thread::_Impl<std::_Bind_simple<performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int)::$_5 ()> >::_M_run() ()
#&#8203;9  0x76e43348 in ?? () from /usr/lib/arm-linux-gnueabihf/
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Copy link

@swift-ci swift-ci commented Apr 18, 2017

Comment by Umberto Raimondi (JIRA)

Just to add more info, on the same board (RaspberryPi 2 or 3, ARMv7 boards) but with Ubuntu 16.04 the build completes correctly and that file is being compiled.

Since the trace is referring to SIL, I've verified that in both cases (swift compiled on ubuntu and jessie) the canonical SIL generated with -emit-sil is the same: supp_working.txt, but as explained above the full compilation of swift/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift fails on Jessie.

Copy link

@belkadan belkadan commented Apr 18, 2017

@gottesmm, any idea what's up with this?

Copy link

@gottesmm gottesmm commented Apr 19, 2017

No. You could try running with -sil-verify-all to see what comes up. But it is very weird that during the tear down of SILFunction this would happen.

Copy link

@swift-ci swift-ci commented Sep 6, 2017

Comment by Umberto Raimondi (JIRA)

FYI, the latest Raspbian is now based on Debian Stretch and everything builds correctly, this bug can be considered obsolete.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

4 participants