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

Crash via "Assertion `decl->ir->irGlobal != NULL' failed" #2357

Closed
ximion opened this issue Oct 4, 2017 · 5 comments
Closed

Crash via "Assertion `decl->ir->irGlobal != NULL' failed" #2357

ximion opened this issue Oct 4, 2017 · 5 comments

Comments

@ximion
Copy link
Contributor

ximion commented Oct 4, 2017

We found this one in Debian/Ubuntu while building Sambamba1

ldc2: /build/ldc-1.4.0/ir/irvar.cpp:44: IrGlobal* getIrGlobal(VarDeclaration*, bool): Assertion `decl->ir->irGlobal != NULL' failed.
/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x7f5d42064cea]
/usr/lib/x86_64-linux-gnu/libLLVM-5.0.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x56)[0x7f5d42062fd6]
LDC - the LLVM D compiler (1.4.0):
  based on DMD v2.074.1 and LLVM 5.0.0
  built with LDC - the LLVM D compiler (0.17.5)
  Default target: x86_64-pc-linux-gnu
  Host CPU: haswell
  http://dlang.org - http://wiki.dlang.org/LDC

The issue appears to affect all architectures and did not happen with LDC 1.2.

Here is a slightly more minimized testcase, with no additional dependencies other than LDC: ldc_assert_crash_test.tar.gz (could likely be reduced even further).

Cc @LocutusOfBorg

@kinke
Copy link
Member

kinke commented Oct 4, 2017

Note that I mentioned and somewhat analyzed this already in #2336. It's not clear whether that has to do with the general template culling issue or whether it's something different.

@ximion
Copy link
Contributor Author

ximion commented Oct 4, 2017

Ah, nice - so this likely is a duplicate then.

kinke added a commit to kinke/ldc that referenced this issue Oct 14, 2017
And improve robustness for TypeInfos of speculative types by only
eliding their TypeInfo definition, not the declaration of the LL global
altogether.
Handle `-betterC` exactly the same way; don't touch ClassInfos as
-betterC doesn't support classes [yet].

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit to kinke/ldc that referenced this issue Oct 14, 2017
And improve robustness for TypeInfos of speculative types by only
eliding their TypeInfo definition, not the declaration of the LL global
altogether.
Handle `-betterC` exactly the same way; don't touch ClassInfos as
-betterC doesn't support classes [yet].

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
@kinke kinke mentioned this issue Oct 14, 2017
kinke added a commit to kinke/ldc that referenced this issue Oct 15, 2017
And improve robustness for TypeInfos of speculative types by only
eliding their TypeInfo definition, not the declaration of the LL global
altogether.
Handle `-betterC` exactly the same way; don't touch ClassInfos as
-betterC doesn't support classes [yet].

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit to kinke/ldc that referenced this issue Oct 15, 2017
And improve robustness for TypeInfos of speculative types by only
eliding their TypeInfo definition, not the declaration of the LL global
altogether.
Handle `-betterC` exactly the same way; don't touch ClassInfos as
-betterC doesn't support classes [yet].

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit to kinke/ldc that referenced this issue Oct 15, 2017
And improve robustness for TypeInfos of speculative types by only
eliding their TypeInfo definition, not the declaration of the LL global
altogether.
Handle `-betterC` exactly the same way; don't touch ClassInfos as
-betterC doesn't support classes [yet].

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit to kinke/ldc that referenced this issue Oct 15, 2017
Improve robustness for TypeInfos of speculative types by only eliding
their TypeInfo definition, not the declaration of the LL global
altogether.

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit to kinke/ldc that referenced this issue Oct 17, 2017
Improve robustness for TypeInfos of speculative types by only eliding
their TypeInfo definition, not the declaration of the LL global
altogether.

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue ldc-developers#2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
kinke added a commit that referenced this issue Oct 18, 2017
Improve robustness for TypeInfos of speculative types by only eliding
their TypeInfo definition, not the declaration of the LL global
altogether.

`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue #2357). So now only
linker errors should result in case the TypeInfo definition is missing.

Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
@kinke
Copy link
Member

kinke commented Oct 18, 2017

The crash should be fixed by #2366. I hope sambamba now builds fine on Debian. The fix is in v1.5.0-beta1 which will be released in a couple of hours.

@LocutusOfBorg
Copy link
Contributor

thanks!

@ximion
Copy link
Contributor Author

ximion commented Nov 7, 2017

This is indeed fixed now, thank you! :-)

@ximion ximion closed this as completed Nov 7, 2017
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

3 participants