https://bugs.kde.org/show_bug.cgi?id=455711

            Bug ID: 455711
           Summary: Syscall param sigaltstack(ss) points to uninitialised
                    byte(s) when only ss.ss_flags = SS_DISABLE
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: rjo...@redhat.com
  Target Milestone: ---

SUMMARY

The OCaml compiler calls sigaltstack using code similar to this:

#include <stdlib.h>
#include <signal.h>

int
main ()
{
  stack_t ss;
  ss.ss_flags = SS_DISABLE;
  sigaltstack (&ss, NULL);
}

According to the docs this is fine, you don't need to initialize the other
fields in the struct if you are disabling the alternate stack.  However
valgrind complains:

==382696== Syscall param sigaltstack(ss) points to uninitialised byte(s)
==382696==    at 0x48AD42B: sigaltstack (syscall-template.S:120)
==382696==    by 0x401145: main (in /var/tmp/sigaltstack)
==382696==  Address 0x1ffefff930 is on thread 1's stack
==382696==  in frame #1, created by main (???:)

This happens when running any OCaml program under valgrind.  Original bug
report:
https://github.com/ocaml/ocaml/issues/11335
https://github.com/ocaml/ocaml/blob/2c2e99049a5189bb874d215968435cc1e8a375ea/runtime/signals_nat.c#L349

STEPS TO REPRODUCE
1.  Compile the above program and run it under valgrind.

SOFTWARE/OS VERSIONS

Linux: Fedora 37 valgrind-3.19.0-3.fc37.x86_64

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to