Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "PCAN reader1" java.lang.ArrayIndexOutOfBoundsException #4370

Closed
rusefillc opened this issue Jul 22, 2022 · 3 comments
Closed

Comments

@rusefillc
Copy link
Contributor

S2R unclear, a lot of unexpected CAN traffic on the bus

https://rusefi.com/forum/viewtopic.php?p=45893#p45893

Exception in thread "PCAN reader1" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at peak.can.basic.TPCANMsg.setData(TPCANMsg.java:120)
        at peak.can.basic.PCANBasic.Read(Native Method)
        at com.rusefi.io.stream.PCanIoStream.readOnePacket(PCanIoStream.java:101)
        at com.rusefi.io.stream.PCanIoStream.lambda$setInputListener$0(PCanIoStream.java:93)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
@rusefillc
Copy link
Contributor Author

Kirby actually I know what's going on: in order to skip a packet we need to read the packet completely, in order to read the packet completely we need to allocate a buffer

looks like driver does not validate that the buffer we supply (8 bytes) is too small for whatever random weird packet you have (HUH? what kind of packets have more than 8 payload?)

rusefillc pushed a commit that referenced this issue Jul 22, 2022
@rusefillc
Copy link
Contributor Author

Actually more update:

just pushed a questionable work-around

rusefillc pushed a commit that referenced this issue Jul 22, 2022
@rusefillc
Copy link
Contributor Author

closing for now until reported again

rusefillc added a commit that referenced this issue Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant