mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corrado Zoccolo <czoccolo@gmail.com>
To: Sri Ram Vemulpali <sri.ram.gmu06@gmail.com>
Cc: Kernel-newbies <kernelnewbies@nl.linux.org>,
	linux-kernel-mail <linux-kernel@vger.kernel.org>
Subject: Re: Regarding SIGSEGV
Date: Sat, 5 Feb 2011 15:39:51 +0100	[thread overview]
Message-ID: <AANLkTikojfefJUxZ2vRfL2S4h5d+5Do0b1mPh4DPi9Ax@mail.gmail.com> (raw)
In-Reply-To: <AANLkTim7A4q1dF9QAPux-RpatAfOVL3n6ag0MRi-vTGs@mail.gmail.com>

On Wed, Feb 2, 2011 at 8:08 AM, Sri Ram Vemulpali
<sri.ram.gmu06@gmail.com> wrote:
> Hi all,
>
>       I know that when a thread in an application do invalid memory
> reference, OS generates SIGSEGV(segmentation fault) signal and
> terminates application. What if we handle this signal by defining a
> signal handler to perform to terminate only the thread did invalid
> memory reference.
The thread that performed an invalid memory reference might already
have corrupted vital data structures, so the application may not work
and/or produce incorrect results. In such cases is always better to
stop the whole process, to limit damage.
> So, that the application will not be terminated.
> Also, is there any way, we can find when SIGSEGV is generated to get
> the invalid memory reference and thread id, who caused this fault.
man sigaction.
If you use the
 void     (*sa_sigaction)(int, siginfo_t *, void *);
version of handler interceptor, you will get the siginfo_t with all
known information about who generated the signal.

Corrado

> I know debuggers are written in such fashion. Can anyone point me to
> right direction. Thanks in advance.
>
> --
> Regards,
> Sri.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>



-- 
__________________________________________________________________________

dott. Corrado Zoccolo                          mailto:czoccolo@gmail.com
PhD - Department of Computer Science - University of Pisa, Italy
--------------------------------------------------------------------------
The self-confidence of a warrior is not the self-confidence of the average
man. The average man seeks certainty in the eyes of the onlooker and calls
that self-confidence. The warrior seeks impeccability in his own eyes and
calls that humbleness.
                               Tales of Power - C. Castaneda

      reply	other threads:[~2011-02-05 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02  7:08 Sri Ram Vemulpali
2011-02-05 14:39 ` Corrado Zoccolo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikojfefJUxZ2vRfL2S4h5d+5Do0b1mPh4DPi9Ax@mail.gmail.com \
    --to=czoccolo@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sri.ram.gmu06@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®