[Bug 273] Unexplained crash in generated binary

2017-10-02 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

Iain Buclaw  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are watching all bug changes.


Re: [Bug 273] Unexplained crash in generated binary

2017-10-01 Thread Sebastien Alaiwan via D.gnu

On Sunday, 1 October 2017 at 21:19:16 UTC, Iain Buclaw wrote:
Yes, the safe workaround is to have a pointer in the Derived 
class


[...]

Found the cause, and pushing a fix right now. :-)



This is great, thanks to both of you guys!



[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #13 from Iain Buclaw  ---
https://github.com/D-Programming-GDC/GDC/pull/554

-- 
You are receiving this mail because:
You are watching all bug changes.


Re: [Bug 273] Unexplained crash in generated binary

2017-10-01 Thread Iain Buclaw via D.gnu
On 1 October 2017 at 10:17, Sebastien Alaiwan via D.gnu
 wrote:
> On Saturday, 30 September 2017 at 08:08:29 UTC, Iain Buclaw wrote:
>>
>> --- Comment #4 from Iain Buclaw  ---
>> If there's a specific configuration that defeats the GC's ability to
>> determine live objects from unreferenced, I'd like to know about it.
>
>
> This one is blocking us (luckily, only on one project).
> Any idea for a workaround?
>

Yes, the safe workaround is to have a pointer in the Derived class
(see update in bugzilla thread).


> We can't downgrade to gdc-6 because
> https://bugzilla.gdcproject.org/show_bug.cgi?id=250 (fixed on master, not
> backported to gdc-6).
>
> Thanks!
>
> (PS: You're talking about Ubuntu, please note that the testcase comes from
> Debian)
>

They come from the same build source tree. Apply mostly the same
patches, and configure options.

It seems however that it is not Debian specific.  Found the cause, and
pushing a fix right now. :-)

Regards
Iain.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #12 from Iain Buclaw  ---
---
for (ClassDeclaration *bcd = cd; bcd; bcd = bcd->baseClass)
  {
if (!bcd->members)
  continue;

──> for (size_t i = 0; i < cd->members->dim; i++)
  {
Dsymbol *sm = (*cd->members)[i];
if (sm->hasPointers ())
  goto Lhaspointers;
  }
  }
---

It was at this point when palm said hello to face.

First bad commit was: 8bffa3ab8857398ef800fccde153029d289b68fc

https://github.com/D-Programming-GDC/GDC/pull/371

This is actually a horribly horrific horridness of a regression.

Here's a minimal test case that fails in master:

---
void main()
{
assert((Base.classinfo.m_flags & 2) == 0);// OK
assert((Derived.classinfo.m_flags & 2) == 0); // Fail
}

class Derived : Base { }

class Base
{
  Base[] children;
}
---

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

Iain Buclaw  changed:

   What|Removed |Added

   Priority|Normal  |Highest
   Severity|normal  |critical

--- Comment #11 from Iain Buclaw  ---
I think the bug is in our setting of class flags for type Derived.  It seems to
be setting 'ClassFlags.noPointers', however it does not set this for the class
Base.

This is most curious, as if Base is determined to have pointers, then Derived
should have the same flag setting.

Checking the part of the compiler where this logic is maintained.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #10 from Iain Buclaw  ---
(In reply to Iain Buclaw from comment #9)
> So far I've narrowed it down to the commit *before* updating to 2.072 (bad)
> and the commit *after* updating to 2.075 (good).
> 
> Chances am it may just be libphobos 2.071 that is bad, but will continue to
> dig a bit further.

Yep, the first good commit is the updating phobos/druntime to 2.072.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #9 from Iain Buclaw  ---
So far I've narrowed it down to the commit *before* updating to 2.072 (bad) and
the commit *after* updating to 2.075 (good).

Chances am it may just be libphobos 2.071 that is bad, but will continue to dig
a bit further.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #8 from Iain Buclaw  ---
(In reply to Johannes Pfau from comment #7)
> OK, can reproduce with revision ac0c40aca0638ba0f22e23dd5c03da35ef4f311a.

Excellent.  I can only so far reproduce using
f29d15a1a96856c0880aef832bf1d5859bbb1086 - after applying all debian-specific
patches *and* configuring with mostly the same flags as debian's build.

If I remove the patches, then it works.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #7 from Johannes Pfau  ---
OK, can reproduce with revision ac0c40aca0638ba0f22e23dd5c03da35ef4f311a.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #6 from Iain Buclaw  ---
According to the timestamp of the gcc sources in Debian/Ubuntu, the date is it
was taken was 20170502.  So that may narrow it down to a possible regression
and fix commit.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-10-01 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

Johannes Pfau  changed:

   What|Removed |Added

 CC||johannesp...@gmail.com

--- Comment #5 from Johannes Pfau  ---
I can't reproduce this with the latest gdc-7 branch on an Archlinux system. 

Though if this is GC memory corruption it's likely even small changes in
GDC/phobos or the used OS can hide such a problem :-(

-- 
You are receiving this mail because:
You are watching all bug changes.


Re: [Bug 273] Unexplained crash in generated binary

2017-10-01 Thread Sebastien Alaiwan via D.gnu

On Saturday, 30 September 2017 at 08:08:29 UTC, Iain Buclaw wrote:

--- Comment #4 from Iain Buclaw  ---
If there's a specific configuration that defeats the GC's 
ability to determine live objects from unreferenced, I'd like 
to know about it.


This one is blocking us (luckily, only on one project).
Any idea for a workaround?

We can't downgrade to gdc-6 because 
https://bugzilla.gdcproject.org/show_bug.cgi?id=250 (fixed on 
master, not backported to gdc-6).


Thanks!

(PS: You're talking about Ubuntu, please note that the testcase 
comes from Debian)




[Bug 273] Unexplained crash in generated binary

2017-09-30 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #4 from Iain Buclaw  ---
I can't reproduce on master locally, though I'd like to check the gdc-7 branch
specifically. As this is a compiler packaged for Ubuntu, cannot rule out that
some distribution-specific patches have an effect on the result.

If there's a specific configuration that defeats the GC's ability to determine
live objects from unreferenced, I'd like to know about it.

This reminds me of
https://github.com/D-Programming-GDC/GDC/commit/5021b8d031fcacac52ee43d83508a5d2856606cd
- that patch is not related, but it could be a similar symptom (scanning for
pointers at unaligned offsets).

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-09-30 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #3 from Sebastien Alaiwan  ---
Hi Iain, thanks for looking. Were you able to reproduce it with the git master
HEAD?

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-09-29 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

--- Comment #2 from Iain Buclaw  ---
Oh wait, no.  This is a bug in the GC.

-- 
You are receiving this mail because:
You are watching all bug changes.


[Bug 273] Unexplained crash in generated binary

2017-09-29 Thread gdc-bugzilla--- via D.gnu
https://bugzilla.gdcproject.org/show_bug.cgi?id=273

Iain Buclaw  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #1 from Iain Buclaw  ---
Ouch, looks like some horrid stack stomping is going on.

---
(gdb) p box.children 
$1 = {0x77ecb020, 0x77ecb040}
(gdb) n
(gdb) p box.children
$2 = {0x77ecb080, 0x557c71a0}
---

-- 
You are receiving this mail because:
You are watching all bug changes.