<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Program crash due to mixed constant/dynamic static initialization"
   href="http://llvm.org/bugs/show_bug.cgi?id=19491">19491</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Program crash due to mixed constant/dynamic static initialization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kevin@kevinlocke.name
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As discussed in the thread on cfe-dev starting at
<a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036279.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036279.html</a> with better
isolation of the issue in
<a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036287.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036287.html</a> if a common
variable is initialized as a constant in one translation unit and dynamically
in another, linking those units together will result in the program crashing
during initialization (with EXC_BAD_ACCESS on OS X).

The only instances of this behavior that I am aware of are due to user error,
either incorrectly defining common variables or using incompatible compiler
settings for different translation units.  However, since it will occur when
two translation units use the boost library and are compiled with and without
-std=c++11 respectively, I would expect that the error is not uncommon and is
an instance where spending the effort to avoid the error or better handle it
would be worth the effort.

Richard Smith laid out a potential solution in
<a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036336.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-April/036336.html</a> I'm not sure
to what extent it may have already been considered or be on the roadmap, but I
wanted to file this bug so that other interested users and developers could
follow the progress on the issue (and more easily find a description of the
issue if they encounter it).

Thanks,
Kevin</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>