<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 - [llvm-symbolizer] new pm regression, symbolization fails to recover line number with -ffunction-sections -gdwarf-aranges"
   href="https://bugs.llvm.org/show_bug.cgi?id=52187">52187</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[llvm-symbolizer] new pm regression, symbolization fails to recover line number with -ffunction-sections -gdwarf-aranges
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Tooling
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pierregousseau14@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=25367" name="attach_25367" title="use-after-scope-capture.cpp">attachment 25367</a> <a href="attachment.cgi?id=25367&action=edit" title="use-after-scope-capture.cpp">[details]</a></span>
use-after-scope-capture.cpp

Asan's test case use-after-scope-capture.cpp fails if -ffunction-sections
-gdwarf-aranges and new pm is enabled.

The test is failing as the stack trace does not contain line number anymore.
<span class="quote">>---------</span >
#include <functional>

int main() {
  std::function<int()> f;
  {
    int x = 0;
    f = [&x]() __attribute__((noinline)) {
      return x;  // BOOM
      // CHECK: ERROR: AddressSanitizer: stack-use-after-scope
      // CHECK: #0 0x{{.*}} in {{.*}}use-after-scope-capture.cpp:[[@LINE-2]]
    };
  }
  return f();  // BOOM
}
-----------<

llvm-symbolizer-output:
<span class="quote">>--------------------</span >
$ clang++ -ffunction-sections -gdwarf-aranges -gline-tables-only -O1
use-after-scope-capture.cpp && llvm-nm a.out --print-size -C | grep operator |
cut -d" " -f1 | sed 's/^/0x/' | xargs llvm-symbolizer -e a.out

main::$_0::operator()() const
use-after-scope-capture.cpp:0:0
-------------------<</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>