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

            Bug ID: 505302
           Summary: s390x: infinite loop after returning from signal
                    handler
    Classification: Developer tools
           Product: valgrind
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: flo2...@eich-krohm.de
  Target Milestone: ---

Consider this program:

#include <signal.h>
#include <string.h>
#include <setjmp.h>
#include <unistd.h>

#undef  WRITE
#define WRITE(str)  write(STDOUT_FILENO, (str), strlen((str)))

static sigjmp_buf escape;

static void handler(int sig)
{
  WRITE("CALLED\n");
#ifdef JUMP
  siglongjmp(escape, 1);
#endif
}

volatile int v;

int main(void)
{
  struct sigaction sa;

  sigfillset(&sa.sa_mask);
  sa.sa_handler = handler;
  sa.sa_flags = 0;
  sigaction(SIGFPE, &sa, NULL);

#ifdef JUMP
  if (sigsetjmp(escape, 1) == 0)
#endif
    v = 44/v;

  return 0;
}

Division by zero causes SIGFPE signal.
When run natively, there is no difference as to whether the signal handler
returns via siglongjmp or not.
The handler is called once, the program exits.

Under valgrind the program runs into an infinite loop when the handler returns
without siglongjmp. The handler is called again and again.

That's not what I would expect. I would expect the behaviour to be identical.
Or am I missing something?

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

Reply via email to