After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 496587 - getAttributes on an Accessible causes failures in java-access-bridge
getAttributes on an Accessible causes failures in java-access-bridge
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: javabridge
unspecified
Other All
: Immediate blocker
: ---
Assigned To: Jeff Cai
Jeff Cai
Depends on:
Blocks: orca-java
 
 
Reported: 2007-11-13 22:51 UTC by Willie Walker
Modified: 2007-11-15 08:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that seems to fix the problem (492 bytes, patch)
2007-11-13 22:55 UTC, Willie Walker
none Details | Review

Description Willie Walker 2007-11-13 22:51:05 UTC
When an assistive technology calls getAttributes on an Accessible, it causes failures in the java-access-bridge:

bash-3.2$ java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b07)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
bash-3.2$ uname -a
SunOS solaris-devx 5.11 snv_76 i86pc i386 i86pc Solaris
bash-3.2$ gnome-about --version
GNOME gnome-about 2.20.0
bash-3.2$ java -jar /usr/java/demo/jfc/SwingSet2/SwingSet2.jar
Nov 13, 2007 1:26:51 PM com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl convertThrowableToSystemException
WARNING: "IOP00010202: (UNKNOWN) Unknown user exception thrown by the server"
org.omg.CORBA.UNKNOWN:   vmcid: SUN  minor code: 202 completed: Maybe
    at com.sun.corba.se.impl.logging.ORBUtilSystemException.runtimeexception(ORBUtilSystemException.java:8365)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.convertThrowableToSystemException(CorbaMessageMediatorImpl.java:1918)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1868)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1821)
    at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:258)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1680)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1540)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:922)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:694)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:451)
    at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1189)
    at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:398)
Caused by: java.lang.NullPointerException
    at org.GNOME.Accessibility.AttributeSetHelper.write(AttributeSetHelper.java:92)
    at org.GNOME.Accessibility.AccessiblePOA._invoke(AccessiblePOA.java:330)
    at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:637)
    at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:189)
    ... 8 more
Comment 1 Willie Walker 2007-11-13 22:55:40 UTC
Created attachment 99060 [details] [review]
Patch that seems to fix the problem

In chasing this down, it seems as though the NullPointerException is coming from the following location:

Caused by: java.lang.NullPointerException
    at org.GNOME.Accessibility.AttributeSetHelper.write(AttributeSetHelper.java:92)

This is in a java-access-bridge file generated by idlgen.  The offending line (line 92) seems to be the "ostream.write_long (value.length);" line:

  public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value)
  {
    ostream.write_long (value.length);
    for (int _i0 = 0;_i0 < value.length; ++_i0)
      ostream.write_string (value[_i0]);
  }

With some debugging, I was able to determine the value is indeed NULL.  With more debugging, I think the problem seems to be in impl/org/GNOME/Accessibility/AccessibleImpl.java, which contains a "// TODO: fixme" for the "public String[] getAttributes ()" method.  It returns the null that causes the write method above to croak.

This patch attempts to fix the problem by returning an empty array instead of a null.  Of course, the System.err.println should be removed before checking it in.  :-)
Comment 2 Jeff Cai 2007-11-14 06:31:20 UTC
Thanks, Willie. The patch looks good.
Comment 3 Willie Walker 2007-11-15 01:16:27 UTC
(In reply to comment #2)
> Thanks, Willie. The patch looks good.
> 

Great!  Thanks!  Can you please commit to the relevant branches (e.g., trunk and gnome-2-20 if there is one) and make sure a new release gets made for GNOME 2.20.2 and GNOME 2.21.3?
Comment 4 Jeff Cai 2007-11-15 08:40:49 UTC
committed trunk and 2.20 branch.