mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudarshan Soma <sudarshan12s@gmail.com>
To: Sudarshan Soma <sudarshan12s@gmail.com>,
	Robert Hancock <hancockrwd@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: linux-kernel@vger.kernel.org
Date: Mon, 18 May 2009 12:36:32 +0530	[thread overview]
Message-ID: <de72ca4e0905180006m6c4456c3h96750fe39e7f8379@mail.gmail.com> (raw)
In-Reply-To: <de72ca4e0905172314q3c55ec52ic9ab762a0352a91d@mail.gmail.com>

It looks like i can't call exit(-1)in signal handlers as its
Asynchronous—signal-safe function. As my application wont register any
exit handler functions, is this safe to use??

Please suggest if there are better alternatives.

On Mon, May 18, 2009 at 11:44 AM, Sudarshan Soma <sudarshan12s@gmail.com> wrote:
> --- On Sat, 16/5/09, Robert Hancock <hancockrwd@gmail.com> wrote:
>
>
>    From: Robert Hancock <hancockrwd@gmail.com>
>    Subject: Re: patch related to SIGSEGV handling in multiple threads
> and hung threads
>    To: "Sudarshan Soma" <sudarshan12s@gmail.com>
>    Cc: linux-kernel@vger.kernel.org
>    Date: Saturday, 16 May, 2009, 6:45 AM
>
>    Sudarshan Soma wrote:
>    > Hi ,
>    > I have a program which will create multiple threads. One of the thread
>    > receives SIGSEGV and it prints stacktrace in its handler and calls
>    > _exit(-1). The call to exit wont terminate all threads in  a process
>    > and hence thread hangs here. This causes resouce leaks and other
>    > problems. It is seen only on linux 2.4.20.
>    >
>    > For printing stacktrace it uses
>    > __builtin_return_address and __builtin_frame_address
>    >
>    >
>    > The same program works fine on linux 2.6.26 kernel. It  will exit the
>    > whole process when one of its thread dies as above.
>    >
>    >
>    > Please let me know the patch details or any workaround, if any. This
>    > is a bit urgent, so please let me know for any pointers , if any
>    >
>    > Thanks and Best Regards,
>    > Pavan.
>
> [Robert]
>    That doesn't seem surprising, the old LinuxThreads thread
> implementation normally used with the 2.4 kernels was pretty poor.
> However it would likely be better to re-raise the signal rather than
> trying to exit out of the signal handler.
>
>
> [Pavan]
> Thanks Robert.
> using exit(-1) instead of exit(0) does terminate all the threads in
> the process in my sample program.  Please suggest if this workaround
> is safe for now.
>
> I would like to kill whole process(and its threads) when one of the
> thread gets SIGSEGV signal. Could you please eloborate , how could i
> achieve the same by raising SIGSEGV signal again..
>
> Best Regards,
> Pavan.
>

       reply	other threads:[~2009-05-18  7:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <de72ca4e0905172314q3c55ec52ic9ab762a0352a91d@mail.gmail.com>
2009-05-18  7:06 ` Sudarshan Soma [this message]
2026-08-31  5:14 linux-kernel@vger.kernel.org kanchansinghu74
  -- strict thread matches above, loose matches on Subject: below --
2026-08-25  5:45 linux-kernel@vger.kernel.org solvebytez
2022-10-14  8:51 linux-kernel@vger.kernel.org Mustafa Ayvaz
2011-01-24 16:43 linux-kernel@vger.kernel.org sen wang
2010-05-29 11:22 linux-kernel@vger.kernel.org uwaysi.bin.kareem
2009-10-11  6:22 linux-kernel@vger.kernel.org Boyan
2008-03-09 17:02 linux-kernel@vger.kernel.org bruno.roussel
2007-08-14  9:58 linux-kernel@vger.kernel.org bizu
2007-08-14  9:58 linux-kernel@vger.kernel.org bizu
2005-07-05 13:58 Linux-kernel@vger.kernel.org linux-kernel
2004-07-26 15:44 linux-kernel@vger.kernel.org rap
2004-07-26 14:48 LINUX-KERNEL@VGER.KERNEL.ORG Returned mail
2004-06-21  9:19 linux-kernel@vger.kernel.org Romia Fersi
2003-06-18 21:46 linux-kernel@vger.kernel.org David Mosberger
2002-10-30 17:57 linux-kernel@vger.kernel.org Manfred Spraul
2002-10-30 21:22 ` linux-kernel@vger.kernel.org Bill Davidsen
2002-09-30  1:13 linux-kernel@vger.kernel.org omit_ECE
2002-09-30  1:18 ` linux-kernel@vger.kernel.org David S. Miller
2002-09-30  1:39 ` linux-kernel@vger.kernel.org Jeff Chua
2002-01-31  1:02 linux-kernel@vger.kernel.org Ulrich Weigand
2002-01-31  1:11 ` linux-kernel@vger.kernel.org Andrew Morton
2001-05-25 12:42 linux-kernel@vger.kernel.org Julien Laganier

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=de72ca4e0905180006m6c4456c3h96750fe39e7f8379@mail.gmail.com \
    --to=sudarshan12s@gmail.com \
    --cc=hancockrwd@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®