Ask a Question related to UNIX Programming, Design and Development.
-
Nabeel Shaheen #1
how to prevent prevent .so-calling routine to crash from segfaults in .so
Hi,
Guys I am stuck with a problem and need some help.
Platform : Linux(RedHat 7.3)
Problem Area : Dynamic Shared Object Libraries, POSIX Threads
glibc : 2.96
Problem:
=======
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?***.
Any relevant comment will be appreciated.
Best Regards,
Nabeel Shaheen
Sir Syed Research Labs
nabsha[at]UNIssuet.edu.pk (remove capitals)
Nabeel Shaheen Guest
-
Prevent Hotlinking
I am new to Adobe products, so not exactly sure if the Adobe Media Server suits our needs. We are working towards an app that provides streaming mp3... -
Prevent Printing?
Is it possible to prevent an entire page, or a few elements of a page, from being printed? Geoff -
how to prevent add new row to datagrid
I have a datagrid bound to a table in an access database, and would like to have users only add new records through a input form so that I can... -
Prevent Cashing swf
Hi all Anybody knows how to prevent my SWF file to not be cashed by PHP. Any help or idea greatly will be appreciated. Thanks in advanced Behzad... -
How to prevent changes to CheckBoxList
Hello. Can anyone tell me if there is ANY way to prevent the user changing the values in a checkboxlist. I just want to use it for information... -
mru@users.sourceforge.net #2
Re: how to prevent prevent .so-calling routine to crash fromsegfaults in .so
[email]sonicshaheen@yahoo.com[/email] (Nabeel Shaheen) writes:
First, don't yell (fixed). The answer is no. If a module contains> 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?***.
bad code that trashes your stack and/or head, there's nothing you can
do to recover. Depending on your design, it could be possible to run
all modules in separate processes, communicating through sockets,
shared memory, or whatever. Then only the misbehaving process would
be terminated.
--
Måns Rullgård
[email]mru@users.sf.net[/email]
mru@users.sourceforge.net Guest
-
Casper H.S. Dik #3
Re: how to prevent prevent .so-calling routine to crash from segfaults in .so
[email]sonicshaheen@yahoo.com[/email] (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.No. Well, you can prevent it from terminating your program by catching>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?***.
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.
Casper H.S. Dik Guest
-
Neil Horman #4
Re: how to prevent prevent .so-calling routine to crash from segfaultsin .so
Nabeel Shaheen wrote:
How about instead of creating a new thread, you re-architect your> Hi,
>
> Guys I am stuck with a problem and need some help.
>
> Platform : Linux(RedHat 7.3)
> Problem Area : Dynamic Shared Object Libraries, POSIX Threads
> glibc : 2.96
>
> Problem:
> =======
> 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?***.
>
> Any relevant comment will be appreciated.
>
> Best Regards,
>
> Nabeel Shaheen
> Sir Syed Research Labs
> nabsha[at]UNIssuet.edu.pk (remove capitals)
program to fork a child process to interact with the user supplied
shared library? That way, if the .so file causes a segfault, the child
will terminate, but the parent can detect the unclean exit, and inform
the user, without needing to shut the whole program down.
HTH
Neil
Neil Horman Guest



Reply With Quote

