Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

please help: signals, exceptions and g++



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Sat, 24 Jan 2004 07:07:53 -0500
"Frank Ramsay" <fjramsay1234 at hotmail.com> wrote:

> I'm trying to write a signal handler that will convert the signal into
> a C++ style exception, but
> I'm having a major problem, it doesn't seem to work.
> 
> Looking at the stack it seems that the fatal error is occuring in
> libstc++:
As Nathan mentioned that he doubts it is possible. 

Here is a URL that might help with handling of signals:
http://www.cs.wustl.edu/~schmidt/signal-patterns.html

Some reasons:
Signal handlers run in a different context than your program complete
with its own stack. Effectively it is a different thread of execution.
There is a restriction on what functions you can safely call from a
signal handler. 

Threads:
Some implementations allow signals to be delivered to a thread,, but
this requires close coordination between the OS, compiler, and thread
library. (Tru64 Unix had this feature as well as an exception library
that worked with C as well as C++). But, I doubt this will ever be
available in Linux. 
 
I would also recommend that you use the sigaction(2) function in
preference to the signal(2) function. Using sigaction() you will not
need to reset the signal. Your handler can also use the siginfo_t
structure. 
- -- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAEp9r+wA+1cUGHqkRAiYDAJkBVg6YqARX/HIKxfLbDdC8DcdFoQCbBzoZ
wbm1tb5Fxq/zB9hCnGDqORg=
=rpx2
-----END PGP SIGNATURE-----




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org