You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exception ArrayIndexOutOfBoundsException during exporting a dbus object #265
java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 10
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:157)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:264)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:264)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:264)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:264)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.recursiveGetDBusType(Marshalling.java:288)
at org.freedesktop.dbus.Marshalling.getDBusType(Marshalling.java:148)
at org.freedesktop.dbus.Marshalling.getDBusType(Marshalling.java:133)
at org.freedesktop.dbus.messages.ExportedObject.getExportedMethods(ExportedObject.java:186)
at org.freedesktop.dbus.messages.ExportedObject.getExportedMethods(ExportedObject.java:198)
at org.freedesktop.dbus.messages.ExportedObject.<init>(ExportedObject.java:51)
at org.freedesktop.dbus.connections.AbstractConnection.exportObject(AbstractConnection.java:269)
It's because of the problem in org.freedesktop.dbus.Marshalling class (the same code up to the latest version of dbus-java):
...
private static String[] recursiveGetDBusType(StringBuffer[] _out, Type _dataType, boolean _basic, int _level) throws DBusException {
if (_out.length <= _level) {
StringBuffer[] newout = new StringBuffer[_out.length];
System.arraycopy(_out, 0, newout, 0, _out.length);
_out = newout;
}
...
My solution is something like this:
- StringBuffer[] newout = new StringBuffer[_out.length];
+ StringBuffer[] newout = new StringBuffer[_level + 10];
When does this happen? Can you provide a sample to reproduce this?
Changing code with some random numbers may not be the ultimate solution when the cause of the error is unknown.
Activity
hypfvieh commentedon Aug 23, 2024
When does this happen? Can you provide a sample to reproduce this?
Changing code with some random numbers may not be the ultimate solution when the cause of the error is unknown.
dkokorev commentedon Aug 23, 2024
This happens when a dbus struct contains more than 10 levels of nesting.
For simplicity I just used the initial allocation size from here:
Issue #265: Properly increment array size when recursion level is big…
hypfvieh commentedon Aug 23, 2024
Will be fixed in next release.