Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #384 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

ldc can't compile Tango (SymOffExp::toElem returns NULL)

Reported by: darkjames Assigned to: ChristianK
Priority: major Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

Hi,

I'm new in D&LDC world so sorry if I made some general mistake :)

I've tried to compile trunk of tango using:

$ ./build/script/bob.sh --verbose ldc

ldc sigsegv while compiling tango/text/locale/Convert.d

[ldmd] tango/text/locale/Convert.d
0   ldc             0x0000000000d0254f
1   ldc             0x0000000000d03e18
2   libpthread.so.0 0x00007f2399390400
3   ldc             0x0000000000613dfa DtoAssign(Loc&, DValue*, DValue*) + 58
4   ldc             0x000000000063ee4c AssignExp::toElem(IRState*) + 252
5   ldc             0x0000000000610744 DtoDeclarationExp(Dsymbol*) + 596
6   ldc             0x000000000063f342 DeclarationExp::toElem(IRState*) + 66
7   ldc             0x000000000062ebec ExpStatement::toIR(IRState*) + 108
8   ldc             0x000000000062ea69 CompoundStatement::toIR(IRState*) + 89
Compilation of tango/text/locale/Convert.d failed

I've substracted smaller testcase (attached in Broken.d)

Attachments

Broken.d (0.6 kB) - added by darkjames on 12/24/09 00:07:40.
testcase ldc sigsegv.

Change History

12/24/09 00:07:40 changed by darkjames

  • attachment Broken.d added.

testcase ldc sigsegv.

12/24/09 00:14:18 changed by darkjames

Small research:

when compiling $ ldc -c Broken.d -vv

* * * * * * AssignExp::toElem: p = (& number) | (char*)(char* = char*)
* * * * * * * performing normal assignment
@ gen/toir.cpp:562 DValue* l = e1->toElem(p);
* * * * * * * VarExp::toElem: p @ char*
* * * * * * * * VarDeclaration ' p ' of type ' char* '
* * * * * * * * a normal variable

@ gen/toir.cpp:563 DValue* r = e2->toElem(p);
* * * * * * * SymOffExp::toElem: & number @ char*
SymOffExp returns 0 => r == NULL.

* * * * * * * DtoAssign(...);
@ gen/llvmhelpers.cpp:353 Type* t2 = rhs->getType()->toBasetype();
  rhs->getType() == NULL, (*0).toBaseType() sigsegv.

While looking for the bug, I found nopaste with simillar problem: http://en.pastebin.ca/1724452

Mine ldc was compiled without assert()'s, so it was quite funny to look for this bug :)

12/24/09 00:24:27 changed by darkjames

one more, after reverting 20799faa301d (http://hg.dsource.org/projects/ldc/rev/20799faa301d)

tango/text/locale/Convert.d compiles without segv.

12/24/09 05:49:53 changed by wilsonk

  • status changed from new to closed.
  • resolution set to fixed.

Reverted the last change from Robert, as mentioned above, to temporarily fix this. Downs may look into it some more.

Thanks, K.Wilson

12/24/09 10:55:53 changed by doob

I don't know if this affects the ticket but I'm not sure bob.sh is usable, it has been a month since the last update. Try bob or bob.rb, they're up to date.

Copyright © 2008, LDC Development Team.