www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Very vague compiler error message

reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
I recently got this error messege when building my library:

dmd: cppmangle.c:154: void 
CppMangleVisitor::cpp_mangle_name(Dsymbol*): Assertion `0' failed.

I have no idea what it means and haven't found much information 
about it. I think I have narrowed it down to the file that is 
giving this error, but does anyone know what the heck causes 
something like this?  Talk about a nondescript error.
Aug 12 2014
next sibling parent ketmar via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Tue, 12 Aug 2014 07:16:49 +0000
Jeremy DeHaan via Digitalmars-d-learn
<digitalmars-d-learn puremagic.com> wrote:

 but does anyone know what the heck causes something like this?
it's internal compiler error, the thing that should never happen. try to use dustmite to build minimalictic test case and fill the bug.
Aug 12 2014
prev sibling next sibling parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 12/08/2014 7:16 p.m., Jeremy DeHaan wrote:
 I recently got this error messege when building my library:

 dmd: cppmangle.c:154: void CppMangleVisitor::cpp_mangle_name(Dsymbol*):
 Assertion `0' failed.

 I have no idea what it means and haven't found much information about
 it. I think I have narrowed it down to the file that is giving this
 error, but does anyone know what the heck causes something like this?
 Talk about a nondescript error.
That error is being generated from within dmd itself. In other words you've found an edge case congratulations! Look for functions/methods using the extern(C++) mangling. Mock them out into D versions and see which fails maybe?
Aug 12 2014
prev sibling next sibling parent "H. S. Teoh via Digitalmars-d-learn" <digitalmars-d-learn puremagic.com> writes:
On Tue, Aug 12, 2014 at 07:16:49AM +0000, Jeremy DeHaan via Digitalmars-d-learn
wrote:
 I recently got this error messege when building my library:
 
 dmd: cppmangle.c:154: void CppMangleVisitor::cpp_mangle_name(Dsymbol*):
 Assertion `0' failed.
 
 I have no idea what it means and haven't found much information about
 it. I think I have narrowed it down to the file that is giving this
 error, but does anyone know what the heck causes something like this?
 Talk about a nondescript error.
That's an ICE (Internal Compiler Error). Please reduce your test case and file a critical bug. T -- Stop staring at me like that! It's offens... no, you'll hurt your eyes!
Aug 12 2014
prev sibling next sibling parent "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
Awesome, thanks everyone.

I'll take the suggestion to use Dustmite as an excuse to
familiarize myself with it, but if normally extern(C++) types
cause it I know just where to look.
Aug 12 2014
prev sibling parent reply =?UTF-8?B?IlRow6lv?= Bueno" <munrek gmx.com> writes:
On Tuesday, 12 August 2014 at 07:16:50 UTC, Jeremy DeHaan wrote:
 I recently got this error messege when building my library:

 dmd: cppmangle.c:154: void 
 CppMangleVisitor::cpp_mangle_name(Dsymbol*): Assertion `0' 
 failed.

 I have no idea what it means and haven't found much information 
 about it. I think I have narrowed it down to the file that is 
 giving this error, but does anyone know what the heck causes 
 something like this?  Talk about a nondescript error.
Same issue here with dsfml-audio, this is really annoying :/
Aug 14 2014
parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Théo Bueno:

 Same issue here with dsfml-audio, this is really annoying :/
Have you filed the issue? Bye, bearophile
Aug 14 2014
parent reply =?UTF-8?B?IlRow6lv?= Bueno" <munrek gmx.com> writes:
On Thursday, 14 August 2014 at 13:28:03 UTC, bearophile wrote:
 Théo Bueno:

 Same issue here with dsfml-audio, this is really annoying :/
Have you filed the issue? Bye, bearophile
Jebbs filed an issue on his bugtracker : https://github.com/Jebbs/DSFML/issues/125 ... and he seems to have a fix, or at least a clue. Personally, I was not able to figure out where is the bug.
Aug 14 2014
parent reply "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
On Thursday, 14 August 2014 at 13:47:58 UTC, Théo Bueno wrote:
 On Thursday, 14 August 2014 at 13:28:03 UTC, bearophile wrote:
 Théo Bueno:

 Same issue here with dsfml-audio, this is really annoying :/
Have you filed the issue? Bye, bearophile
Jebbs filed an issue on his bugtracker : https://github.com/Jebbs/DSFML/issues/125 ... and he seems to have a fix, or at least a clue. Personally, I was not able to figure out where is the bug.
Yeah, sorry. I did get it to compile, but I didn't have access to my computer last night unexpectedly and I haven't checked it to confirm that the audio module still works. If everything does still work, then I'll upload the fix in the next couple of hours.
Aug 14 2014
parent "Jeremy DeHaan" <dehaan.jeremiah gmail.com> writes:
I didn't have access to my compute for longer than I thought, but 
I finally got around to this.

After some messing around, I not only managed to track down the 
cause, but I got it fixed and the Audio module for DSFML is back 
to where it was.


In one of my D classes, SoundStream, I defined a struct called 
Chunk, which held a chunk of sound data. It looks like this:

struct Chunk
{
   const(short)* samples;
   size_t sampleCount;
}


All of the streaming is actually happening in an extern(C++) 
interface instance, and with the help of Dustmite, the method 
that caused the initial error was this:

extern(C++) bool onGetData(SoundStream.Chunk* chunk);

I think because it has a D Class member as the parameter type in 
an extern(C++) class method the D compiler broke?

What I did to fix it was I changed Chunk from being a member of 
SoundStream and declared it as a extern(C++) struct instead.  
That changed onGetData to "extern(C++) bool onGetData(Chunk* 
chunk);" and the compiler was ok with that.

I might do some more testing to see if I can reproduce the error, 
but changing the parameter type fixed it for me.
Aug 17 2014