* [uml-devel] [PATCH 6/7] UML - Fix segfault on exit with CONFIG_GCOV
@ 2005-05-26 22:30 Jeff Dike
0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-05-26 22:30 UTC (permalink / raw)
To: akpm, torvalds; +Cc: linux-kernel, user-mode-linux-devel
We need to disable signals on exit in all cases, not just when rebooting.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.11/arch/um/kernel/main.c
===================================================================
--- linux-2.6.11.orig/arch/um/kernel/main.c 2005-05-26 17:16:46.000000000 -0400
+++ linux-2.6.11/arch/um/kernel/main.c 2005-05-26 17:29:27.000000000 -0400
@@ -87,7 +87,7 @@ int main(int argc, char **argv, char **e
{
char **new_argv;
sigset_t mask;
- int ret, i;
+ int ret, i, err;
/* Enable all signals except SIGIO - in some environments, we can
* enter with some signals blocked
@@ -160,27 +160,29 @@ int main(int argc, char **argv, char **e
*/
change_sig(SIGPROF, 0);
+ /* This signal stuff used to be in the reboot case. However,
+ * sometimes a SIGVTALRM can come in when we're halting (reproducably
+ * when writing out gcov information, presumably because that takes
+ * some time) and cause a segfault.
+ */
+
+ /* stop timers and set SIG*ALRM to be ignored */
+ disable_timer();
+
+ /* disable SIGIO for the fds and set SIGIO to be ignored */
+ err = deactivate_all_fds();
+ if(err)
+ printf("deactivate_all_fds failed, errno = %d\n", -err);
+
+ /* Let any pending signals fire now. This ensures
+ * that they won't be delivered after the exec, when
+ * they are definitely not expected.
+ */
+ unblock_signals();
+
/* Reboot */
if(ret){
- int err;
-
printf("\n");
-
- /* stop timers and set SIG*ALRM to be ignored */
- disable_timer();
-
- /* disable SIGIO for the fds and set SIGIO to be ignored */
- err = deactivate_all_fds();
- if(err)
- printf("deactivate_all_fds failed, errno = %d\n",
- -err);
-
- /* Let any pending signals fire now. This ensures
- * that they won't be delivered after the exec, when
- * they are definitely not expected.
- */
- unblock_signals();
-
execvp(new_argv[0], new_argv);
perror("Failed to exec kernel");
ret = 1;
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-26 22:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-26 22:30 [uml-devel] [PATCH 6/7] UML - Fix segfault on exit with CONFIG_GCOV Jeff Dike
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox