[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/wayland/weston][upstream-unstable] 4 commits: CI: work around LeakSanitizer crashes with use_tls=0



Title: GitLab

Dylan Aïssi pushed to branch upstream-unstable at X Strike Force / wayland / weston

Commits:

  • fc041960
    by Pekka Paalanen at 2024-06-05T13:20:15+03:00
    CI: work around LeakSanitizer crashes with use_tls=0
    
    Without this fix, we have randomly been getting CI failures due to
    LeakSanitizer itself crashing after all the tests in a program have
    succeeded. This has been happening randomly for a long time, but
    https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1486
    made it very reliably repeatable in the job x86_64-debian-full-build
    (and no other job) in the test-subsurface-shot program.
    
    --- Fixture 2 (GL) ok: passed 4, skipped 0, failed 0, total 4
    Tracer caught signal 11: addr=0x1b8 pc=0x7f6b3ba640f0 sp=0x7f6b2cc77d10
    ==489==LeakSanitizer has encountered a fatal error.
    
    I was also able to get a core file after twiddling, but there it ended
    up with lsan aborting itself rather than a segfault.
    
    We got some clues that use_tls=0 might work around this, from
    https://github.com/google/sanitizers/issues/1342
    https://github.com/google/sanitizers/issues/1409
    and some other projects that have cargo-culted the same workaround.
    
    Using that cause more false leaks to appear, so they need to be
    suppressed. I suppose we are not interested in catching leaks in glib
    using code, so I opted to suppress g_malloc0 altogether. Pinpointing it
    better might have required much more slower stack tracing.
    
    wl_shm_buffer_begin_access() uses TLS, so no wonder it gets flagged.
    
    ld-*.so is simply uninteresting to us, and it got flagged too.
    
    Since this might have been fixed already in LeakSanitizer upstream, who
    knows, leave some notes to revisit this when we upgrade that in CI.
    
    This fix seems to make the branch of
    https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1486
    in my quick testing.
    
    Suggested-by: Derek Foreman <derek.foreman@collabora.com>
    Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
    (cherry picked from commit 3179e0f0e0c9a68879818d8196f7852d10923e2c)
    
  • 86c636d8
    by Marius Vlad at 2024-06-05T13:20:15+03:00
    build: bump to version 13.0.2 for the point release
    
    Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
    
  • 8cb33a19
    by Marius Vlad at 2024-06-05T14:59:31+03:00
    build: bump to version 13.0.3 for the point release
    
    Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
    
  • 6d06b3d6
    by Dylan Aïssi at 2024-06-05T17:17:41+02:00
    Merge tag '13.0.3' into upstream-unstable
    
    13.0.3
    

4 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -82,6 +82,7 @@ stages:
    82 82
       variables:
    
    83 83
         BUILD_OS: debian
    
    84 84
         LLVM_VERSION: 15
    
    85
    +    # If you upgrade from bookworm, see the use_tls=0 notes in tests/meson.build.
    
    85 86
         FDO_DISTRIBUTION_VERSION: bookworm
    
    86 87
         FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} BUILD_ARCH=${BUILD_ARCH} KERNEL_IMAGE=${KERNEL_IMAGE} KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG} LLVM_VERSION=${LLVM_VERSION} FDO_DISTRIBUTION_VERSION=${FDO_DISTRIBUTION_VERSION} bash .gitlab-ci/debian-install.sh'
    
    87 88
     
    

  • .gitlab-ci/leak-sanitizer.supp
    ... ... @@ -4,3 +4,9 @@
    4 4
     # fontconfig library because turning off fast unwind -- required to catch other
    
    5 5
     # originating leaks from fontconfig; would stall our tests timing them out.
    
    6 6
     leak:libfontconfig
    
    7
    +
    
    8
    +# Workarounds for the LeakSanitizer use_tls=0 workaround,
    
    9
    +# see tests/meson.build
    
    10
    +leak:wl_shm_buffer_begin_access
    
    11
    +leak:g_malloc0
    
    12
    +leak:/ld-*.so*

  • meson.build
    1 1
     project('weston',
    
    2 2
     	'c',
    
    3
    -	version: '13.0.1',
    
    3
    +	version: '13.0.3',
    
    4 4
     	default_options: [
    
    5 5
     		'warning_level=3',
    
    6 6
     		'c_std=gnu99',
    

  • tests/meson.build
    ... ... @@ -420,9 +420,14 @@ configure_file(output: 'test-config.h', configuration: test_config_h)
    420 420
     
    
    421 421
     test_env = {}
    
    422 422
     
    
    423
    -# there are some leaks in fontconfig we can't fix; 
    
    423
    +# there are some leaks in fontconfig we can't fix;
    
    424
    +# use_tls=0 is a workaround for LeakSanitizer crashing after successful
    
    425
    +# program exit when it scans for leaks. Due to use_tls=0 even more
    
    426
    +# suppressions had to be added.
    
    427
    +# TODO XXX: Try to revert the addition of use_tls=0 when our CI image
    
    428
    +# upgrades from Debian Bookworm to something more recent.
    
    424 429
     if get_option('b_sanitize') in ['address', 'address,undefined' ]
    
    425
    -  test_env += { 'LSAN_OPTIONS': 'suppressions=@0@'.format(dir_gitlab_ci / 'leak-sanitizer.supp') }
    
    430
    +  test_env += { 'LSAN_OPTIONS': 'use_tls=0:suppressions=@0@'.format(dir_gitlab_ci / 'leak-sanitizer.supp') }
    
    426 431
     endif
    
    427 432
     
    
    428 433
     foreach t : tests
    


  • Reply to: