All of lore.kernel.org
 help / color / mirror / Atom feed
* Different SIGSEGV codes (x86 and ppc64le)
@ 2016-01-19 20:49 Breno Leitao
  2016-01-19 21:10 ` Gustavo Bueno Romero
  2016-01-20  5:34 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Breno Leitao @ 2016-01-19 20:49 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gustavo Bueno Romero

During some debugging, we found that during a stack overflow, the SIGSEGV code
returned is different on Power and Intel.

We were able to narrow down the test case to the follow simple code:

  https://github.com/leitao/stack/blob/master/overflow.c

On Power, the SIGSEV si->si_code is 2 (SEGV_ACCERR) , meaning "access error". On
the other way around, the same test on x86 returns si->si_code = 1 (SEGV_MAPERR),
meaning "invalid permission". Any idea why such difference?

Example:

Power
-----
  $  gcc overflow.c
  $  ./a.out
  Got SIGSEGV(2) at address: 0x3fffdd90ffe0


x86
---
  $ gcc overflow.c
  $ ./a.out
  Got SIGSEGV(1) at address: 0x7fff9f089fe8


Thank you!
Breno

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-20 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 20:49 Different SIGSEGV codes (x86 and ppc64le) Breno Leitao
2016-01-19 21:10 ` Gustavo Bueno Romero
2016-01-20  5:34 ` Michael Ellerman
2016-01-20 18:21   ` Linus Torvalds

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.