Thread overview
conv parse imported file bug?
Jul 16, 2012
Lemonfiend
Jul 16, 2012
Lemonfiend
Jul 16, 2012
Jonathan M Davis
Jul 16, 2012
Lemonfiend
July 16, 2012
[DMD32 D Compiler v2.059]

Hello,

I was rewriting some code so some large data array was a separate data file, and got an abnormal program termination, with the error:

C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2704): Error: function std.conv.parse!(float[],string).parse compiler error, parameter 's', bugzilla 2962?
Assertion failure: '0' on line 717 in file 'glue.c'

I made a small testcase, and it didn't occur again.
So I made the testcase slightly bigger, by moving the parse function to a separate module, and it occurred again.

According to the bugzilla referenced in the error this was fixed; perhaps not?

-- main.d ---------------
module tuttmp.main;

import std.stdio;

import tuttmp.file;
import tuttmp.parser;

void main()
{
	writeln(fileString);

	parseImport();
}


-- parser.d ---------------
module tuttmp.parser;

import std.conv;
import std.stdio;

public void parseImport()
{
	writeln(fileString);

	auto fileArray = parse!(float[])(fileString);

	writeln(fileArray);
}


-- file.d ---------------
module tuttmp.file;

public string fileString = import("file.data");


-- file.data ---------------
[1,2,3]

July 16, 2012
On Monday, 16 July 2012 at 17:02:52 UTC, Lemonfiend wrote:
> [DMD32 D Compiler v2.059]
>
> Hello,
>
> I was rewriting some code so some large data array was a separate data file, and got an abnormal program termination, with the error:
>
> C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2704): Error: function std.conv.parse!(float[],string).parse compiler error, parameter 's', bugzilla 2962?
> Assertion failure: '0' on line 717 in file 'glue.c'
>
> I made a small testcase, and it didn't occur again.
> So I made the testcase slightly bigger, by moving the parse function to a separate module, and it occurred again.
>
> According to the bugzilla referenced in the error this was fixed; perhaps not?
>
> -- main.d ---------------
> module tuttmp.main;
>
> import std.stdio;
>
> import tuttmp.file;
> import tuttmp.parser;
>
> void main()
> {
> 	writeln(fileString);
>
> 	parseImport();
> }
>
>
> -- parser.d ---------------
> module tuttmp.parser;
>
> import std.conv;
> import std.stdio;
>
> public void parseImport()
> {
> 	writeln(fileString);
>
> 	auto fileArray = parse!(float[])(fileString);
>
> 	writeln(fileArray);
> }
>
>
> -- file.d ---------------
> module tuttmp.file;
>
> public string fileString = import("file.data");
>
>
> -- file.data ---------------
> [1,2,3]

Blast, minor edit mistake..

parser.d is supposed to be

module tuttmp.parser;

import std.conv;
import std.stdio;

import tuttmp.file;

public void parseImport()
{
	auto fileArray = parse!(float[])(fileString);

	writeln(fileArray);
}
July 16, 2012
On Monday, July 16, 2012 19:02:48 Lemonfiend wrote:
> According to the bugzilla referenced in the error this was fixed; perhaps not?

The commit date for the fix is after the release of 2.059, so presumably, it works just fine with git master.

- Jonathan M Davis
July 16, 2012
On Monday, 16 July 2012 at 19:46:21 UTC, Jonathan M Davis wrote:
> On Monday, July 16, 2012 19:02:48 Lemonfiend wrote:
>> According to the bugzilla referenced in the error this was fixed;
>> perhaps not?
>
> The commit date for the fix is after the release of 2.059, so presumably, it
> works just fine with git master.
>
> - Jonathan M Davis

Ack.. I should have checked the date.. (never used bugzilla before)

Thanks :)