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

Building LuaD fails on Windows #642

Closed
aubade opened this issue Jun 24, 2014 · 4 comments
Closed

Building LuaD fails on Windows #642

aubade opened this issue Jun 24, 2014 · 4 comments

Comments

@aubade
Copy link

aubade commented Jun 24, 2014

I'm using the 0.13.0 release on windows, with the mingw build recommended in the README.txt file, and when I try to download and run the unit tests on LuaD using dub, the compiler seems to be crashing somewhere:

Running the commands:
dub fetch luad
dub test --compiler=ldc2 --arch=x86

It errors out with the following text:

Running ldc2...
0x004D5167 (0x0028F51C 0x0028F534 0x00000002 0x004589E7)
0x0045AFCD (0x0140404C 0x0028F510 0x00000042 0x00000001)
0x004589E7 (0x0028F51C 0x0028F534 0x00000080 0x00FC2469)
0x0045C693 (0x0028F51C 0x0028F534 0x036035F0 0x00000005)
0x00458AB2 (0x0028FAF4 0x035EDB78 0x0EB23FA8 0x0028F5E8)
0x0052F0C2 (0x00000000 0x0028F5D8 0x0CF8ED30 0x0E8059C0)
0x00413002 (0x0E8059C0 0x00000000 0x0000012B 0x0EBEAA98)
0x00D13225 (0x0000012B 0x00000000 0x0E8059C0 0x035EDC38)
0x004A0373 (0xBCB4A5D8 0x0028FC30 0x0E2D47F0 0x0028FB98)
0x76B098DA (0x0028FC0C 0x0028FC0C 0x0028FC1C 0x0DE441C0), free() + 0x46 bytes(s)

0x76B098DA (0x0028FC0C 0x0028FC1C 0x0DE441C0 0x00000002), free() + 0x46 bytes(s)

0x0028FC0C (0x0028FC1C 0x0DE441C0 0x00000002 0x0028FC20) <unknown module>
0x0028FC0C (0x0028FC20 0x0EBF21F0 0x0028FC1C 0x0028FC1C) <unknown module>
FAIL .dub\build\__test__library__-unittest-windows-x86-ldc2-727BB71E0651B8EE8577
E0D61EA3CF9A\ __test__library__ executable
Error executing command test: ldc2 failed with exit code -1073741819
@redstar
Copy link
Member

redstar commented Jun 24, 2014

Thanks for the report. I try to reproduce this now.

@redstar
Copy link
Member

redstar commented Jun 24, 2014

Ok, I can reproduce it. The error is in luad.table, line 299. ldc2 -c -unittest luad/table.d is enough to trigger the error. I now try to create a reduced test case.

@redstar
Copy link
Member

redstar commented Jun 25, 2014

Quick fix is to change line 4177 in dmd2/func.c from

if (semanticRun >= PASSsemantic3done)
{
    assert(cs);

to

if (semanticRun >= PASSsemantic3done && cs)
{

The DMD source assumes that the statement of a FuncLiteralDeclaration is a CompoundStatement. But in this case it is a TryFinallyStatement. Therefore the assertion fails, causing the error.

I still need to investigate if this is a genuine frontend bug or if the bug occurs because of a AST rewrite in LDC specific code.

redstar added a commit that referenced this issue Jun 25, 2014
The DMD source assumes that the statement of a FuncLiteralDeclaration is a CompoundStatement.
But in this case it is a TryFinallyStatement. Therefore the assertion fails, causing the error.
The code was fixed in DMD 2.066.
redstar referenced this issue Jun 27, 2014
This should help with performance of previous commit.
redstar pushed a commit that referenced this issue Sep 27, 2014
@redstar
Copy link
Member

redstar commented Oct 12, 2014

Fixed in master.

@redstar redstar closed this as completed Oct 12, 2014
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