digitalmars.D.learn - weird exception on windows
- Szabo Bogdan (25/25) Dec 14 2017 Hi,
- Kagamin (6/6) Dec 14 2017 writeln(fileName);
- Szabo Bogdan (2/8) Dec 14 2017 I'm not sure I understand this solution...
- Kagamin (1/1) Dec 15 2017 Try printf debugging in case argument is invalid.
- Szabo Bogdan (7/8) Dec 15 2017 ah .. ok ...
- Kagamin (2/2) Dec 15 2017 You can also try to call `exists` somewhere before this part of
- Kagamin (25/25) Dec 15 2017 You said tests fail?
- Szabo Bogdan (2/27) Dec 16 2017 I can not reproduce the crash with this example...
- Kagamin (5/5) Dec 15 2017 That said, tempCString code is suspicious:
- Kagamin (1/1) Dec 15 2017 Maybe this https://issues.dlang.org/show_bug.cgi?id=18084
- Steven Schveighoffer (5/6) Dec 15 2017 Thanks for looking into this. I created a PR to fix.
- Szabo Bogdan (7/14) Dec 16 2017 I have installed DMD 2.77.1 and I can not find the patched file
- bauss (4/22) Dec 16 2017 Just go and do the changes manually in your local phobos folder,
- Steven Schveighoffer (7/29) Dec 16 2017 Yes, this won't get into the release for a while. So please do this
- Szabo Bogdan (25/60) Dec 18 2017 I'm actually a linux and a mac user... this issue happens on a
- Steven Schveighoffer (10/52) Dec 18 2017 Hm... you shouldn't need to recompile phobos, it should be identical
- Kagamin (3/10) Dec 16 2017 Regression in 2.072?
- Vino (11/25) Dec 16 2017 H, All,
- unleashy (6/13) Dec 18 2017 I created the original issue in Szabo's post. I applied your fix,
- Szabo Bogdan (4/21) Jan 05 2018 It looks like this fix does not work:
Hi, I noticed that sometimes on windows this line of code crashes the test suites. https://github.com/gedaiu/fluent-asserts/blob/master/core/fluentasserts/core/results.d#L1072 This exception can be captured only with a debugger... is it a dmd bug? ``` Thread 25CC created, Entry: mswsock.00007FF9011604C0 EXCEPTION_DEBUG_INFO: dwFirstChance: 1 ExceptionCode: C0000005 (EXCEPTION_ACCESS_VIOLATION) ExceptionFlags: 00000000 ExceptionAddress: 00007FF9055E302C ntdll.00007FF9055E302C NumberParameters: 2 ExceptionInformation[00]: 0000000000000000 Read ExceptionInformation[01]: FFFFFFFFFFFFFFFF Inaccessible Address First chance exception on 00007FF9055E302C (C0000005, EXCEPTION_ACCESS_VIOLATION)! ``` I think this is related with this issue: https://github.com/gedaiu/fluent-asserts/issues/63 Can anyone help me with this? I don't even know how to start fixing this issue... Thanks, Bogdan
Dec 14 2017
On Thursday, 14 December 2017 at 14:47:25 UTC, Kagamin wrote:writeln(fileName); if (!fileName.exists) { return; } :)I'm not sure I understand this solution...
Dec 14 2017
On Friday, 15 December 2017 at 09:24:07 UTC, Kagamin wrote:Try printf debugging in case argument is invalid.ah .. ok ... I tried to debug the issue and it looks like the filename is valid and there is no null value. I am thinking that the value is destroyed before it reach the `GetFileAttributesW` or during that call... but I don't see how that is possible.
Dec 15 2017
You can also try to call `exists` somewhere before this part of code.
Dec 15 2017
You said tests fail? class SourceResult { private const { string file; size_t line; } this(string fileName = __FILE__, size_t line = __LINE__, size_t range = 6) nothrow { this.file = fileName; this.line = line; if (!fileName.exists) { return; } } } unittest { auto result = new SourceResult("test/values.d", 26); auto msg = result.file; } Does this fail too?
Dec 15 2017
On Friday, 15 December 2017 at 13:56:41 UTC, Kagamin wrote:You said tests fail? class SourceResult { private const { string file; size_t line; } this(string fileName = __FILE__, size_t line = __LINE__, size_t range = 6) nothrow { this.file = fileName; this.line = line; if (!fileName.exists) { return; } } } unittest { auto result = new SourceResult("test/values.d", 26); auto msg = result.file; } Does this fail too?I can not reproduce the crash with this example...
Dec 16 2017
That said, tempCString code is suspicious: https://github.com/dlang/phobos/blob/master/std/internal/cstring.d#L221 If unittest-versioned exists calls release-versioned tempCString, it will corrupt the stack. Try to replace 16 with 256 there and recompile your code.
Dec 15 2017
Maybe this https://issues.dlang.org/show_bug.cgi?id=18084
Dec 15 2017
On 12/15/17 10:08 AM, Kagamin wrote:Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 15 2017
On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:On 12/15/17 10:08 AM, Kagamin wrote:I have installed DMD 2.77.1 and I can not find the patched file in the phobos folder... should I try this by building the compiler? It seams that I can not build phobos without compiling dmd.. or maybe I don't know how...Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote:On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:Just go and do the changes manually in your local phobos folder, wherever you have DMD installed, since you can't build phobos or dmd.On 12/15/17 10:08 AM, Kagamin wrote:I have installed DMD 2.77.1 and I can not find the patched file in the phobos folder... should I try this by building the compiler? It seams that I can not build phobos without compiling dmd.. or maybe I don't know how...Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On 12/16/17 5:12 AM, bauss wrote:On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote:Yes, this won't get into the release for a while. So please do this manually (just copy the file changed by the pull over the existing one). It's something that doesn't need to be compiled into the phobos library, as it's a misrepresentation of the actual object when you compile with unittests, so there is no reason to recompile phobos. -SteveOn Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:Just go and do the changes manually in your local phobos folder, wherever you have DMD installed, since you can't build phobos or dmd.On 12/15/17 10:08 AM, Kagamin wrote:I have installed DMD 2.77.1 and I can not find the patched file in the phobos folder... should I try this by building the compiler? It seams that I can not build phobos without compiling dmd.. or maybe I don't know how...Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On Saturday, 16 December 2017 at 12:01:49 UTC, Steven Schveighoffer wrote:On 12/16/17 5:12 AM, bauss wrote:I'm actually a linux and a mac user... this issue happens on a windows ci machine at work. I tried to update the file and compile phobos with that change, and I don't know how to make it work... ` C:\D\dmd2\src\phobos>make -f win64.mak cd etc\c\zlib make -f win64.mak MODEL=64 zlib64.lib "CC=\"\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl""\"" "LIB=\"\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\lib""\"" "VCDIR=\Program Files (x86)\Microsoft Visual Studio 10.0\VC" "\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl" /c /O2 /nologo /I"\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE" /Zl adler32.c Error: '\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl' not found ` I don't know where I can find a 64bit toolchain for vs2010... I was expecting that dmd uses a newer compiler on windows... I guess that the best approach for me is to wait the next beta release of dmd and try it then... Thanks for the support!On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote:Yes, this won't get into the release for a while. So please do this manually (just copy the file changed by the pull over the existing one). It's something that doesn't need to be compiled into the phobos library, as it's a misrepresentation of the actual object when you compile with unittests, so there is no reason to recompile phobos. -SteveOn Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:Just go and do the changes manually in your local phobos folder, wherever you have DMD installed, since you can't build phobos or dmd.On 12/15/17 10:08 AM, Kagamin wrote:I have installed DMD 2.77.1 and I can not find the patched file in the phobos folder... should I try this by building the compiler? It seams that I can not build phobos without compiling dmd.. or maybe I don't know how...Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 18 2017
On 12/18/17 7:20 AM, Szabo Bogdan wrote:On Saturday, 16 December 2017 at 12:01:49 UTC, Steven Schveighoffer wrote:Me too :)On 12/16/17 5:12 AM, bauss wrote:I'm actually a linux and a mac user...On Saturday, 16 December 2017 at 08:07:30 UTC, Szabo Bogdan wrote:Yes, this won't get into the release for a while. So please do this manually (just copy the file changed by the pull over the existing one). It's something that doesn't need to be compiled into the phobos library, as it's a misrepresentation of the actual object when you compile with unittests, so there is no reason to recompile phobos.On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:Just go and do the changes manually in your local phobos folder, wherever you have DMD installed, since you can't build phobos or dmd.On 12/15/17 10:08 AM, Kagamin wrote:I have installed DMD 2.77.1 and I can not find the patched file in the phobos folder... should I try this by building the compiler? It seams that I can not build phobos without compiling dmd.. or maybe I don't know how...Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Stevethis issue happens on a windows ci machine at work. I tried to update the file and compile phobos with that change, and I don't know how to make it work...Hm... you shouldn't need to recompile phobos, it should be identical when not in unittest mode. Just replace the one file and see if the CI starts working.I don't know where I can find a 64bit toolchain for vs2010... I was expecting that dmd uses a newer compiler on windows...I hope someone can help you there, but I would expect most folks here to either not be Windows developers, or to be using the interactive version (not CI version). There may be someone with some experience than can help.I guess that the best approach for me is to wait the next beta release of dmd and try it then...That is also an option. However, the PR hasn't been pulled yet... -Steve
Dec 18 2017
On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:On 12/15/17 10:08 AM, Kagamin wrote:Regression in 2.072?Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On Saturday, 16 December 2017 at 12:39:53 UTC, Kagamin wrote:On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:H, All, Are are also getting the same exception on Windows after updating the dmd to version v2.077.1, our code was working fine for the past 2 months, the exception is just crashes the program, and it occur's every 1 time among in 3 runs. As per Microsoft it stated to download the package apps.diagcab and execute, but still no luck. ExceptionCode: C0000005 From, Vino.BOn 12/15/17 10:08 AM, Kagamin wrote:Regression in 2.072?Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On Saturday, 16 December 2017 at 13:59:11 UTC, Vino wrote:On Saturday, 16 December 2017 at 12:39:53 UTC, Kagamin wrote:Moreover we were able to find the line of code which was causing this exception string a = "1" a.to!int.isNumber /* exception is occurring at this point. From, Vino.BOn Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:H, All, Are are also getting the same exception on Windows after updating the dmd to version v2.077.1, our code was working fine for the past 2 months, the exception is just crashes the program, and it occur's every 1 time among in 3 runs. As per Microsoft it stated to download the package apps.diagcab and execute, but still no luck. ExceptionCode: C0000005 From, Vino.BOn 12/15/17 10:08 AM, Kagamin wrote:Regression in 2.072?Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 16 2017
On Saturday, 16 December 2017 at 14:05:28 UTC, Vino wrote:On Saturday, 16 December 2017 at 13:59:11 UTC, Vino wrote:the compiler might be parsing the expr like (a.to!(int.isNumber)) so it becomes a.to!bool.On Saturday, 16 December 2017 at 12:39:53 UTC, Kagamin wrote:Moreover we were able to find the line of code which was causing this exception string a = "1" a.to!int.isNumber /* exception is occurring at this point. From, Vino.B[...]H, All, Are are also getting the same exception on Windows after updating the dmd to version v2.077.1, our code was working fine for the past 2 months, the exception is just crashes the program, and it occur's every 1 time among in 3 runs. As per Microsoft it stated to download the package apps.diagcab and execute, but still no luck. ExceptionCode: C0000005 From, Vino.B
Dec 18 2017
On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:On 12/15/17 10:08 AM, Kagamin wrote:I created the original issue in Szabo's post. I applied your fix, but nothing changed—the test program still crashes with the same exception :/ What gives?Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Dec 18 2017
On Monday, 18 December 2017 at 22:49:30 UTC, unleashy wrote:On Friday, 15 December 2017 at 21:56:48 UTC, Steven Schveighoffer wrote:It looks like this fix does not work: https://github.com/dlang/phobos/pull/5932 Does anyone know how to debug this crash?On 12/15/17 10:08 AM, Kagamin wrote:I created the original issue in Szabo's post. I applied your fix, but nothing changed—the test program still crashes with the same exception :/ What gives?Maybe this https://issues.dlang.org/show_bug.cgi?id=18084Thanks for looking into this. I created a PR to fix. Szabo, can you please try with this patch and see if it fixes your issue? https://github.com/dlang/phobos/pull/5932 -Steve
Jan 05 2018