Thursday | 18 APR 2024
[ previous ]
[ next ]

A Bug in ReadList

Title:
Date: 2022-04-23
Tags:  

While working on the benchmarking of BASIC and my node library, I've discovered a bug in the way my readnext and readlists work. This is a stream of consciousness post I'm writing as I debug so it's all over the place.

I have it erroring out on the final item id. Which is doing exactly what I want but I now need to update the library to skip that error as hitting the end of the list is actually a valid case.

After updating the library, I hit another snag. The bug I thought that was tied to IE_LRR error was really because I'm setting the buffer too small so I'm hitting IE_BTS which is then clearing the list it looks like and so I exit the loop that I have that dynamically builds the size of the buffer that contains the list of IDs.

Very weird, as I expected to be able to just repeatedly do readlists until I built a buffer big enough to hold all the ids.

The problem exists for readnext as well, I just haven't hit it. The buffer size I set was big enough so far at 300. I'm guessing that if I have an id longer than that though that the error would clear the list and I would run into the readlist issue.

Readnext is fine because most ids will definitely be less than that but the readlist is going to be a problem as I don't know how many records I'll need to be able to hold and so I need it to grow.

For now I'm going to hard code it to 300 bytes for ids and 100k items in a file.