Thread overview | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 25, 2015 Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result. I've been able to determine that many of the segmentation faults is due to the append operator. The fault only occurs when using a variable, and only when two append operators are used in the same statement. I was wondering if anyone can replicate this in their environment or have an idea of how to determine the cause. An example is here: import std.c.stdio : printf; void main() { string variable = "variable"; printf("made a string\n"); string result; result = "before " ~ variable; printf("before\n"); result = variable ~ " after"; printf("after\n"); result = "before " ~ "novar" ~ " after"; printf("novar\n"); result = "before " ~ variable ~ " after"; // this line will seg fault printf("crashes before getting here\n"); } |
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Brogan | Hi Kevin!
On Wednesday, 25 February 2015 at 00:02:33 UTC, Kevin Brogan wrote:
> I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result.
>
> I've been able to determine that many of the segmentation faults is due to the append operator.
>
> The fault only occurs when using a variable, and only when two append operators are used in the same statement.
>
> I was wondering if anyone can replicate this in their environment or have an idea of how to determine the cause.
>
> An example is here:
>
> import std.c.stdio : printf;
> void main()
> {
> string variable = "variable";
> printf("made a string\n");
>
> string result;
>
> result = "before " ~ variable;
> printf("before\n");
>
> result = variable ~ " after";
> printf("after\n");
>
> result = "before " ~ "novar" ~ " after";
> printf("novar\n");
>
> result = "before " ~ variable ~ " after"; // this line will seg fault
> printf("crashes before getting here\n");
> }
I check this. Please note that the Win64 version of LDC has still alpha quality. Every help is welcome here!
Regards,
Kai
|
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Brogan | "Kevin Brogan" wrote in message news:duzfvxzdoadpoxkxacuz@forum.dlang.org... > I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result. > > I've been able to determine that many of the segmentation faults is due to the append operator. > > The fault only occurs when using a variable, and only when two append operators are used in the same statement. > > I was wondering if anyone can replicate this in their environment or have an idea of how to determine the cause. The druntime function that implements the append operator uses variadic arguments (at least it does in DMD), so I would guess this is a symptom of them being broken on win64/LDC. |
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Brogan | On Wednesday, 25 February 2015 at 00:02:33 UTC, Kevin Brogan wrote: > I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result. I'd like to help out with this. I also have LDC 64bit running on Windows using MSVC, but have not been able to run the tests. Or, ctest starts to work, but while building the (iirc) 3rd test no further output is given to the cmdline. There is an ldc2 process running on one core, and after an hour the ldc2 process has allocated more than 1.5 GB of memory... That's when I stopped it. Should I have more patience, or is there perhaps something wrong with the way I kick off the tests? I used http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC#Running_the_tests and run ctest in the build folder (the ninja instructions end up not finding LDC2 in that folder (it does not search the path, but instead has a hardcoded location for LDC2.exe)). |
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | On Wednesday, 25 February 2015 at 14:09:59 UTC, Johan Engelen wrote: > I'd like to help out with this. I also have LDC 64bit running on Windows using MSVC, but have not been able to run the tests. I had to be careful about always running everything from within the visual studio native tools command prompt. I also had to put curl.lib in the environment lib path, (which was not defined at all on a fresh install), and put all of the LLVM and LDC bin directories in the path as well. Finally, I also had to modify the LLVM config file for both LDC and Ninja to pass /LARGEADDRESSAWARE:NO to the msvc linker or none of the debug builds would compile. c:\ldcenv\ninja-ldc2-x64\bin\ldc2.conf and %LDCROOT%\etc\ldc2.conf add ,"-L/LARGEADDRESSAWARE:NO" to switches Run ctest with -V as an option and it should give you some extra output. I'm not sure why it would just loop and consume memory though, but the third test does take a very long time to compile. |
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Murphy | On Wednesday, 25 February 2015 at 13:06:31 UTC, Daniel Murphy wrote:
> "Kevin Brogan" wrote in message news:duzfvxzdoadpoxkxacuz@forum.dlang.org...
>
>> I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result.
>>
>> I've been able to determine that many of the segmentation faults is due to the append operator.
>>
>> The fault only occurs when using a variable, and only when two append operators are used in the same statement.
>>
>> I was wondering if anyone can replicate this in their environment or have an idea of how to determine the cause.
>
> The druntime function that implements the append operator uses variadic arguments (at least it does in DMD), so I would guess this is a symptom of them being broken on win64/LDC.
I merged the new vararg code yesterday. The example does not crash for me.
Regards,
Kai
|
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Brogan | On Wednesday, 25 February 2015 at 00:02:33 UTC, Kevin Brogan wrote:
> ...
>
> I've been able to determine that many of the segmentation faults is due to the append operator.
>
Hi Kevin,
are you already using the new vararg code? (Committed yesterday....)
And which LLVM version do you use?
I could not reproduce the crash on Win64 right now.
Regards,
Kai
|
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | Hi Johan!
On Wednesday, 25 February 2015 at 14:09:59 UTC, Johan Engelen wrote:
> On Wednesday, 25 February 2015 at 00:02:33 UTC, Kevin Brogan wrote:
>> I've been able to successfully build LDC on 64 bit windows using msvc, but I've noticed that a large number of test suites fail with a segmentation fault instead of a regular error result.
>
> I'd like to help out with this. I also have LDC 64bit running on Windows using MSVC, but have not been able to run the tests.
Finding a way how to reliable run the tests on Windows is an open issue. :-(
Regards,
Kai
|
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin Brogan | Hi Kevin!
On Wednesday, 25 February 2015 at 19:09:44 UTC, Kevin Brogan wrote:
>
> Finally, I also had to modify the LLVM config file for both LDC and Ninja to pass /LARGEADDRESSAWARE:NO to the msvc linker or none of the debug builds would compile.
>
> c:\ldcenv\ninja-ldc2-x64\bin\ldc2.conf and
> %LDCROOT%\etc\ldc2.conf
>
> add ,"-L/LARGEADDRESSAWARE:NO" to switches
This is strange. /LARGEADDRESSAWARE:NO was only required for LLVM < 3.4. The Win64 version requires LLVM 3.6 otherwise there is no exception support.
Regards,
Kai
|
February 25, 2015 Re: Large number of tests failing - 64bit LDC with MSVC - Append Operator | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kai Nacke | On Wednesday, 25 February 2015 at 20:47:14 UTC, Kai Nacke wrote: > Hi Kevin! > > On Wednesday, 25 February 2015 at 19:09:44 UTC, Kevin Brogan wrote: >> >> Finally, I also had to modify the LLVM config file for both LDC and Ninja to pass /LARGEADDRESSAWARE:NO to the msvc linker or none of the debug builds would compile. >> >> c:\ldcenv\ninja-ldc2-x64\bin\ldc2.conf and >> %LDCROOT%\etc\ldc2.conf >> >> add ,"-L/LARGEADDRESSAWARE:NO" to switches > > This is strange. /LARGEADDRESSAWARE:NO was only required for LLVM < 3.4. The Win64 version requires LLVM 3.6 otherwise there is no exception support. > > Regards, > Kai Seems to have come back then. It's only required for debug builds. From what I can tell, this has something to do with the dwarf2 debug code using 32 bit relocations and msvc's link has some kind of bug in it. More info here: http://tortall.lighthouseapp.com/projects/78676/tickets/213-invalid-relocations-for-32-bit-dwarf2-in-64-bit-windows-object-files |
Copyright © 1999-2021 by the D Language Foundation