Giter VIP home page Giter VIP logo

Comments (5)

hypfvieh avatar hypfvieh commented on July 17, 2024

Hmm... I'm not sure wether it is a race condition or some other kind of bug. Most of the code is still like it was ten years ago. I just added some generics.

Line 683 in Message.java is a type cast from List to Object[], it is in deed an array of Object, so a cast to a primitive array is not possible. I wonder why it is getting to that line. When you use a byte[], data should not be a List instance.

To get the root cause from all of this, can you please post the complete stacktrace?
Sample code would also be great, but the stacktrace will also help a lot.

from dbus-java.

bertrik avatar bertrik commented on July 17, 2024

I mean it might be some kind of race/multithreading problem in my own code.

Line 683 in my Message.java (from release 2.7.4 not the git version) shows the exception:
throw new MarshallingException(t("Primative array being sent as non-primative array."));

I don't have much of a stacktrace. This is what I have (please note this is from release 2.7.4):
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Primative array being sent as non-primative array.
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(RemoteInvocationHandler.java:134)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:234)
at com.sun.proxy.$Proxy13.frameTransmit(Unknown Source)
at nl.technolution.flowmeter.dbus.DbusGdcModule.sendFrame(DbusGdcModule.java:56)

from dbus-java.

hypfvieh avatar hypfvieh commented on July 17, 2024

Race condition in your code is also possible :)

I've made a small test on my system using a DBus server written with dbus-java and a client also with dbus-java, sending around 100000 messages in a row as (primitive) byte array without any kind of DbusException.

Also it does not make sense to me, that it fails in line 683.
For the code it looks like your data object given to the method is of type List.

I can only imagine two possible causes:

  • "data" reference is changed to List by another thread while Message.class is already processing the data (missing synchonize?)
  • you use libraries like fastutil or trove which provide primitive maps and lists which are compatible with List interface but return byte[] if you call 'toArray' (this cannot be casted to Object[])

from dbus-java.

bertrik avatar bertrik commented on July 17, 2024

Are we looking at the same code?

My Message.java line 683 says
throw new MarshallingException(t("Primative array being sent as non-primative array."));

This is from dbus-java-2.7.4.jar

from dbus-java.

hypfvieh avatar hypfvieh commented on July 17, 2024

Sorry I looked in a newer version.

Anyways...
the given data object seems to be an array of a primitive type, but not of any type handled in the switch statement.

I can't help here. You should try to debug this part, so you get an idea which type is used here (check what ArgumentType sigb[i] contains).

from dbus-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.