[Mono-devel-list] CLR programs crash cygwin's bash

Varga Zoltan vargaz at freemail.hu
Wed Jul 2 17:20:54 EDT 2003


                                                  Hi,

  I tracked this down: it turns out that when a .NET program
exits
because of an uncaught exception, cygwin thinks the exit signal
is 79, which gets passed to strsignal() by bash, which
returns NULL,
which leads to a crash inside bash.
I reported this to bug-bash at gnu.org, lets hope the fix finds
its way
into a future version...

The following patch agains bash-2.05b fixes the problem:

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
diff -u bash-orig/jobs.c bash-2.05b/jobs.c
--- bash-orig/jobs.c	2003-07-02 23:14:59.000000000 +0200
+++ bash-2.05b/jobs.c	2003-07-02 23:12:01.000000000 +0200
@@ -1037,6 +1037,9 @@
 	temp = "Unknown status";
     }
 
+  if (temp == NULL)
+	temp = "Unknown status";
+
   return temp;
 }
 
@@ -2768,6 +2771,7 @@
 {
   register int job, termsig;
   char *dir;
+  const char *strsig;
   sigset_t set, oset;
   WAIT s;
 
@@ -2839,7 +2843,9 @@
 		  if (termsig && WIFSIGNALED (s) && termsig != SIGINT &&
termsig != SIGPIPE)
 #endif
 		    {
-		      fprintf (stderr, "%s", strsignal (termsig));
+			  strsig = strsignal (termsig);
+			  if (strsig)
+				fprintf (stderr, "%s", strsig);
 
 		      if (WIFCORED (s))
 			fprintf (stderr, " (core dumped)");
diff -u bash-orig/nojobs.c bash-2.05b/nojobs.c
--- bash-orig/nojobs.c	2003-07-02 23:15:13.000000000 +0200
+++ bash-2.05b/nojobs.c	2003-07-02 23:12:35.000000000 +0200
@@ -696,6 +696,7 @@
 {
   int return_val, pstatus;
   pid_t got_pid;
+  const char *strsig;
   WAIT status;
 
   pstatus = find_status_by_pid (pid);
@@ -771,7 +772,9 @@
 	(WTERMSIG (status) != SIGINT) && (WTERMSIG (status) !=
SIGPIPE))
 #endif
     {
-      fprintf (stderr, "%s", strsignal (WTERMSIG (status)));
+	  strsig = strsignal (WTERMSIG (status));
+	  if (strsig)
+		fprintf (stderr, "%s", strsig);
       if (WIFCORED (status))
 	fprintf (stderr, " (core dumped)");
       fprintf (stderr, "\n");

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


                                  bye

                                          Zoltan




Miguel de Icaza <miguel at ximian.com> írta:

> Hello,
> 
> >   This might be slightly off topic: I'm using cygwin under
> > Win2000, and
> > when a .NET program throws an exception, a window comes up
> > asking
> > if I want to start debugging. If I click no, then the a
> > stack trace is printed
> > to the console, but then bash crashes. Is anybody else
> > seeing this
> > behaviour?
> 
> I experience the same problem with recent versions of
Cygwin [*]
> 
> [*] I do not believe that Cygwin is released in some
"point" version, so
> its really hard to tell when this happened.  I have three
machines
> running Cygwin, and only on the one that was installed
about two months
> ago I see this problem.
> 
> Miguel
> 
> 
> 
> 
> 







More information about the Mono-devel-list mailing list