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
DCD crashes on startup in std.experimental.logger #1358
Comments
This may related to #1377. |
@Hackerpilot Is it fixed by this? --- a/gen/typinf.cpp
+++ b/gen/typinf.cpp
@@ -726,8 +726,11 @@ void TypeInfoDeclaration_codegen(TypeInfoDeclaration *decl, IRState *p) {
} else {
irg->type = LLStructType::create(gIR->context(), decl->toPrettyChars());
}
- LLGlobalVariable *g = new LLGlobalVariable(gIR->module, irg->type, true,
- lwc.first, nullptr, mangled);
+ // Create the symbol. We need to keep it mutable as the type is not declared
+ // as immutable on the D side, plus synchronized() can be used on the
+ // implicit monitor.
+ auto g = new LLGlobalVariable(gIR->module, irg->type, false, lwc.first,
+ nullptr, mangled);
setLinkage(lwc, g);
irg->value = g;
} Thanks for testing! |
It is. With that patch DCD passes its test suite. |
@Hackerpilot Thanks for the fix confirmation. |
I made a fresh clone of LDC master (fa8fe51), and tried this again and it's failing in the same place. I checked that CPP file and see that the fix is there, but the crash is back. Any ideas? |
@Hackerpilot What happens when you apply the patch of this PR? #1384 |
That patch is against the ltsmaster branch, so I'll have to translate it to D first. |
@Hackerpilot Sorry didn't notice, working on new PR here: #1385 |
For some reason that didn't break the build. The line of ASM causing the segfault is mov rax,QWORD PTR [rax] gdb tells me that the rax register's value at this point is 0. Stack trace:
|
Could you dustmite it? |
I'm working on figuring out how to write the test script to catch that specific segfault. Edit: https://github.com/CyberShadow/DustMite/wiki/Detecting-a-specific-segfault |
I'm no longer able to reproduce this issue with LDC at version 98c899b |
Yep, we should be emitting TypeInfo as mutable for now. |
Seems to happen again on LDC 1.3.0:
|
@yotamr How about LDC 1.4.0 ? |
Just tested against LDC 1.4.0. Still crashes.
…On 16 September 2017 at 04:06, Johan Engelen ***@***.***> wrote:
@yotamr <https://github.com/yotamr> How about LDC 1.4.0 ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1358 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmBdZAexN6cJf7dffVAx0-L4nH6lFW4ks5si6u6gaJpZM4HzfRo>
.
|
My code is a shared library loaded by an already-existing process. There are three threads running D code: one belonging to the process that loaded the .so, and two other threads handling HTTP communication. I tried reproducing it in two ways, both did not reproduce the crash:
|
Could you please open a new issue for the crash you are seeing, including more detailed system information (OS/compiler/linker versions, processor, etc.) and a way to reproduce it? What you are describing is a different problem than reported here, which was caused by |
Sure, thanks.
…On 16 September 2017 at 18:07, David Nadlinger ***@***.***> wrote:
Could you please open a new issue for the crash you are seeing, including
more detailed system information (OS/compiler/linker versions, processor,
etc.) and a way to reproduce it?
What you are describing is a different problem than reported here, which
was caused by TypeInfos being emitted as constant data.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1358 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAmBdfUZ2uPQ05YdMSY21T3Z4XvreU9sks5sjHDogaJpZM4HzfRo>
.
|
Thanks! |
Using LDC built from commit 6e0bada
Stack trace:
The text was updated successfully, but these errors were encountered: