* Re: 2.2.x kernels not filling in siginfo_t.si_addr on SEGV?
@ 2001-03-09 0:26 David Watson
2001-03-09 3:28 ` Camm Maguire
0 siblings, 1 reply; 4+ messages in thread
From: David Watson @ 2001-03-09 0:26 UTC (permalink / raw)
To: camm; +Cc: linux-kernel, brett, dwatson
> Greetings! Shouldn't a SIGSEGV fill in th si_addr member of the
> siginfo_t structure passed to a signal handler? Here is what I see
Our group ran into this problem last summer while we were developing the
Oasis+ DSM system. We worked around it by utilizing the following code
fragment:
void fault_handler(int sig, siginfo_t *sip, ucontext_t *ucp)
{
void *addr;
addr = (void *) ucp->uc_mcontext.cr2;
...
}
Hope that helps.
Regards,
David
--
The theory of groups is a branch of Mathematics in which one does
something to something and then compares the result with the result
obtained from doing the same thing to something else, or something else to
the same thing.
J. R. Newman
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: 2.2.x kernels not filling in siginfo_t.si_addr on SEGV?
2001-03-09 0:26 2.2.x kernels not filling in siginfo_t.si_addr on SEGV? David Watson
@ 2001-03-09 3:28 ` Camm Maguire
[not found] ` <20010309083035.A27596@flint.arm.linux.org.uk>
0 siblings, 1 reply; 4+ messages in thread
From: Camm Maguire @ 2001-03-09 3:28 UTC (permalink / raw)
To: David Watson; +Cc: linux-kernel, brett
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]
Greetings, and thank you so much for your helpful reply! Was this on
an i386? I'm specifically looking for a way to do his on arm, alpha,
and sparc, and I don't believe they have the cr2 member of struct
sigcontext. Any info you might have, including where you found this
solution, would be appreciated!
Take care,
David Watson <dwatson@cs.ucr.edu> writes:
> > Greetings! Shouldn't a SIGSEGV fill in th si_addr member of the
> > siginfo_t structure passed to a signal handler? Here is what I see
>
> Our group ran into this problem last summer while we were developing the
> Oasis+ DSM system. We worked around it by utilizing the following code
> fragment:
>
> void fault_handler(int sig, siginfo_t *sip, ucontext_t *ucp)
> {
> void *addr;
>
> addr = (void *) ucp->uc_mcontext.cr2;
>
> ...
> }
>
> Hope that helps.
>
> Regards,
> David
>
> --
> The theory of groups is a branch of Mathematics in which one does
> something to something and then compares the result with the result
> obtained from doing the same thing to something else, or something else to
> the same thing.
> J. R. Newman
>
>
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
^ permalink raw reply [flat|nested] 4+ messages in thread
* 2.2.x kernels not filling in siginfo_t.si_addr on SEGV?
@ 2001-03-08 22:27 Camm Maguire
0 siblings, 0 replies; 4+ messages in thread
From: Camm Maguire @ 2001-03-08 22:27 UTC (permalink / raw)
To: linux-kernel
Greetings! Shouldn't a SIGSEGV fill in th si_addr member of the
siginfo_t structure passed to a signal handler? Here is what I see
(on several archs):
=============================================================================
q.c
=============================================================================
#include <stdio.h>
#include <signal.h>
void
nh(int s,siginfo_t *si,void *sc) {
printf("%p\n",si->si_addr);
exit(0);
}
int
main() {
struct sigaction sa;
char c[3];
memset(&sa,0,sizeof(sa));
sa.sa_sigaction=nh;
sa.sa_flags=SA_RESTART|SA_SIGINFO;
sigaction(SIGSEGV,&sa,0);
c[4096]=0;
/* raise(SIGSEGV); */
return 0;
}
=============================================================================
camm@kullervo:~$ cc -g q.c -o q
cc -g q.c -o q
camm@kullervo:~$ ./q
./q
(nil)
=============================================================================
Take care,
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-03-09 22:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-09 0:26 2.2.x kernels not filling in siginfo_t.si_addr on SEGV? David Watson
2001-03-09 3:28 ` Camm Maguire
[not found] ` <20010309083035.A27596@flint.arm.linux.org.uk>
2001-03-09 22:29 ` Camm Maguire
-- strict thread matches above, loose matches on Subject: below --
2001-03-08 22:27 Camm Maguire
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox