<html>
    <head>
      <base href="https://bugs.llvm.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 - Assertion failure when emitting call to __dfsan_mem_transfer_callback"
   href="https://bugs.llvm.org/show_bug.cgi?id=50075">50075</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure when emitting call to __dfsan_mem_transfer_callback
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Miscellaneous Instrumentation passes
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>elia.f.geretto@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24784" name="attach_24784" title="Bitcode reproducer">attachment 24784</a> <a href="attachment.cgi?id=24784&action=edit" title="Bitcode reproducer">[details]</a></span>
Bitcode reproducer

When processing the following function, DFSan triggers the assertion "Calling a
function with a bad signature!" in `DFSanVisitor::visitMemTransferInst`:

```
; Function Attrs: nounwind uwtable
define dso_local i32 @b() local_unnamed_addr #0 {
entry:
  call void @llvm.memcpy.p0i8.p0i8.i32(
    i8* nonnull align 16 dereferenceable(5) bitcast ([10 x i32]* @a to i8*),
    i8* nonnull align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5
x i8]* @.str.1, i64 0, i64 0),
    i32 5,
    i1 false)
  ret i32 undef
}
```

The problem is due to the fact that the length of the
`llvm.memcpy.p0i8.p0i8.i32` intrinsic, which is an `i32`, is passed to the
`__dfsan_mem_transfer_callback` function, which instead takes an `i64`.

The bug is reproducible with the bitcode file attached using the following
command:

```
opt -dfsan -dfsan-event-callbacks minigzip_opt.bc -disable-output
```</pre>
        </div>
      </p>


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

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>