[Issue 18717] Segfault in BitManip

2018-04-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18717

ag0aep6g  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from ag0aep6g  ---
(In reply to ag0aep6g from comment #2)
> I've filed a new issue for the dmd bug: issue 18730. When that one gets
> fixed, this one can be closed as a duplicate.

18730 has been fixed. Closing this one as a duplicate.

*** This issue has been marked as a duplicate of issue 18730 ***

--


[Issue 18717] Segfault in BitManip

2018-04-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18717

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=18730

--


[Issue 18717] Segfault in BitManip

2018-04-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18717

--- Comment #3 from Cédric Picard  ---
Thanks a lot, your interpretation makes sense.

--


[Issue 18717] Segfault in BitManip

2018-04-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18717

ag0aep6g  changed:

   What|Removed |Added

 CC||ag0ae...@gmail.com

--- Comment #2 from ag0aep6g  ---
(In reply to Cédric Picard from comment #0)
> │   0x5558709cde70  0fa33e bt dword [rsi], edi  
> 
> 
> At that point we have:
> rsi = 0x7f40163e2010   -> our BitArray
> rdi = 0x97174d8b   -> "evilVal"

This is a codegen bug. It should be rdi in the bt instruction, not edi.

It's hard to find information on this, but this page says that the bt
instruction interprets the offset as signed:
. So rdi = 0x97174d8b becomes edi =
-1760080501. That's not intended, of course.

I've filed a new issue for the dmd bug: issue 18730. When that one gets fixed,
this one can be closed as a duplicate. Or thise one can be fixed by working
around the dmd bug in the BitArray code.

> A look at /proc/*/maps shows that the call falls into that section:
> 
> 0x7f40163e2000 # 0x7f4032928000 - usr 453.3M s -rw- unk1 unk1
> 
> IIUC this is what was allocated for our BitArray. However this isn't enough
> as 0x7f4032928000 - 0x7f40163e2000 < 2534886795.

You're comparing bytes to bits there. 2534886795 is the number of bits in the
array. That means, it needs ceil(2534886795 / 8) = 316860850 bytes. And that's
less than 0x7f4032928000 - 0x7f40163e2000.

--


[Issue 18717] Segfault in BitManip

2018-04-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18717

--- Comment #1 from Cédric Picard  ---
Forgot to mention that this may be related to
https://issues.dlang.org/show_bug.cgi?id=12458 although I do not the issues are
the same.

--