This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/RFT] Patch (java): Switch to new verifier


Ranjit Mathew wrote:
> 
> In the Mauve verifier testsuite, I see an improvement
> of FAILs from 35 to just 15. I do see an "interesting"
> failure here though (glibc 2.3.4):
> 
> /extra/src/verify/build > $MYGCJ -c locals/fail/toofew.class
> locals/fail/toofew.j: In class 'locals.fail.toofew':
> locals/fail/toofew.j: In method
> 'locals.fail.toofew.doit(java.lang.String[])':
> locals/fail/toofew.j:0: error: verification failed: invalid local variable
> *** glibc detected *** free(): invalid pointer: 0x084d7740 ***
> locals/fail/toofew.j:0: confused by earlier errors, bailing out

Sorry to have omitted this the first time, but this is a SIGABRT
at line 3426 of "gcc/java/verify-impl.c" that calls
vfy_free(isect_list).


> Without the change to build_java_array_length_access, I get
> a FAIL in the "Array_3 -O3 bytecode -> native" test. You can
> see it even now by using -findirect-dispatch with a method
> like:
> 
>   int foo( )
>   {
>     int[] x = (int[] )null;
>     int y = x.length;
>     return 666;
>   }

The actual testcase is:

  public class Foo
  {
    static int bar( )
    {
      int[] x = (int[] )null;
      int y = x.length;
      return 666;
    }

    public static void main( String[] args)
    {
      try
      {
        int n = bar( );
        System.err.println( "ERROR");
      }
      catch( NullPointerException npe) { /* EXPECTED */ }
    }
  }

If I compile this to a class file and then use
"-O3 -findirect-dispatch" (to trigger the new verifier
without this patch), I get to see the bug. If I inline
the code for the method "bar()" in "main()" I don't
see the problem.

Thanks,
Ranjit.

-- 
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]