public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1400: gij doesn't show (uncaught) exceptions
@ 2000-12-20 12:26 mark
  0 siblings, 0 replies; only message in thread
From: mark @ 2000-12-20 12:26 UTC (permalink / raw)
  To: java-gnats

>Number:         1400
>Category:       libgcj
>Synopsis:       gij doesn't show (uncaught) exceptions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tromey
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:38 PST 2000
>Closed-Date:    Wed Nov 22 21:47:35 PST 2000
>Last-Modified:  Wed Nov 22 21:50:00 PST 2000
>Originator:     Mark Wielaard
>Release:        gij (GNU libgcj) version 0.0.7
>Organization:
>Environment:

>Description:
When a program throws an (uncaught) exception an executable
made with gcj does show an stack trace. But running the same
program as a class file under gij does not show anything
that went wrong.
>How-To-Repeat:
Compile the following with gcj -C and the run it with gij

public class test {
    int i = 42;
    public static void main(String[] args) {
        test p = null;
        System.out.println(p.i);
    }   
}
>Fix:
The following makes sure that there is at least a stack trace shown
(although it does not contain the java source file and line number.)
_Jv_argv is null when running gij.

diff -u -u -r1.5 name-finder.cc
--- name-finder.cc	2000/10/09 01:54:50	1.5
+++ name-finder.cc	2000/11/12 12:34:39
@@ -149,7 +149,7 @@
 	strncpy (method_name, dl_info.dli_sname, sizeof method_name);
        
        /* Don't trust dladdr() if the address is from the main program. */
-       if (strcmp (file_name, _Jv_argv[0]) != 0)
+       if (_Jv_argv == NULL || strcmp (file_name, _Jv_argv[0]) != 0)
          return true;
       }
   }
>Release-Note:

>Audit-Trail:

Formerly PR libgcj/370


From: Bryce McKinlay <bryce@albatross.co.nz>
To: mark@klomp.org
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: libgcj/370: gij doesn't show (uncaught) exceptions
Date: Mon, 13 Nov 2000 10:49:50 +1300

 mark@klomp.org wrote:
 
 > When a program throws an (uncaught) exception an executable
 > made with gcj does show an stack trace. But running the same
 > program as a class file under gij does not show anything
 > that went wrong.
 
 Thanks Mark,
 
 I think the proper fix here is to:
 
 1. Set _Jv_argv from the gij startup code (I must have neglected to do this
 when I fixed the stack traces for RH7)
 2. make sure something is always printed even if the stack trace fails
 
 I'll try to look into it soon.
 
 regards
 
   [ bryce ]
 
 
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Wed Nov 22 21:47:35 2000
State-Changed-Why:
    I checked in Mark's fix.

From: bryce@albatross.co.nz
To: java-gnats@sourceware.cygnus.com, mark@klomp.org, tromey@cygnus.com
Cc:  
Subject: Re: libgcj/370
Date: 23 Nov 2000 05:47:35 -0000

 Synopsis: gij doesn't show (uncaught) exceptions
 
 State-Changed-From-To: open->closed
 State-Changed-By: bryce
 State-Changed-When: Wed Nov 22 21:47:35 2000
 State-Changed-Why:
     I checked in Mark's fix.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=370&database=java
>Unformatted:
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:26 libgcj/1400: gij doesn't show (uncaught) exceptions mark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).