maximum recursion depth exceeded while calling a Python object #1079

Closed
opened 2017-11-12 12:00:23 +01:00 by PeterSurda · 5 comments
PeterSurda commented 2017-11-12 12:00:23 +01:00 (Migrated from github.com)

Occasionally, this error is printed:

Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <_ctypes.DictRemover object at 0x7feadbf33030> ignored

(the memory reference changes).

If you run on Windows, it tends to cause a crash. Unfortunately I don't know where this alleged recursion is occurring. I haven't found a way to reproduce it reliably, often it takes hours for this to appear and a whole day can pass without this being triggered.

The most baffling thing is that the code isn't supposed to be recursive. There is one recursive method, decode_payload_content in src/network/bmproto.py, but I minimised the recursivity of this method, and debugging performed does not indicate that this is where the recursion occurs.

Occasionally, this error is printed: `Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <_ctypes.DictRemover object at 0x7feadbf33030> ignored` (the memory reference changes). If you run on Windows, it tends to cause a crash. Unfortunately I don't know where this alleged recursion is occurring. I haven't found a way to reproduce it reliably, often it takes hours for this to appear and a whole day can pass without this being triggered. The most baffling thing is that the code isn't supposed to be recursive. There is one recursive method, `decode_payload_content` in `src/network/bmproto.py`, but I minimised the recursivity of this method, and debugging performed does not indicate that this is where the recursion occurs.
g1itch commented 2017-11-13 23:25:54 +01:00 (Migrated from github.com)

Did you tried to add [chan] bitmessage and then move messages.dat away? When BM receives many messages there is more chance to reproduce it.

FIXME: this warnings are on stderr, also maybe it happen during garbage collection?

Did you tried to add `[chan] bitmessage` and then move messages.dat away? When BM receives many messages there is more chance to reproduce it. FIXME: this warnings are on `stderr`, also maybe it happen during garbage collection?
PeterSurda commented 2017-11-14 09:37:03 +01:00 (Migrated from github.com)

I'll test the reproducibility with enabling/disabling chans.

It is possible that they happen during gc, but I don't have a good way of tracking that. I was able to ascertain that the error does not happen during the singleCleaner cycle though.

I'll test the reproducibility with enabling/disabling chans. It is possible that they happen during gc, but I don't have a good way of tracking that. I was able to ascertain that the error does not happen during the singleCleaner cycle though.
PeterSurda commented 2017-11-21 08:31:01 +01:00 (Migrated from github.com)

I think I was able to narrow it down, but it's difficult to know for sure. I looks like it's either happening in the decryption thread (when the objects are downloaded but no decryption attempted, I can't reproduce it), or the notification caused by the decryption. I actually did fix one similar bug in one of the notification plugins about a week ago.

I think I was able to narrow it down, but it's difficult to know for sure. I looks like it's either happening in the decryption thread (when the objects are downloaded but no decryption attempted, I can't reproduce it), or the notification caused by the decryption. I actually did fix one similar bug in one of the notification plugins about a week ago.
PeterSurda commented 2017-11-22 21:19:41 +01:00 (Migrated from github.com)

Well it may be automatic garbage collection being triggered in an unfortunate moment. 6ca3460 does garbage collection manually in the cleaner thread.

Well it may be automatic garbage collection being triggered in an unfortunate moment. 6ca3460 does garbage collection manually in the cleaner thread.
PeterSurda commented 2017-11-23 21:34:19 +01:00 (Migrated from github.com)

Well, I've been trying hard to reproduce this after the patch but can't anymore, so I'm closing this. Weird, a garbage collector bug. Maybe I should report it to python developers?

Well, I've been trying hard to reproduce this after the patch but can't anymore, so I'm closing this. Weird, a garbage collector bug. Maybe I should report it to python developers?
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-16#1079
No description provided.