<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 - Support Solaris in sanitizers"
   href="https://bugs.llvm.org/show_bug.cgi?id=33274">33274</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support Solaris in sanitizers
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Solaris
          </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>compiler-rt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ro@gcc.gnu.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>kcc@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Over the last 3 years, I've been working on and off on a port of the sanitizers
to Solaris (both sparc and x86).  This work has mostly been done within gcc
(firstly since I'm most familiar with that development environment; I happen to
be the GCC Solaris maintainer, but also as it turns out that Solaris support in
LLVM is in a bad state to be almost unusable as a foundation for the sanitizer
port).

Yesterday, I've made a new attempt after a year, based on libsanitizer in GCC
mainline (which is a mostly unmodified import from LLVM r285547) and achieved
good (i386-pc-solaris2.12) and reasonable (sparc-sun-solaris2.12) results with
the GCC sanitizer testsuite ({g++.dg,gcc.dg}/*san/*san.exp) (32-bit only):

On Solaris 12/x86, the remaining failures are:

* g++:

c-c++-common/asan/swapcontext-test-1.c
g++.dg/asan/default-options-1.C

* gcc:

c-c++-common/asan/swapcontext-test-1.c

On Solaris 12/SPARC, there are some more:

* g++:

c-c++-common/asan/global-overflow-1.c
c-c++-common/asan/heap-overflow-1.c
c-c++-common/asan/misalign-1.c
c-c++-common/asan/misalign-2.c
c-c++-common/asan/stack-overflow-1.c
c-c++-common/asan/use-after-free-1.c
g++.dg/asan/default-options-1.C
g++.dg/asan/large-func-test-1.C

* gcc:

c-c++-common/asan/global-overflow-1.c
c-c++-common/asan/heap-overflow-1.c
c-c++-common/asan/misalign-1.c
c-c++-common/asan/misalign-2.c
c-c++-common/asan/stack-overflow-1.c
c-c++-common/asan/use-after-free-1.c

which are mostly due to line number mismatches.

As mentioned above, the port is currently 32-bit-only.  This is due to the fact
that Solaris uses a discontinuous address space layout on 64-bit

<a href="http://docs.oracle.com/cd/E53394_01/html/E61689/advanced-2.html#SSFDGadvanced-5">http://docs.oracle.com/cd/E53394_01/html/E61689/advanced-2.html#SSFDGadvanced-5</a>
<a href="http://docs.oracle.com/cd/E53394_01/html/E61689/fcowb.html#SSFDGfcpaf">http://docs.oracle.com/cd/E53394_01/html/E61689/fcowb.html#SSFDGfcpaf</a>

and the shadow memory calculation cannot currently cope with that AFAICS.
However, on a recent Solaris 12 build, the x86 port changed to continuous
layout, so a 64-port should be relatively easy.  This won't help for sparc,
though, neither for Solaris 10 and 11.  To make matters worse, the exact
location of the VA hole is dependent on the exact platform at least on sparc.

To get the ball rolling, I'll be attaching my current set of patches (based,
as I said, on what's currently in GCC mainline's libsanitizer directory), so
we can discuss if they are (if updated for LLVM trunk) in any way appropriate
for commit into compiler-rt).  Otherwise, I believe there's no way to get them
into GCC.

On the LLVM side of things, I understand that there's currently work going on
to provide patches for proper Solaris support on LLVM mainline.  Once that
lands, I can see to beat my current patches for sanitizer support outside of
compiler-rt into a usable form.

  Rainer</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>