[ot][spam][crazy][random][crazy]

Undescribed Horrific Abuse, One Victim & Survivor of Many gmkarl at gmail.com
Sat Nov 12 15:53:57 PST 2022


[user@ flat_tree]$ python3 -m pdb test.py
> /shared/src/flat_tree/test.py(3)<module>()
-> from flat_tree import flat_tree#_mix_indices_oo as flat_tree
(Pdb) cont

...

  File "/shared/src/flat_tree/test.py", line 34, in iterate
    assert len(data) == subleafcount
AssertionError
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /shared/src/flat_tree/test.py(34)iterate()
-> assert len(data) == subleafcount
(Pdb) p len(data), subleafcount
(1, 3)
(Pdb) p data
[b'\xc3\x04\xbd\xfc\xe8']

(Pdb) list 20
 15         index.append(id, len(chunk), chunk)
 16
 17     def iterate(index, start_offset, end_offset):
 18         subendoffset = 0
 19         for subleafcount, subid, suboffset, subsize in index:
 20             substartoffset = subendoffset
 21             subendoffset += subsize

(Pdb) p index, start_offset, end_offset, subleafcount, subid, suboffset, subsize
([(9, 9, 0, 45), (3, 12, 45, 10), (3, 15, 55, 10), (1, 16, 65, 7), (1,
17, 72, 4), (-1, b'\x13ZTq\x9e\xf3\x84\xdd', 76, 8)], 45, -6, 3, 12,
45, 10)

let's separate those out


index
[(9, 9, 0, 45), (3, 12, 45, 10), (3, 15, 55, 10), (1, 16, 65, 7), (1,
17, 72, 4), (-1, b'\x13ZTq\x9e\xf3\x84\xdd', 76, 8)]
start_offset
45
end_offset
-6
subleafcount
3
subid
12
suboffset
45
subsize
10

that's weird that end_offset is negative, when accessing an
append_only structure


More information about the cypherpunks mailing list