Either I'm confused or the gc is

Steven Schveighoffer schveiguy at gmail.com
Thu Oct 22 18:24:57 UTC 2020


On 10/21/20 12:24 PM, donallen wrote:
> The problem is that at some point, the verifier starts spewing bogus 
> error messages about what it is seeing in the tree. Oddly, putting in 
> debugging writelns results in the error messages not occurring -- a 
> Heisenbug.  But working with gdb, I found that the account structs after 
> the error messages start are zeroed. Turning on gc profiling tells me 
> that 3 gcs have occurred. Disabling the gc results in the program 
> running correctly -- no error messages (and I know the database has no 
> errors because the C version, which has been around for awhile, confirms 
> that the db is well formed).
> 
> I could post a PR, but I'm not sure that this is a bug. It could easily 
> be a misunderstanding by me of D and its memory management. So I thought 
> I'd try this post first, hoping that one of you who knows the language 
> better than I do could point out a problem with my code. I do need to 
> resolve this or abandon this project.
> 
> Thanks in advance for any help.

There seems to be nothing wrong in this code that I can see.

But of course, it's out of context, so it's hard to see if there are 
issues elsewhere.

These kinds of corruption bugs are really hard to track down.

What does your Account struct look like?

-Steve


More information about the Digitalmars-d mailing list