Internal compiler error

28 views
Skip to first unread message

Francisco Figueiredo Jr.

unread,
Jan 13, 2015, 2:39:51 PM1/13/15
to npgsq...@googlegroups.com

Hi all!

I'm playing with current master code and noticed the following error when I tried to compile it:

CSC : error CS0583: Internal Compiler Error (0xc0000005 at address 013018C1): likely culprit is 'COMPILE'.
GitHub\Npgsql\Npgsql\TypeHandlers\BitStringHandler.cs(24,20,24,36): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Npgsql.TypeHandlers.BitStringHandler'
GitHub\Npgsql\Npgsql\TypeHandlers\BitStringHandler.cs(12,11,12,30): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Npgsql.TypeHandlers'
GitHub\Npgsql\Npgsql\TypeHandlers\BitStringHandler.cs(12,11,12,30): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Npgsql'
GitHub\Npgsql\Npgsql\TypeHandlers\BitStringHandler.cs : error CS0584: Internal Compiler Error: stage 'COMPILE' symbol '<global namespace>'
GitHub\Npgsql\Npgsql\TypeHandlers\BitStringHandler.cs : error CS0586: Internal Compiler Error: stage 'COMPILE'


Are you getting those errors? I'm using vs2013 express update 4.

I noticed that the problem seems to be the TypeMappingAttribute, more specifically the internal TypeMappingAttribute(string pgName, NpgsqlDbType npgsqlDbType, DbType[] dbTypes=null, Type type=null) constructor.


I could only get it to compile without any problem by changing the contructor to the following two others:

internal TypeMappingAttribute(string pgName, NpgsqlDbType npgsqlDbType)
            : this(pgName, npgsqlDbType, new DbType[0], new Type[0]) { }

internal TypeMappingAttribute(string pgName, NpgsqlDbType npgsqlDbType, DbType[] dbTypes, Type type)
            : this(pgName, npgsqlDbType, dbTypes, new[] {type}) { }


While playing with those constructors, in some configurations, I received errors about ambiguous constructors between them regarding the DbType[] and Type[] when using null values. I think this may be the cause of the internal compiler error. But I'm not sure if this is the case.

I also think this may be some error in the compiler itself as when I compiled it under mono I didn't receive this error.




Emil Lenngren

unread,
Jan 13, 2015, 2:41:29 PM1/13/15
to Francisco Figueiredo Jr., npgsq...@googlegroups.com
I get the exact same error with VS2013 (both update 2 and update 4).
@roji said he was not getting the error, with VS2013 update 4...

--
You received this message because you are subscribed to the Google Groups "Npgsql Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Francisco Figueiredo Jr.

unread,
Jan 13, 2015, 2:49:50 PM1/13/15
to Emil Lenngren, npgsq...@googlegroups.com
On Tue, Jan 13, 2015 at 5:41 PM, Emil Lenngren <emil.l...@gmail.com> wrote:
I get the exact same error with VS2013 (both update 2 and update 4).
@roji said he was not getting the error, with VS2013 update 4...



I'm glad to know I'm not the only one getting this problem :)

At first I was running update 3 and so I thought this could be some bug in the compiler itself and updated to 4 with the same problem.

I still think this problem may be related to ambiguous calls between the different parameter types. I still don't know if it is a compiler bug because it isn't being able to solve this ambiguity or if it is a compiler bug because it doesn't throw a better message about this error. :)

Shay Rojansky

unread,
Jan 13, 2015, 3:00:20 PM1/13/15
to Francisco Figueiredo Jr., Emil Lenngren, npgsq...@googlegroups.com
Wow, it's the first time I've seen an actual crash in the Microsoft C# compiler...

Since it doesn't happen here I can't really work on it...You guys are welcome to modify the constructors if necessary, they're only a convenience feature for specifying the attributes...

Francisco Figueiredo Jr.

unread,
Jan 13, 2015, 3:13:05 PM1/13/15
to Shay Rojansky, Emil Lenngren, npgsq...@googlegroups.com
On Tue, Jan 13, 2015 at 6:00 PM, Shay Rojansky <ro...@roji.org> wrote:
Wow, it's the first time I've seen an actual crash in the Microsoft C# compiler...

Since it doesn't happen here I can't really work on it...You guys are welcome to modify the constructors if necessary, they're only a convenience feature for specifying the attributes...



Shay, do you have vs 2015 installed in your machine, right? I remember you talked about it when asking to add some c# 6 features to the codebase.

Maybe you are now using 2015 c# compiler which has this bug fixed? That would explain why you aren't getting this error.

Emil, if my theory of 2015 compiler is confirmed, I think we don't need to bother creating a testcase for it as they seem to have fixed it, right? I'll try to find some bug fixes list of the 2015 compiler and check if there is any mention to this type of error.

Francisco Figueiredo Jr.

unread,
Jan 13, 2015, 3:44:34 PM1/13/15
to npgsq...@googlegroups.com, francisco.f...@gmail.com, emil.l...@gmail.com


On Tuesday, January 13, 2015 at 6:00:20 PM UTC-2, Shay Rojansky wrote:
Wow, it's the first time I've seen an actual crash in the Microsoft C# compiler...



Yes. To me too. :)

 
Since it doesn't happen here I can't really work on it...You guys are welcome to modify the constructors if necessary, they're only a convenience feature for specifying the attributes...



Ok. I just created a pull request to change those constructors: https://github.com/npgsql/npgsql/pull/456

Shay, please let me know if it is ok. If so, we can merge it. This way, even if it is fixed in vs2015, people using vs2013 and below won't have problems.
 
On Tue, Jan 13, 2015 at 8:49 PM, Francisco Figueiredo Jr.  wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Npgsql Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to npgsql-dev+unsubscribe@googlegroups.com.

Francisco Figueiredo Jr.

unread,
Jan 13, 2015, 3:46:00 PM1/13/15
to npgsq...@googlegroups.com, Francisco Figueiredo Jr., Emil Lenngren
On Tue, Jan 13, 2015 at 6:44 PM, Francisco Figueiredo Jr. <francisco.f...@gmail.com> wrote:


On Tuesday, January 13, 2015 at 6:00:20 PM UTC-2, Shay Rojansky wrote:
Wow, it's the first time I've seen an actual crash in the Microsoft C# compiler...



Yes. To me too. :)



It was supposed to be: "Me too."
 
Reply all
Reply to author
Forward
0 new messages