Bug#1061496: valgrind: Segmentation fault on armhf checking programs built with -fstack-clash-protection or -fstack-check

2024-02-10 Thread Emanuele Rocca
Hi Petter,

On 2024-02-10 06:04, Petter Reinholdtsen wrote:
> This issue cause a failing autopkgtest with libvorbis.  I would much
> prefer a fix in valgrind instead of disabling a autopkgtest check.

As an alternative to disabling the test, you could consider disabling
stack-clash-protection on armhf for libvorbis:

ifeq ($(DEB_TARGET_ARCH),armhf)
  export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-stackclash
else
  export DEB_BUILD_MAINT_OPTIONS = hardening=+all
endif



Bug#1061496: valgrind: Segmentation fault on armhf checking programs built with -fstack-clash-protection or -fstack-check

2024-02-09 Thread Petter Reinholdtsen
Control: affects -1 + libvorbis-dev
Control: block 1061501 by -1

This issue cause a failing autopkgtest with libvorbis.  I would much
prefer a fix in valgrind instead of disabling a autopkgtest check.
-- 
Happy hacking
Petter Reinholdtsen



Bug#1061496: valgrind: Segmentation fault on armhf checking programs built with -fstack-clash-protection or -fstack-check

2024-01-25 Thread Emanuele Rocca
Package: valgrind
Version: 1:3.20.0-2.1
Severity: important
User: debian-...@lists.debian.org
Usertags: 32bit-stackclash
Tags: upstream

On armhf, valgrind dies with a SIGSEGV when checking certain programs
built with either -fstack-clash-protection or -fstack-check.

The following example is a reproducer:

  // example.c
  void a_function() { char buf[8192]; }
  int main() { a_function(); }

The issue can be reproduced with:

  $ gcc -fstack-clash-protection example.c -o example && valgrind ./example
  ==2743356== Memcheck, a memory error detector
  ==2743356== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
  ==2743356== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
  ==2743356== Command: ./example
  ==2743356== 
  ==2743356== 
  ==2743356== Process terminating with default action of signal 11 (SIGSEGV)
  ==2743356==  Access not within mapped region at address 0xFEF0CB04
  ==2743356==at 0x1084EA: a_function (in /tmp/example)
  ==2743356==  If you believe this happened as a result of a stack
  ==2743356==  overflow in your program's main thread (unlikely but
  ==2743356==  possible), you can try to increase the size of the
  ==2743356==  main thread stack using the --main-stacksize= flag.
  ==2743356==  The main thread stack size used in this run was 8388608.
  ==2743356== 
  ==2743356== HEAP SUMMARY:
  ==2743356== in use at exit: 0 bytes in 0 blocks
  ==2743356==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
  ==2743356== 
  ==2743356== All heap blocks were freed -- no leaks are possible
  ==2743356== 
  ==2743356== For lists of detected and suppressed errors, rerun with: -s
  ==2743356== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 3)
  Segmentation fault