<html>
    <head>
      <base href="http://bugzilla.gdcproject.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - master: std.json unittest fails: memcmp of struct containing a union"
   href="http://bugzilla.gdcproject.org/show_bug.cgi?id=216">216</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>master: std.json unittest fails: memcmp of struct containing a union
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>GDC
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>development
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>gdc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>ibuclaw@gdcproject.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>johannespfau@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On ARM, the std.json unittest at line 1155 is failing. I also saw this failure
once on X86 but couldn't reproduce it there.

In the end, it boils down to this:
---------------
#0  object.TypeInfo_Struct.equals(const(void*), const(void*)) const
(this=<optimized out>, p1=0x76cad3b0, 
    p2=0x76cad3d0) at ../../../../gcc-5.3.0/libphobos/libdruntime/object.d:1027
#1  0x0160cd54 in _aaKeys_x (e=0x76cad3a0, this=<optimized out>)
    at ../../../../gcc-5.3.0/libphobos/libdruntime/rt/aaA.d:784
#2  _aaEqual (tiRaw=<optimized out>, e1=..., e2=...) at
../../../../gcc-5.3.0/libphobos/libdruntime/rt/aaA.d:807
#3  0x0148e58c in std.json.__unittestL1130_11() () at
../../../../gcc-5.3.0/libphobos/src/std/json.d:1155
#4  0x0149e73c in std.json.__modtest() () at
../../../../gcc-5.3.0/libphobos/src/std/json.d:1
#5  0x016256d0 in __foreachbody3 (this=0x7efff124, m=<optimized out>)
    at ../../../../gcc-5.3.0/libphobos/libdruntime/core/runtime.d:448
#6  0x01610b50 in rt.minfo.moduleinfos_apply(scope
int(immutable(object.ModuleInfo*)) delegate) (dg=...)
    at ../../../../gcc-5.3.0/libphobos/libdruntime/rt/minfo.d:287
#7  0x016092bc in object.ModuleInfo.opApply(scope int(object.ModuleInfo*)
delegate) (dg=...)
    at ../../../../gcc-5.3.0/libphobos/libdruntime/object.d:1467
#8  0x01625900 in runModuleUnitTests () at
../../../../gcc-5.3.0/libphobos/libdruntime/core/runtime.d:438
#9  0x0160ffe0 in runAll (this=0x7efff390) at
../../../../gcc-5.3.0/libphobos/libdruntime/rt/dmain2.d:475
#10 0x0160fbd0 in rt.dmain2._d_run_main(int, char**, extern(C) int(char[][])
function).tryExec(scope void() delegate) (this=0x7efff390, dg=...) at
../../../../gcc-5.3.0/libphobos/libdruntime/rt/dmain2.d:451
#11 0x0160fd70 in _d_run_main (argc=1, argv=<optimized out>,
mainFunc=<optimized out>)
    at ../../../../gcc-5.3.0/libphobos/libdruntime/rt/dmain2.d:484
#12 0x76da5cf8 in __libc_start_main () from /usr/lib/libc.so.6
#13 0x000150e0 in _start ()
---------------


This reveals 3 individual GDC/DMDFE/phobos bugs:

1) GDC produces different results than DMD when comparing the memory (not sure
if we can do anything about this)
2) The JSONValue contains members which can't be compared bitwise anyway (AAs,
strings). But as these are part of a union DMD can't actually compare them
memberwise. It should probably refuse to compile the JSONValue struct.
3) The JSONValue struct needs an opEquals which checks the type of the
JSONValue and compares the correct union members.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>