Closed puneet closed 8 years ago
Related DMD PR: https://github.com/D-Programming-Language/dmd/pull/5564 Note that in LDC, TypeInfo is immutable ("constant" in LLVM IR).
@puneet On my Mac with LLVM3.9, I can't get it to segfault. Can you give some more details?
$ ldc2 -v binary /home/puneet/local/github-ldc/ldc-master/build/bin/ldc2 version 028077 (DMD v2.069.2, LLVM 3.6.0) config /home/puneet/local/github-ldc/ldc-master/build/bin/ldc2.conf OVERVIEW: LDC - the LLVM D compiler [snip] $ cat typetest.d interface Foo {}
void main() { synchronized(typeid(Foo)) { // do nothing } } $ ldc2 -g typetest.d $ gdb typetest GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 [snip] Reading symbols from typetest...done. (gdb) run Starting program: /tmp/typetest [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault. 0x0000000000409f43 in rt.monitor_.ensureMonitor() () (gdb) bt
(gdb)
$ uname -a Linux airavata 3.13.0-17-generic #37-Ubuntu SMP Mon Mar 10 21:44:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
Fixed in all branches.
Reduced testcase. Compiles with dmd. Tested with LDC master and merge-2.070. Both compile a binary that segfault when executed. synchronized(typeid(SomeClass)) { } works as expected.
// reduced testcase interface Foo { } void main() { synchronized(typeid(Foo)) { } }