Skip to content

get_messages() either segfaults or returns an error with timeout=0 #69

@pokemane

Description

@pokemane

First, apologies if this isn't the right repo to bring this up in; I'm trying to use pylessard/python-udsoncan, pylessard/python-can-isotp, and hardbyte/python-can to work with UDS, and python-ics as the actual hardware layer.

python-ics by itself works fine, and adding python-can seems fine too. However, when I went to add python-can-isotp, I started getting segfaults when it was trying to receive messages.

I saw that its CanStack.rx_canbus() function was passing timeout=0 to python-can, which was passing that on to python-ics. That last function (_process_msg_queue()) is where ics.get_messages() is called, and where the timeout of 0 finally gets to python-ics.

What I found was that changing the self.bus.recv(0) to self.bus.recv(0.000001) (or any other tiny nonzero number) fixed this and I no longer get any segfaults or SpyMessages with errors.

The docstring for ics.get_messages() suggests that it's ok with any float, but it's evidently not the case, at least in this situation. Is this a documentation problem or a problem with the function itself?

Again, I'm not sure if it's specifically because I was stacking python-can and python-can-isotp on top, so I apologize if this isn't the right repo. Let me know if I should open this in one of those two repos instead!

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions