Either I'm confused or the gc is

donallen donaldcallen at gmail.com
Thu Oct 22 19:34:18 UTC 2020


On Thursday, 22 October 2020 at 18:24:57 UTC, Steven 
Schveighoffer wrote:
> 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?

     struct Account
     {
         string name;
         string path;
         string guid;
         string commodity_guid;
         int flags;
     }


>
> -Steve




More information about the Digitalmars-d mailing list