Totally bizarre error, requesting assistance

Koz Ross via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 18 23:37:45 PDT 2014


On Friday, 19 September 2014 at 06:35:32 UTC, Iain Buclaw via 
Digitalmars-d wrote:
> On 19 Sep 2014 05:50, "Koz Ross via Digitalmars-d" <
> digitalmars-d at puremagic.com> wrote:
>>
>> I don't know if this is the right place to ask, but I figured 
>> it was
> worth a try. Basically, I'm getting totally bizarre behaviour 
> from my code,
> which I have put in a repo at
> https://gitorious.org/tournament-tree/tournament-tree/source/545460fb9d760b6bfa5bc74deb7b69d79ec70541
> :
>>
>> To replicate the error, simply run 'make profile' from the 
>> project
> directory. It should fail (claiming an enforcement error on 
> node.d, line
> 50). Then, go to tournament.d, and uncomment line 33. Then, try 
> 'make
> profile' again, and it won't have the same issue. I've been 
> working all day
> to try and isolate the source of the problem, across multiple 
> machines, and
> I've had no luck. This is the most isolation I've managed.
>>
>> I would really appreciate any and all help, as this is 
>> something that
> totally baffles me. I know this is a lot of code, and it's 
> probably quite
> hideous, but it would help me a lot if someone could at least 
> suggest as to
> where the source of the problem lies.
>>
>> I already am aware that the failure is caused by an overflow, 
>> but its
> source is completely unclear, and I never get overflows when 
> that one
> writeln statement in tournament.d is executed (hence my 
> confusion).
>>
>> I'm running Manjaro GNU/Linux, and my gdc version is 4.9.1. I 
>> have a
> 64-bit OS.
>
> What flags are you using to build?  And is this a package you 
> installed
> from your distribution?
>
> Recently in upstream, I've turned on -fwrapv by default so that 
> the backend
> handles overflow as precisely defined, rather than optimising 
> aggressively
> by pretending it never happens.
>
> http://bugzilla.gdcproject.org/show_bug.cgi?id=141
>
> It may be a good idea to add this flag to your build script if 
> you are
> using an earlier version of gdc.
>
> Iain.

Hi Iain,

I'm using the flags as described in the makefile - my compile 
command is always

gdc -O3 -funittest -Wall -Werror -Wdeprecated -Wunknown-pragmas -g

The package I'm using is the gdc package from AUR (as Manjaro is 
an Arch).

I'll try -fwrapv and see if it does anything.


More information about the Digitalmars-d mailing list