New bootstrap failure in libjava/gnu/gcj/runtime/natStackTrace.cc

Graham Stott graham.stott@btinternet.com
Wed Dec 4 13:21:00 GMT 2002


Hi Andrew,

Andrew Haley wrote:
> Kaveh R. Ghazi writes:
>  > Andrew,
>  > 
>  > I'm getting this new bootstrap failure building libjava on
>  > sparc-sun-solaris2.7:
> 
> Silly me.  If this fixes your bug, feel free to check it in.
> 
> 2002-12-04  Andrew Haley  <aph@redhat.com>
> 
> 	* gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Declare p
> 	outside #ifdef.
> 
> Index: natStackTrace.cc
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/natStackTrace.cc,v
> retrieving revision 1.1
> diff -p -2 -c -r1.1 natStackTrace.cc
> *** natStackTrace.cc	3 Dec 2002 13:53:27 -0000	1.1
> --- natStackTrace.cc	4 Dec 2002 20:06:40 -0000
> *************** void
> *** 49,57 ****
>   gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
>   {
>   #if defined (HAVE_BACKTRACE)
>     offset += 1;
>     void *_p[maxlen + offset];
>     len = backtrace (_p, maxlen + offset) - offset;
> !   void **p = _p + offset;
>   #endif
>     _Jv_frame_info *frame;
> --- 49,58 ----
>   gnu::gcj::runtime::StackTrace::fillInStackTrace (jint maxlen, jint offset)
>   {
> +   void **p;
>   #if defined (HAVE_BACKTRACE)
>     offset += 1;
>     void *_p[maxlen + offset];
>     len = backtrace (_p, maxlen + offset) - offset;
> !   p = _p + offset;
>   #endif
>     _Jv_frame_info *frame;
> 
> Thanks,
> Andrew.
> 

This doesn't look like it'll work to me because p won't be initialised unless
HAVE_BACKSPACE is defined and we'll end up dereferencing an unitialised pointer
on line 74.

Graham



More information about the Java mailing list