Handle source looped recursion #16

Open
opened 2020-01-07 14:32:45 +01:00 by geoffrey · 0 comments
Owner

Got a case where two records's sources pointed to each other:

62.161.94.223/32 5FD1 <-> mail.xiti.us 6F_1

They probably should be pruned or not allowed to exist.

This manifests when running export.py --explain (lines numbers are off due to debugging):

Traceback (most recent call last):
  File "./export.py", line 56, in <module>
    for domain in DB.list_records(
  File "/path/to/eulaurarien/database.py", line 599, in list_records
    yield from self.exec_each(export_cb)
  File "/path/to/eulaurarien/database.py", line 488, in exec_each
    yield from self.exec_each_domain(callback)
  File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain
    yield from self.exec_each_domain(
  File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain
    yield from self.exec_each_domain(
  File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain
    yield from self.exec_each_domain(
  File "/path/to/eulaurarien/database.py", line 425, in exec_each_domain
    yield from c
  File "/path/to/eulaurarien/database.py", line 595, in export_cb
    yield self.explain(path)
  File "/path/to/eulaurarien/database.py", line 568, in explain
    string += f' ← {self.explain(match.source)}'
  File "/path/to/eulaurarien/database.py", line 568, in explain
    string += f' ← {self.explain(match.source)}'
  File "/path/to/eulaurarien/database.py", line 568, in explain
    string += f' ← {self.explain(match.source)}'
  [Previous line repeated 982 more times]
  File "/path/to/eulaurarien/database.py", line 560, in explain
    string = str(path)
  File "/path/to/eulaurarien/database.py", line 79, in __str__
    return Database.unpack_ip4network(self)
  File "/path/to/eulaurarien/database.py", line 366, in unpack_ip4network
    return '.'.join(map(str, octets)) + '/' + str(network.prefixlen)
RecursionError: maximum recursion depth exceeded while getting the str of an object

Might be fixed with #14 , might be not needed depending on #15.

Got a case where two records's sources pointed to each other: `62.161.94.223/32 5FD1` <-> `mail.xiti.us 6F_1` They probably should be pruned or not allowed to exist. This manifests when running `export.py --explain` (lines numbers are off due to debugging): ``` Traceback (most recent call last): File "./export.py", line 56, in <module> for domain in DB.list_records( File "/path/to/eulaurarien/database.py", line 599, in list_records yield from self.exec_each(export_cb) File "/path/to/eulaurarien/database.py", line 488, in exec_each yield from self.exec_each_domain(callback) File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain yield from self.exec_each_domain( File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain yield from self.exec_each_domain( File "/path/to/eulaurarien/database.py", line 439, in exec_each_domain yield from self.exec_each_domain( File "/path/to/eulaurarien/database.py", line 425, in exec_each_domain yield from c File "/path/to/eulaurarien/database.py", line 595, in export_cb yield self.explain(path) File "/path/to/eulaurarien/database.py", line 568, in explain string += f' ← {self.explain(match.source)}' File "/path/to/eulaurarien/database.py", line 568, in explain string += f' ← {self.explain(match.source)}' File "/path/to/eulaurarien/database.py", line 568, in explain string += f' ← {self.explain(match.source)}' [Previous line repeated 982 more times] File "/path/to/eulaurarien/database.py", line 560, in explain string = str(path) File "/path/to/eulaurarien/database.py", line 79, in __str__ return Database.unpack_ip4network(self) File "/path/to/eulaurarien/database.py", line 366, in unpack_ip4network return '.'.join(map(str, octets)) + '/' + str(network.prefixlen) RecursionError: maximum recursion depth exceeded while getting the str of an object ``` Might be fixed with #14 , might be not needed depending on #15.
geoffrey added the
bug
label 2020-01-07 14:32:45 +01:00
geoffrey added a new dependency 2020-01-07 14:33:31 +01:00
geoffrey added a new dependency 2020-01-07 14:33:38 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: geoffrey/eulaurarien#16
No description provided.