<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 - lldb-trunk crash on a file compiled with clang-3.7 under O2"
   href="https://bugs.llvm.org/show_bug.cgi?id=41466">41466</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb-trunk crash on a file compiled with clang-3.7 under O2
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Keywords</th>
          <td>wrong-debug
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yuanboli233@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>davide@freebsd.org, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>lldb-trunk crashed when debugging for an executable generated by clang-3.7.
The same issue happens for clang-3.8/4/5/6/7/8/trunk as well. The executable
generated by clang-3.0 will not cause lldb-trunk to crash.

$ lldb-trunk -v
lldb version 9.0.0 (<a href="https://llvm.org/svn/llvm-project/lldb/trunk">https://llvm.org/svn/llvm-project/lldb/trunk</a> revision
355785)
  clang revision 355785
  llvm revision 355785


$ cat abc.c
int a;
void b() {
  unsigned c = 5;
  {
    int d[1] = {};
    a = 0;
  }
}
int main() {
  int e;
  optimize_me_not();
  b();
}



$ cat outer.c 
optimize_me_not() {}



$ cat cmds 
b 11
r
p e
kill
q


$ clang-3.7 -O2 -g abc.c outer.c 

$ lldb-trunk -s cmds -b a.out 
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) command source -s 0 'cmds'
Executing commands in '/home/ybli/Projects/LLDB-testing/reduce/cmds'.
(lldb) b 11
Breakpoint 1: where = a.out`main + 3 at abc.c:11:3, address =
0x00000000004004a3
(lldb) r
a.out was compiled with optimization - stepping may behave oddly; variables may
not be available.
lldb-trunk(+0x25d6a)[0x558fb7c06d6a]
lldb-trunk(+0x24094)[0x558fb7c05094]
lldb-trunk(+0x241d2)[0x558fb7c051d2]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7ff2ebb9d890]
/lib/x86_64-linux-gnu/libc.so.6(+0x18ec40)[0x7ff2e3c9ec40]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x10700d1)[0x7ff2e5ada0d1]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xeb30b7)[0x7ff2e591d0b7]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x138cda9)[0x7ff2e5df6da9]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x138daf4)[0x7ff2e5df7af4]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x138dbb7)[0x7ff2e5df7bb7]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x138dbb7)[0x7ff2e5df7bb7]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x138e880)[0x7ff2e5df8880]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xf72b12)[0x7ff2e59dcb12]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xf291be)[0x7ff2e59931be]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe19504)[0x7ff2e5883504]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe18aa1)[0x7ff2e5882aa1]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe18aa1)[0x7ff2e5882aa1]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe18b57)[0x7ff2e5882b57]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfefb18)[0x7ff2e5a59b18]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfefe40)[0x7ff2e5a59e40]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xff6aea)[0x7ff2e5a60aea]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x1023910)[0x7ff2e5a8d910]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfd4480)[0x7ff2e5a3e480]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfd4c6f)[0x7ff2e5a3ec6f]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfd4f00)[0x7ff2e5a3ef00]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xfd6637)[0x7ff2e5a40637]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x10139dd)[0x7ff2e5a7d9dd]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x2787aa8)[0x7ff2e71f1aa8]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xefa019)[0x7ff2e5964019]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xef3bca)[0x7ff2e595dbca]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xef4e88)[0x7ff2e595ee88]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe2fdd1)[0x7ff2e5899dd1]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xdf8c0f)[0x7ff2e5862c0f]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xee942b)[0x7ff2e595342b]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0x2743b31)[0x7ff2e71adb31]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xefa019)[0x7ff2e5964019]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xef3bca)[0x7ff2e595dbca]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xef4e88)[0x7ff2e595ee88]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xe2fdd1)[0x7ff2e5899dd1]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xdf7abb)[0x7ff2e5861abb]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(+0xee7715)[0x7ff2e5951715]
/home/absozero/trunk/root-clang/bin/../lib/liblldb.so.9svn(_ZN4lldb10SBDebugger21RunCommandInterpreterEbbRNS_30SBCommandInterpreterRunOptionsERiRbS4_+0x67c)[0x7ff2e546004c]
lldb-trunk(+0xafc5)[0x558fb7bebfc5]
lldb-trunk(+0x8736)[0x558fb7be9736]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7ff2e3b31b97]
lldb-trunk(+0x9b3a)[0x558fb7beab3a]
Stack dump:
0.      Program arguments: lldb-trunk -s cmds -b a.out 
Segmentation fault (core dumped)</pre>
        </div>
      </p>


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

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>