<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 --- - lldb segfault on go program"
href="http://llvm.org/bugs/show_bug.cgi?id=20687">20687</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb segfault on go program
</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>Severity</th>
<td>normal
</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@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tfarina@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>tfiala@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I just tried debugging a small go program it segfaulted very easily. gdb worked
fine though.
$ cat flag_parse.go
package main
import (
"flag"
)
func main() {
flag.Parse()
}
$ go build flag_parse.go
$ ~/llvm/build/bin/lldb flag_parse
(lldb) target create "flag_parse"
Current executable set to 'flag_parse' (x86_64).
(lldb) b main.main
Breakpoint 1: where = flag_parse`main.main + 21 at flag_parse.go:8, address =
0x0000000000400c15
(lldb) r
Process 18936 launching
Process 18936 stopped
* thread #1: tid = 18936, 0x0000000000421c05 flag_parse`_rt0_amd64_linux + 5 at
rt0_linux_amd64.s:9, name = 'flag_parse'
frame #0: 0x0000000000421c05 flag_parse`_rt0_amd64_linux + 5 at
rt0_linux_amd64.s:9
6
7 TEXT _rt0_amd64_linux(SB),NOSPLIT,$-8
8 LEAQ 8(SP), SI // argv
-> 9 MOVQ 0(SP), DI // argc
10 MOVQ $main(SB), AX
11 JMP AX
12
Process 18936 launched:
'/home/tfarina/src/repos/github.com/tfarina/rsc/go/flag_parse' (x86_64)
(lldb) Process 18936 stopped
* thread #1: tid = 18936, 0x0000000000400c15 flag_parse`main.main + 21 at
flag_parse.go:8, name = 'flag_parse', stop reason = breakpoint 1.1
frame #0: 0x0000000000400c15 flag_parse`main.main + 21 at flag_parse.go:8
5 )
6
7 func main() {
-> 8 flag.Parse()
9 }
s
(lldb) Process 18936 stopped
* thread #1: tid = 18936, 0x0000000000425619 flag_parse`flag.Parse + 25 at
flag.go:820, name = 'flag_parse', stop reason = step in
frame #0: 0x0000000000425619 flag_parse`flag.Parse + 25 at flag.go:820
817 // after all flags are defined and before flags are accessed by the
program.
818 func Parse() {
819 // Ignore errors; CommandLine is set for ExitOnError.
-> 820 CommandLine.Parse(os.Args[1:])
821 }
822
823 // Parsed returns true if the command-line flags have been parsed.
s
Segmentation fault (core dumped)
$ ~/llvm/build/bin/lldb --version
lldb version 3.6.0 (<a href="http://llvm.org/git/lldb.git">http://llvm.org/git/lldb.git</a> revision
3c9eeefb4022614373ca99f4e95cd869e6b965e4)
$ gdb --version
GNU gdb (GDB) 7.7</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>