OpenVehicleDiag icon indicating copy to clipboard operation
OpenVehicleDiag copied to clipboard

[BUG] CBF parser throwing exceptions on KI171, KI209 and KI230

Open WSorban opened this issue 1 year ago • 3 comments

CBF parser is encountering problems on several cbf files for several ecus I know there can be multiple versions of one specific cbf file, so I have tried multiple ones, for the same ecu, they all gave similar exceptions, so it should be possible to reproduce these bugs with any of the ecu's cbf files.

KI171 image

KI209 and KI230 image

WSorban avatar Jul 10 '22 10:07 WSorban

KI171 is a simple len check KI209 and KI230 - it depends on how you want to handle cases where there are no request and send ID's. Perhaps default it to 0

WSorban avatar Jul 10 '22 14:07 WSorban

Hi, nice to hear from you again.

Unfortunately, I currently have other projects going on, so I have very little time to devote to fixing these kind of bugs with CBFParser.

The panics tell you the line number and source file where the error occured (Run with RUST_BACKTRACE=1 for a better stack trace), I think both these errors are fairly simple to fix. You are more than welcome to fix them and submit a PR! :)

I suppose you can also try out CaesarSuite to see if that parses them correctly...

rnd-ash avatar Jul 11 '22 12:07 rnd-ash

Hi,

Of course, I know that. I have modified them locally, for my purpose it was fine to 0 those values.

I wrote to bring it to your attention, because the error is thrown as there is an expectation, in your code, for a value that isn't there (no can and no lin id's are found), so you can decide what will work for your purpose.

If 0 is OK for your purpose too, or until you will want to look into it deeper, I can of course submit a PR, so at least the json is correctly generated.

WSorban avatar Jul 11 '22 12:07 WSorban