🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3472

Re: how to prevent prevent .so-calling routine to crash from segfaults in .so

#3472
From: Casper H.S. Dik
Date: Wed, 09 Jul 2003 12:07
31 lines
2471 bytes
sonicshaheen@yahoo.com (Nabeel Shaheen) writes:

>The Scenario is such that I have made a module which call a .so file
>in a new thread and executes it. The .so file has to be provided by
>the end-user and if that .so gives any runtime-error(SEGFAULTS), the
>whole process terminates i.e. all the threads executing .so files and
>more importantly my .so-calling module, which I dont want to be
>terminated.

>so ***IS THERE ANY WAY THAT MY SO-CALLING MODULE DOES NOT TERMINATE
>DUE TO SOME SEGFAULTS IN A .SO FILE WRITTEN BY THE END-USER OF MY
>MODULE?***.

No.  Well, you can prevent it from terminating your program by catching
SIGSEGV and doing a longjump or some such.

But then you're left possibly with:

	- mutex locks held by the crashed thread
	- heap corruption caused by the crashed thread
	- other corruption/inconsitencies caused.

I.e., the best you can do is die and restart.


Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Technical Details
Message-ID: <3f0c056c$0$49107$e4fe514c@news.xs4all.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsgate.cistron.nl!news2.euro.net!transit.news.xs4all.nl!not-for-mail
References: <5a41f079.0307090324.3822c1bb@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,e85a8f2945e25a1
X-Google-Attributes: gid11318c,public
X-Google-Thread: 10c696,e85a8f2945e25a1
X-Google-Attributes: gid10c696,public
X-Google-Thread: fc89c,e85a8f2945e25a1
X-Google-Attributes: gidfc89c,public
X-Google-Thread: f65d0,e85a8f2945e25a1
X-Google-Attributes: gidf65d0,public
X-Google-Thread: 107b38,e85a8f2945e25a1
X-Google-Attributes: gid107b38,public
X-Google-ArrivalTime: 2003-07-09 05:07:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsgate.cistron.nl!news2.euro.net!transit.news.xs4all.nl!not-for-mail
Newsgroups: comp.unix.programmer,gnu.gcc.help,gnu.gcc,comp.os.linux.redhat,comp.os.linux.development.apps
Subject: Re: how to prevent prevent .so-calling routine to crash from segfaults in .so
References: <5a41f079.0307090324.3822c1bb@posting.google.com>
From: Casper H.S. Dik <Casper.Dik@Sun.COM>
Organization: Sun Microsystems, Netherlands
User-Agent: nn/6.6.2
Date: 09 Jul 2003 12:07:20 GMT
Lines: 31
Message-ID: <3f0c056c$0$49107$e4fe514c@news.xs4all.nl>
NNTP-Posting-Date: 09 Jul 2003 14:07:20 CEST
NNTP-Posting-Host: 24.132.47.86
X-Trace: 1057752440 news.xs4all.nl 49107 casper/24.132.47.86:64898
X-Complaints-To: abuse@xs4all.nl