Closed kimstik closed 10 years ago
Can you please send me a capture file where this error occurs? (address in the readme)
Thank you! What happened is quite fascinating, it seems you were trying to read values past the end of the packet, which triggered an internal exception in wireshark that somehow didn't return control to the python function, which means python thought the next packet's python function was called by the current python function and so on, until the stack reached its limit!
The solution is quite simple, check len(packet.buffer) versus packet.offset before reading items if you're not sure they exist.
My current philosophy is putting as little checks as possible in the python code, to reduce the performance toll as much as possible. It does have the drawback of having ambiguous errors with little or no relation to the actual problems.
I don't think I will add detection of user errors during dissection.
Pyreshark 0.1.3 / Win32 On a simple code
I've got errors on long files: Traceback (most recent call last): File "_ctypes/callbacks.c", line 314, in 'calling callback function' File "C:\Program Files\Wireshark\python\cal\cal_types.py", line 499, in _callback p = Packet(p_tvb_and_tree.contents.tvb, p_tvb_and_tree.contents.tree, p_pinfo, p_offset, self._cal, self._items_dict) RuntimeError: maximum recursion depth exceeded while calling a Python object Traceback (most recent call last): File "_ctypes/callbacks.c", line 314, in 'calling callback function' ......