>( >( so what's going on here the latest information shows that some non-numeric data is being parsed as a number ... maybe a wrong link pointer is being placed, like maybe a length field is being written as a pointer who knows
the two regions of interest seem separate for me. maybe i can ferry enough information from one to another to discern a cause > > > > > > > > that my linked list allocation file-backed strategy > > > > > > > > > > > > > > > > is __full of bugs densely__ > > > > > > > > > now i like bugs. all my life i loved insects! i was a nerdy > > > > > > > introvert > > > > > on to the software bugs > > > > here is i.py right now, i'm trying to kind of direct my logic turmoil > > to slowly improve it > > > > here is the current backtrace: > > > > File > > "/nix/store/f2krmq3iv5nibcvn4rw7nrnrciqprdkh-python3-3.12.9/lib/python3.12/pdb.py", > > line 1754, in _run > > self.run(target.code) > > File > > "/nix/store/f2krmq3iv5nibcvn4rw7nrnrciqprdkh-python3-3.12.9/lib/python3.12/bdb.py", > > line 627, in run > > exec(cmd, globals, locals) > > File "/home/karl3/projects/rep/rep/array.py", line 138, in <module> > > doc[:] = b'' > > ~~~^^^ > > File "/home/karl3/projects/rep/rep/array.py", line 111, in __setitem__ > > dealloc(old_id) > > File "/home/karl3/projects/rep/rep/i.py", line 36, in dealloc > > self.fsck() > > File "/home/karl3/projects/rep/rep/i.py", line 114, in fsck > > assert l8 <= self.yq - addr8 > > > > somehow it seems after a dealloc that the store became inconsistent. > > > > (Pdb) list > > 31 addr8 = memoryview(id).cast('Q')[0] > > 32 l8 = max((self.q[addr8]+self.idsize-1)//self.idsize,1) + 1 > > 33 self.q[addr8] = self.q[0] > > 34 self.q[addr8+1] = l8 > > 35 self.q[0] = addr8 > > 36 -> self.fsck() > > 37 def alloc(self, data, replacing=[]): > > 38 self.fsck() > > 39 l8 = max((len(data)+self.idsize-1)//self.idsize,1) + 1 > > 40 addr8 = 0 > > 41 assert self.q[addr8] != 0 > > (Pdb) p addr8 > > 1 > > (Pdb) p id > > b'\x01\x00\x00\x00\x00\x00\x00\x00' > > (Pdb) p self.q[addr8] > > 11 > > (Pdb) p l8 > > 4 > > (Pdb) p addr8 > > 1 > > (Pdb) p l8 > > 4 > > (Pdb) p self.w[addr8*self.idsize:addr8+self.idsize+4*self.idsize] > > <memory at 0x7f0a3b9d9840> > > (Pdb) p self.w[addr8*self.idsize:addr8+self.idsize+4*self.idsize].tobytes() > > b'\x0b\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00k > > brown fox jum\x00\t' > > > > the 'k brown fox jum' content looks believable. additionally, the fsck > > prior to the deallocation passed [ :S ] > > (Pdb) down > > /home/karl3/projects/rep/rep/i.py(114)fsck() > -> assert l8 <= self.yq - addr8 > (Pdb) list > 109 passed_regions.append(region) > 110 assert region[1] <= self.yq - addr8 > 111 addr8 += region[1] > 112 else: > 113 l8 = > max((self.q[addr8]+self.idsize-1)//self.idsize,1) + 1 > 114 -> assert l8 <= self.yq - addr8 > 115 addr8 += l8 > 116 assert addr8 == self.yq > 117 def shrink(self): > 118 self.fsck() > 119 unused = 0 > (Pdb) p addr8 > 4 > (Pdb) p self.q[addr8] > 30809871133208422 > (Pdb) p l8 > 3851233891651054 > (Pdb) p regions > [[11, 501], [1, 4]] > (Pdb) p passed_regions > []