[lldb-dev] [Bug 20687] New: lldb segfault on go program

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 16 16:44:30 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20687

            Bug ID: 20687
           Summary: lldb segfault on go program
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: tfarina at chromium.org
                CC: tfiala at google.com
    Classification: Unclassified

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 (http://llvm.org/git/lldb.git revision
3c9eeefb4022614373ca99f4e95cd869e6b965e4)

$ gdb --version
GNU gdb (GDB) 7.7

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140816/64683ebe/attachment.html>


More information about the lldb-dev mailing list