** Description changed:

- (marked as not a regression)
- 
- Autopkgtest command1 fails for AMD64 and ARM64 for resolute and
+ * Autopkgtest command1 fails for AMD64 and ARM64 for resolute and
  stonking:
  
  361s echo "Testing sanitizers ..."
- 361s 
- 361s echo '#include <stdlib.h>
- 361s int main() {
- 361s   char *x = (char*)malloc(10 * sizeof(char*));
- 361s   free(x);
- 361s   return x[5];
- 361s }
- 361s ' > foo.c
- 361s clang-$VERSION -o foo -fsanitize=address -O1 -fno-omit-frame-pointer -g  
foo.c
- 361s if ! ./foo 2>&1 | grep -q heap-use-after-free ; then
- 361s     echo "sanitize=address is failing"
- 361s     exit 42
- 361s fi
- 361s 
  ...
  361s # fails on i386 with: clang: error: unsupported option 
'-fsanitize=thread' for target 'i686-pc-linux-gnu'
  361s if [ $DEB_HOST_ARCH != "i386" ]; then
  361s     clang-$VERSION -o foo -fsanitize=thread -g -O1 foo.c
  361s     if ! strings ./foo 2>&1 | grep -q "tsan"; then
  361s         echo "binary doesn't contain tsan code"
  361s         strings foo
  361s         exit 42
  361s     fi
  361s     if ! ./foo 2>&1 | grep -q "data race"; then
  361s         echo "sanitize=address is failing"
  361s         exit 42
  361s     fi
  361s fi
  361s sanitize=address is failing
  363s autopkgtest [15:23:37]: test command1: -----------------------]
  365s autopkgtest [15:23:39]: test command1:  - - - - - - - - - - results - - 
- - - - - - - -
  365s command1             FAIL non-zero exit status 42
+ 
+ * A more detailed log:
+ 
+ 318s sanitize=thread is failing; output was:
+ 318s FATAL: ThreadSanitizer: unexpected memory mapping 
0xb887028f0000-0xb88702a1d000
+ 318s kernel: 6.8.0-142-generic
+ 318s sysctl: permission denied on key 'vm.mmap_rnd_bits'
+ 318s retrying with ASLR disabled:
+ 318s ==================
+ 318s WARNING: ThreadSanitizer: data race (pid=5063)
+ 318s   Write of size 4 at 0xaaaaac013060 by thread T2:
+ 318s     #0 Thread2 /tmp/autopkgtest.wiwLhx/build.U5F/src/foo.c:13:9 
(foo+0xf7300) (BuildId: 40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s 
+ 318s   Previous write of size 4 at 0xaaaaac013060 by thread T1:
+ 318s     #0 Thread1 /tmp/autopkgtest.wiwLhx/build.U5F/src/foo.c:8:9 
(foo+0xf72b8) (BuildId: 40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s 
+ 318s   Location is global 'Global' of size 4 at 0xaaaaac013060 (foo+0x1573060)
+ 318s 
+ 318s   Thread T2 (tid=5068, running) created by main thread at:
+ 318s     #0 pthread_create <null> (foo+0x687fc) (BuildId: 
40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s     #1 main /tmp/autopkgtest.wiwLhx/build.U5F/src/foo.c:20:3 
(foo+0xf736c) (BuildId: 40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s 
+ 318s   Thread T1 (tid=5067, finished) created by main thread at:
+ 318s     #0 pthread_create <null> (foo+0x687fc) (BuildId: 
40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s     #1 main /tmp/autopkgtest.wiwLhx/build.U5F/src/foo.c:19:3 
(foo+0xf7350) (BuildId: 40ed278858a29792531afdb407a474f8e0a39c10)
+ 318s 
+ 318s SUMMARY: ThreadSanitizer: data race 
/tmp/autopkgtest.wiwLhx/build.U5F/src/foo.c:13:9 in Thread2
+ 318s ==================
+ 
+ * Seems like the linux kernel version stonking and resolute use maps
+ memory differently than Tsan expects. This causes a fatal error due to
+ unexpected memory mapping. The fix is to gracefully disable ASLR in the
+ case of this failure, and reattempt the test without ASLR, as is already
+ happening behind the scenes.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169041

Title:
  sanitize=address is failing autopkgtests

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-17/+bug/2169041/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to