<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57768>57768</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Offline symbolization for sanitizers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            compiler-rt,
            debuginfod
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mysterymath
      </td>
    </tr>
</table>

<pre>
    Now that [symbolizer markup](https://llvm.org/docs/SymbolizerMarkupFormat.html) filtering has landed in llvm-symbolizer, it's possible to add an option to use offline symbolization in LLVM's sanitizers.

The would allow symbolization to occur out of process and after the fact, via debuginfod lookups. This means that fully-stripped binaries could produce readable sanitizer reports. This also wouldn't require the sanitized process to write out any files, fork processes, etc. It would just print out machine-readable markup, and the work of producing a readable report could be space-shifted to a more capable machine with better access to debug information (useful for CI and log processing pipelines).

There's already a version of this in sanitizer_symbolizer_markup.cpp, but this is at least somewhat Fuchsia-specific. The symbolizer markup filter depends on contexual information about the layout of the binary appearing in the logs to be symbolized. Fuchsia arranges for this to occur via out-of-band mechanisms, but for this to work on other operating systems, these markup elements would need to be printed within the sanitizer library.

All the functionality needed to do so should already be present; you just need the runtime layout of the loaded modules in the address space (and their Build IDs). Since these are already present in the common sanitizer libraries, it should be a relatively simple matter to flesh this out and provide it as an option that works in a cross-platform fashion.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVdFu2zgQ_Br5hbAgy3FiPeghaWAgQHv30OJeixW1sthSpI6kkvN9_Q0pyU7aA4LYlsTZmdnZVWPbS_2HfROhpyCyw5O_DI3V6l92YiD3cxqzw3NWHvsQRp_tH7PyhD-tX4fcujO-tlZ6fHy9HvuSTp2sGyjkfRh0VlaiUzqwU-YsevJCk2m5FcqICLS9lczKT0KFrHzwYrTeq0azCFZQ2woywo5BWRMvTJ6F7TqtDIv1NKWbwPz8-a8v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