Segmentation fault in DMD - how to debug?

max haughton maxhaton at gmail.com
Thu Sep 29 00:48:37 UTC 2022


On Thursday, 29 September 2022 at 00:07:41 UTC, Paul Backus wrote:
> On Wednesday, 28 September 2022 at 23:15:42 UTC, Andrey 
> Zherikov wrote:
>> On Wednesday, 28 September 2022 at 23:07:34 UTC, Nicholas 
>> Wilson wrote:
>>> This seems to stem from use of `__traits(getPointerBitmap, 
>>> T)`, with a `T` that is not handled properly. If you can get 
>>> a reduced test case that will make things much easier. 
>>> `dustmite` (which should come with `dmd`, is useful for 
>>> automatic reduction, otherwise if you have few uses of 
>>> `__traits(getPointerBitmap, T)`, it might be easier to 
>>> synthesise an example that crashes the compiler.
>>
>> I don't use `getPointerBitmap` in my code:
>> ```
>> $ grep -r --include=*.d getPointerBitmap
>> $
>> ```
>
> It's used in druntime, by `RTInfo`:
>
> https://github.com/dlang/druntime/blob/v2.100.2/src/object.d#L3695-L3702

getPointerBitmap needs to be completely rewritten.

Currently it uses the visitor pattern and doesn't cache anything 
so a N element static array gets walked N times which is very 
very very slow even ignoring that each one has the same result.


More information about the Digitalmars-d mailing list