Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail for :lsp with dmd -O due to a bug in dmd #360

Open
the-horo opened this issue Feb 23, 2024 · 2 comments
Open

Tests fail for :lsp with dmd -O due to a bug in dmd #360

the-horo opened this issue Feb 23, 2024 · 2 comments

Comments

@the-horo
Copy link
Contributor

Reported upstream at: https://issues.dlang.org/show_bug.cgi?id=24406.

$ DFLAGS=-O dub test :lsp --compiler=dmd --build=unittest
     # <snip> #
     Running lsp/serve-d-lsp-test-library
 === Test SOF ===
0 byte -> offset 0
0 byte -> position Position(0, 0)
0 offset -> byte 0
core.exception.AssertError@lsp/source/served/lsp/textdocumentmanager.d(1425): fail SOF offset->byte = 18
----------------
??:? _d_unittest_msg [0x7ff4ef628a24]
lsp/source/served/lsp/textdocumentmanager.d:1426 void served.lsp.textdocumentmanager.__unittest_L1399_C2() [0x563f4c2b155a]
??:? void served.lsp.textdocumentmanager.__modtest() [0x563f4c2d5af1]
??:? int core.runtime.runModuleUnitTests().__foreachbody6(object.ModuleInfo*) [0x7ff4ef62b5aa]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0x7ff4ef60f457]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref rt.sections_elf_shared.DSO) [0x7ff4ef66e77b]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref rt.sections_elf_shared.DSO)) [0x7ff4ef670133]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) [0x7ff4ef66e709]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0x7ff4ef60f429]
??:? runModuleUnitTests [0x7ff4ef62b3df]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll() [0x7ff4ef666758]
??:? void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x7ff4ef6666e5]
??:? _d_run_main2 [0x7ff4ef66664e]
??:? _d_run_main [0x7ff4ef666437]
/usr/lib/dmd/2.107/import/core/internal/entrypoint.d:29 main [0x563f4c204181]
??:? [0x7ff4eef3cee9]
??:? __libc_start_main [0x7ff4eef3cfa4]
??:? _start [0x563f4c203130]
1/3 modules FAILED unittests
Error Program exited with code 1

I though it would be good to report this here in case somebody else hits it.

@WebFreak001
Copy link
Member

thanks for investigating and reporting the issue! The code there is very micro optimized, it may make sense to just make it a bit more readable, but on the other hand it has worked for a while. Maybe serve-d would be a good candidate to add to the D auto-tester

@the-horo
Copy link
Contributor Author

In the end this is a bug in dmd so no need to change the code, it's my view at least. I did just debug some of it and I wouldn't say it that unreadable, though, admittedly, the failing test case is the simple one with all zeros.

gentoo-bot pushed a commit to gentoo/dlang that referenced this issue Mar 2, 2024
More precisely
- remove -O from DMDFLAGS
- remove -mcpu=native from LDCFLAGS

Bug: Pure-D/serve-d#360
Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants