| Author: anonymous |
Date: 2007-04-03.10:11:24 |
The function "exit()" does not belong to the list of async-signal-safe functions.
See section "2.4.3 Signal Actions" from the document "2.4 Signal Concepts".
http://opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
http://opengroup.org/onlinepubs/009695399/functions/_Exit.html
I imagine that the output to "std::cerr" in a signal handling function may be also unsafe.
Should the corresponding calls be replaced by safe alternatives in your function "sighandler"?
http://synopsis.fresco.org/viewsvn/Synopsis/trunk/src/Support/ErrorHandler.cc?rev=1811&view=auto |
| Author: blindvt |
Date: 2007-05-03.18:12:07 |
Just curious..
So, instead of exit() would you suggest abort()ing?
Which "safe alternative" do you have in mind to use instead?
The I/O subsystem (usually libc) should not be affected by this. |
| Author: elfring |
Date: 2007-05-03.20:47:21 |
Can the function "sighandler" be completely omitted?
Otherwise, consider to call "_Exit()". |
| Author: admin |
Date: 2007-05-03.21:21:35 |
Surely, if we wouldn't need the sighandlers, we would omit them. |
| Author: elfring |
Date: 2007-05-04.04:11:38 |
Are you going to make your logging approach async-signal-safe? |
| Author: blindvt |
Date: 2007-05-04.14:27:17 |
So you just suggests to omit running the __exit_function_table. |
| Author: elfring |
Date: 2007-05-04.15:13:14 |
How do you think about the message by Eric P. McCoy on the topic "threads with signals"?
http://groups.google.de/group/comp.os.linux.development.apps/msg/feb871fc978018f6
The object "std::cerr" must not be used inside a signal handler. |
| Author: blindvt |
Date: 2007-05-04.15:42:51 |
I, personally, think that is perfectly fine to use STDIO in a signal handler.
The worst that could happen is that there are a number of faults, which is fine since we're dead anyways. |
| Author: elfring |
Date: 2007-05-04.16:19:15 |
The following instructions will work.
char const * message[] = "bye bye\n";
write(file, message, sizeof(message)); |
| Author: elfring |
Date: 2007-05-04.16:21:09 |
Better:
char const message[] = "bye bye\n"; |
| Author: blindvt |
Date: 2007-05-04.17:03:49 |
Not sure how your c++ library implements string operator <<
Mine works fine, so perhaps you should rather fix your libc++ impl |
| Author: elfring |
Date: 2007-05-04.18:03:56 |
Are you sure that the implementation of the output operator is async-signal-safe on all supported platforms?
Will it call "new" or "malloc()"? |
|
| Date |
User |
Action |
Args |
| 2007-04-03 10:11:27 | anonymous | create | |
| 2007-04-11 22:42:07 | anonymous | set | nosy:
anonymous, hir, jsrinivasa components:
+ other formatter, - general |
| 2007-05-03 18:12:12 | blindvt | set | nosy:
+ blindvt messages:
+ msg665 |
| 2007-05-03 20:47:25 | elfring | set | nosy:
+ elfring, - anonymous messages:
+ msg668 |
| 2007-05-03 21:21:36 | admin | set | messages:
+ msg669 |
| 2007-05-04 04:11:42 | elfring | set | messages:
+ msg670 |
| 2007-05-04 14:27:25 | blindvt | set | files:
+ synopsis-trunk.bug132-do-not-run-exit-dtors.diff messages:
+ msg671 |
| 2007-05-04 15:13:18 | elfring | set | messages:
+ msg672 |
| 2007-05-04 15:42:57 | blindvt | set | messages:
+ msg673 |
| 2007-05-04 16:19:19 | elfring | set | messages:
+ msg674 |
| 2007-05-04 16:21:13 | elfring | set | messages:
+ msg675 |
| 2007-05-04 17:03:54 | blindvt | set | messages:
+ msg676 |
| 2007-05-04 18:04:00 | elfring | set | messages:
+ msg677 |