axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Börkel ...@ap-ag.com>
Subject 1.0 showstopper in org.apache.axis.utils.bytecode.ParamReader.readLocalVariableTable()
Date Tue, 10 Sep 2002 08:51:08 GMT
HI!

If you compile your web service class with -g (full debug info), then ParamReader may get
an ArrayIndexOutOfBoundsException (Axis 1.0 RC1).

Cause: The table length (line 183 in ParamReader.java) is one too big and so ParamReader reads
not only the parameter variables, but also one of the local variables, which has a totally
different index and so the reserved array is too small.

I don't know why the table length is wrong. I have tried to compile with JDK 1.3.1, 1.4.0_01
and 1.4.1-RC: All the same. Either there is a bug in all JDKs or ParamReader makes a wrong
assumption about this table and its connection to the number of parameters.

The problem method source code:
  public static void main(String[] args) throws P2Exception
  {
    Connection conn, conn1, conn2;
    Recordset rs, rs2, rs3, rs4, rs5;
    String sql;
    Date d1, d2;
    Table table;
    int i;

Here the table length is 2, if the class is compiled with -g, otherwise it's 1. And so ParamReader
not only reads args (index = 0), but also table (index = 12), but the array for the parameter
variables has a size of 4 (normally 2, because it's table length multiplied by 2).


I cannot provide a small repro, because it's happening only with one specific source file
at the moment.


Since I don't know anything about the Java class format, I made a workaround by changing line
197 in ParamReader.java:

Old:
            if (names != null) {

New:
            if (names != null && index < len) {


This seems to work, but can only be a crude workaround. Someone has to find the real cause
and make a real fix.

I could provide the problem class, but it only compiles or loads if all our classes and JAR
files are available.

Regards,
Thomas


Mime
View raw message