Skip to content

ECU_State bug #3901

@polybassa

Description

@polybassa
          Hi @polybassa, sorry for bothering. If you have the time there's a small bug
Traceback (most recent call last):
  File "/opt/hostedtoolcache/PyPy/3.9.16/x64/lib/pypy3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/opt/hostedtoolcache/PyPy/3.9.16/x64/lib/pypy3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "<input>", line 25, in answering_machine_thread
  File "/home/runner/work/scapy/scapy/scapy/ansmachine.py", line 210, in __call__
    self.sniff()
  File "/home/runner/work/scapy/scapy/scapy/ansmachine.py", line 216, in sniff
    sniff(**self.optsniff)
  File "/home/runner/work/scapy/scapy/scapy/sendrecv.py", line 1310, in sniff
    sniffer._run(*args, **kwargs)
  File "/home/runner/work/scapy/scapy/scapy/sendrecv.py", line 1253, in _run
    session.on_packet_received(p)
  File "/home/runner/work/scapy/scapy/scapy/sessions.py", line 109, in on_packet_received
    result = self.prn(pkt)
  File "/home/runner/work/scapy/scapy/scapy/ansmachine.py", line 172, in reply
    reply = self.make_reply(pkt)
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 681, in make_reply
    if not resp.supports_state(self._ecu_state):
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 544, in supports_state
    return any(s == state or state in s for s in self.__states)
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 544, in <genexpr>
    return any(s == state or state in s for s in self.__states)
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 119, in __contains__
    return all(s in self._expand() for s in item._expand())
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 54, in _expand
    *[self._flatten(v) for v in self.__dict__.values()]):
  File "/home/runner/work/scapy/scapy/scapy/contrib/automotive/ecu.py", line 54, in <listcomp>
    *[self._flatten(v) for v in self.__dict__.values()]):
RuntimeError: dictionary changed size during iteration
Transition for edge (session1, session2tp1) failed
Error entering path [session1, session2tp1, security_level2session2tp1]

Originally posted by @gpotter2 in #3869 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions