Uploaded image for project: 'Swift'
  1. Swift
  2. SR-5846

Test weak-reference-racetests.swift failing on Linux/ARM




      I've noticed this issue while trying to build SPM with swift from the swift-4.0-branch branch on a RaspberryPi2 (swift-build-stage1 can't build the self hosted swift-build, crashing in the same way as weak-reference-racetests does). This is just one of the 16 failing tests listed in SR-5845.

      This is the output of gdb when I re-run the test manually:


      mainuser@justapi:~/buildSwiftOnARM/swift$ gdb --args /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/test-linux-armv7/Runtime/Output/weak-reference-racetests.swift.tmp/a.out --stdlib-unittest-in-process --stdlib-unittest-filter 'class instance property [SR-192] (copy)'
      GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
      Copyright (C) 2016 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:
      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/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/test-linux-armv7/Runtime/Output/weak-reference-racetests.swift.tmp/a.out...(no debugging symbols found)...done.
      (gdb) run
      Starting program: /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/test-linux-armv7/Runtime/Output/weak-reference-racetests.swift.tmp/a.out --stdlib-unittest-in-process --stdlib-unittest-filter class\ instance\ property\ \[SR-192\]\ \(copy\)
      Cannot parse expression `.L1185 4@r4'.
      warning: Probes-based dynamic linker interface failed.
      Reverting to original interface.
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
      StdlibUnittest: using filter: class instance property [SR-192] (copy)
      [ RUN ] WeakReferenceRaceTests.class instance property [SR-192] (copy)
      [New Thread 0x74a47430 (LWP 29196)]
      [New Thread 0x740ff430 (LWP 29197)]
      [New Thread 0x738ff430 (LWP 29198)]
      [New Thread 0x72eff430 (LWP 29199)]
      [New Thread 0x726ff430 (LWP 29200)]
      [New Thread 0x71cff430 (LWP 29201)]
      [Thread 0x71cff430 (LWP 29201) exited]
      Thread 2 "a.out" received signal SIGBUS, Bus error.
      [Switching to Thread 0x74a47430 (LWP 29196)]
      0x76edfda8 in swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::allocateSideTable() ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftCore.so
      (gdb) bt
      #0 0x76edfda8 in swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::allocateSideTable() ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftCore.so
      #1 0x76edfe74 in swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::formWeakReference() ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftCore.so
      #2 0x76ec9ff4 in swift_weakAssign ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftCore.so
      #3 0x000098e8 in _T04main4WBoxCACyxGxcfc ()
      #4 0x0000984c in _T04main4WBoxCACyxGxcfC ()
      #5 0x00009cbc in _T04main29RaceTest_instancePropertyCopyV04makeB4DataAA013WeakReferencebH0CyF ()
      #6 0x00009e0c in _T04main29RaceTest_instancePropertyCopyV14StdlibUnittest0bC16WithPerTrialDataAadEP04makebL00bL0QzyFTW
      #7 0x769affac in _T014StdlibUnittest21_masterThreadOneTrialyAA20_RaceTestSharedStateCyxGAA0gh7WithPerF4DataRzlF0gM0QzSicfU_Tf4dg_n ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftStdlibUnittest.so
      #8 0x769bc948 in _T014StdlibUnittest21_masterThreadOneTrialyAA20_RaceTestSharedStateCyxGAA0gh7WithPerF4DataRzlF0gM0QzSicfU_TA ()
      from /home/mainuser/buildSwiftOnARM/build/buildbot_linux/swift-linux-armv7/lib/swift/linux/libswiftStdlibUnittest.so


      The test crashes here.

      Since I've seen a few comments in the code hinting at the fact that further modifications(or improvements) to the layout of HeapObject could be needed on 32-bit platform, could this issue be related to that?

      The offset used in getHeapObject() makes sense, so I guess the real culprit is somewhere else.

      Greg Parker what do you suggest to look into to try to debug this further?





            Unassigned Unassigned
            uraimo Umberto Raimondi
            11 Vote for this issue
            18 Start watching this issue