Thread overview
Very vague compiler error message
Aug 12, 2014
Jeremy DeHaan
Aug 12, 2014
ketmar
Aug 12, 2014
Rikki Cattermole
Aug 12, 2014
H. S. Teoh
Aug 12, 2014
Jeremy DeHaan
Aug 14, 2014
Théo Bueno
Aug 14, 2014
bearophile
Aug 14, 2014
Théo Bueno
Aug 15, 2014
Jeremy DeHaan
Aug 18, 2014
Jeremy DeHaan
August 12, 2014
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.
August 12, 2014
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.


August 12, 2014
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?
August 12, 2014
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!
August 12, 2014
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.
August 14, 2014
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 :/
August 14, 2014
Théo Bueno:

> Same issue here with dsfml-audio, this is really annoying :/

Have you filed the issue?

Bye,
bearophile
August 14, 2014
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.
August 15, 2014
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.
August 18, 2014
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.