Thread overview
Tracing out error that causes compiler crash
Sep 03, 2022
solidstate1991
Sep 04, 2022
Nick Treleaven
Sep 04, 2022
solidstate1991
Sep 04, 2022
solidstate1991
Sep 05, 2022
Nick Treleaven
September 03, 2022

During unittest in my own fork of std.experimental.xml (link: https://github.com/ZILtoid1991/experimental.xml ), potentially an error so severe is present, that it causes to crash the compiler (both DMD and LDC2, on Windows). I was able to separate the issue by commenting out all unittests, then re-enabling them one-by-one seeing when it crashes the compiler, but wasn't able to track down the issues. However, domimpl.d is a 2000+ line monster, with a huge templated class that nests multiple other classes. I suspect that there's some leftover from the stripped configurable allocator and/or error handler, that causes the issue.

At worst-case scenario, I can just manually rewrite the whole part (I already planned to write a more linear cursor for speed reasons), but that will consume a lot of my time. A lot of part of the code is already undocumented (especially anything non-public), so it's a question whether reimplementing stuff from almost zero, or trying to decipher a legacy code is the easier stuff.

September 04, 2022

On Saturday, 3 September 2022 at 21:20:01 UTC, solidstate1991 wrote:

>

During unittest in my own fork of std.experimental.xml (link: https://github.com/ZILtoid1991/experimental.xml ), potentially an error so severe is present, that it causes to crash the compiler (both DMD and LDC2, on Windows). I was able to separate the issue by commenting out all unittests, then re-enabling them one-by-one seeing when it crashes the compiler, but wasn't able to track down the issues. However, domimpl.d is a 2000+ line monster, with a huge templated class that nests multiple other classes.

You may be able to use dustmite to automatically reduce the code to a minimal test case:
https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/

Send my regards to the planet smasher.

September 04, 2022

On Sunday, 4 September 2022 at 08:17:13 UTC, Nick Treleaven wrote:

>

You may be able to use dustmite to automatically reduce the code to a minimal test case:
https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/

Send my regards to the planet smasher.

What do I pass as the tester?

September 04, 2022

I tried to compile on the Raspberry Pi 400, now I'm getting segmentation fault during compilation with LDC. Still no idea what causes it, nor how to reduce it. Moved the codebase to a new repository, gave it a proper DOMString implementation instead of using it as a template name, and I'm still getting no luck compiling it. Current link: https://github.com/ZILtoid1991/newxml

I might try to comment out the bodies of the functions and force them to return an initial value, to see if there's something wrong with the insides of the functions.

September 05, 2022

On Sunday, 4 September 2022 at 20:48:52 UTC, solidstate1991 wrote:

>

What do I pass as the tester?

You can use a script as described here:
https://github.com/CyberShadow/DustMite/wiki/Detecting-a-segfault-in-dmd-itself