Skip to content

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

Closed

Description

@Bouke
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 https://github.com/uraimo/buildSwiftOnARM.

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
c/SwiftOnoneSupport/linux/armv7/SwiftOnoneSupport.o
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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
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/libthread_db.so.1".
[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/libstdc++.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

Activity

  1. swift-ci commented on Apr 18, 2017

    @swift-ci
    Contributor

    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.

  2. belkadan commented on Apr 18, 2017

    @belkadan
    Contributor

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

  3. gottesmm commented on Apr 19, 2017

    @gottesmm
    Contributor

    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.

  4. swift-ci commented on Sep 6, 2017

    @swift-ci
    Contributor

    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.

  5. added
    crashBug: A crash, i.e., an abnormal termination of software
    on Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    armArchitecture: any ARMarmv7Architecture: ARMv7bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions