segmentation violation on net·*TCPListener·Accept

30 views
Skip to first unread message

JPascal

unread,
Dec 11, 2009, 5:50:53 AM12/11/09
to golang-nuts
SIGSEGV: segmentation violation
Faulting address: 0x0
PC=0xb7d6e338

0xb7d6e338 unknown pc

goroutine 664 [4]:
gosched+0x48 /home/jpascal/Go/src/pkg/runtime/proc.c:521
gosched()
chanrecv+0x125 /home/jpascal/Go/src/pkg/runtime/chan.c:345
chanrecv(0xb6d45780, 0xb7df1de8, 0x0, 0x1)
runtime·chanrecv1+0x4e /home/jpascal/Go/src/pkg/runtime/chan.c:415
runtime·chanrecv1(0xb6d45780, 0xb6c4dc80)
net·*pollServer·WaitRead+0x5f /home/jpascal/Go/src/pkg/net/fd.go:276
net·*pollServer·WaitRead(0xb7e05900, 0xb6c4dc80, 0x1)
net·*netFD·Read+0x24e /home/jpascal/Go/src/pkg/net/fd.go:384
net·*netFD·Read(0xb6c4dc80, 0xb6af19e8, 0x1, 0x1, 0x0, ...)
net·*TCPConn·Read+0x7a /home/jpascal/Go/src/pkg/net/tcpsock.go:92
net·*TCPConn·Read(0xb6af19c8, 0xb6af19e8, 0x1, 0x1, 0x0, ...)
gob·decodeUintReader+0x9b /home/jpascal/Go/src/pkg/gob/decode.go:49
gob·decodeUintReader(0xb7e3b000, 0xb6af19c8, 0xb6af19e8, 0x1,
0x1, ...)
gob·*Decoder·Decode+0x1da /home/jpascal/Go/src/pkg/gob/decoder.go:76
gob·*Decoder·Decode(0xb6b98e40, 0x8104bd0, 0xb6d6c3c0, 0xb6d6c3c0,
0xb7dea5a0, ...)
rpc·*serverType·input+0x115 /home/jpascal/Go/src/pkg/rpc/server.go:313
rpc·*serverType·input(0xb7de7980, 0xb7e05a40, 0xb6af19c8)
goexit /home/jpascal/Go/src/pkg/runtime/proc.c:135
goexit()
0xb7de7980 unknown pc

goroutine 2 [3]:
runtime·entersyscall+0x60 /home/jpascal/Go/src/pkg/runtime/proc.c:545
runtime·entersyscall()
syscall·Syscall6+0x5 /home/jpascal/Go/src/pkg/syscall/asm_linux_386.s:
40
syscall·Syscall6()
syscall·EpollWait+0x9d /home/jpascal/Go/src/pkg/syscall/
zsyscall_linux_386.go:132
syscall·EpollWait(0x6, 0xb6c05be0, 0x1, 0x1, 0xffffffff, ...)
net·*pollster·WaitFD+0x17c /home/jpascal/Go/src/pkg/net/fd_linux.go:
116
net·*pollster·WaitFD(0xb7daf7f8, 0x0, 0x0, 0x0, 0x0, ...)
net·*pollServer·Run+0x138 /home/jpascal/Go/src/pkg/net/fd.go:236
net·*pollServer·Run(0xb7e05900, 0x80f5114)
goexit /home/jpascal/Go/src/pkg/runtime/proc.c:135
goexit()
0xb7e05900 unknown pc

goroutine 1 [3]:
runtime·entersyscall+0x60 /home/jpascal/Go/src/pkg/runtime/proc.c:545
runtime·entersyscall()
syscall·socketcall+0x5 /home/jpascal/Go/src/pkg/syscall/
asm_linux_386.s:92
syscall·socketcall()
syscall·accept+0x66 /home/jpascal/Go/src/pkg/syscall/
syscall_linux_386.go:91
syscall·accept(0x3, 0xb7e56150, 0xb6a752d0, 0x0, 0x0, ...)
syscall·Accept+0x88 /home/jpascal/Go/src/pkg/syscall/syscall_linux.go:
301
syscall·Accept(0x3, 0x0, 0x0, 0x0, 0x0, ...)
net·*netFD·accept+0x104 /home/jpascal/Go/src/pkg/net/fd.go:507
net·*netFD·accept(0xb7db3380, 0x805c708, 0x0, 0x0, 0x0, ...)
net·*TCPListener·AcceptTCP+0xa1 /home/jpascal/Go/src/pkg/net/
tcpsock.go:253
net·*TCPListener·AcceptTCP(0xb7daf850, 0x0, 0x0, 0x0)
net·*TCPListener·Accept+0x36 /home/jpascal/Go/src/pkg/net/tcpsock.go:
263
net·*TCPListener·Accept(0xb7daf850, 0x0, 0x0, 0x0, 0x0, ...)
main·Demonize+0x2ba /home/jpascal/RedCase/redcasemgr.go:54
main·Demonize()
main·main+0x237 /home/jpascal/RedCase/redcasemgr.go:79
main·main()
mainstart+0xf /home/jpascal/Go/src/pkg/runtime/386/asm.s:81
mainstart()
goexit /home/jpascal/Go/src/pkg/runtime/proc.c:135
goexit()
eax 0x0
ebx 0x80c1688
ecx 0xb7e1a073
edx 0xb7decb90
edi 0xb6cbcc00
esi 0x2e
ebp 0xb7eaf32c
esp 0xb7d6e340
eip 0xb7d6e338
eflags 0x10286
cs 0x73
fs 0x0
gs 0x33
Trace/breakpoint trap



------------ redcasemgr.go ----------------
...
l, err := net.Listen("tcp", "127.0.0.1:3399");
if err != nil { syslog.Log("Can`t create listner: %v",err); }
else {
for true {
Line:54 ---> rw, err := l.Accept(); <--- Line:54
if err != nil {
syslog.Log("Accepc connection error:", err);
} else {
go rpc.ServeConn(rw);
}
}
l.Close();
}
...
------------ redcasemgr.go ----------------

I can not understand in what a problem.
After several attempts (5-10) of connections (between 1 seconds),
program took error "SIGSEGV: segmentation violation".

Ian Lance Taylor

unread,
Dec 11, 2009, 10:59:17 AM12/11/09
to JPascal, golang-nuts
JPascal <eshu...@gmail.com> writes:

> SIGSEGV: segmentation violation
> Faulting address: 0x0
> PC=0xb7d6e338

This is clearly a bug somewhere, but I don't know whether the bug is
in the Go code or in your program.

> main·Demonize+0x2ba /home/jpascal/RedCase/redcasemgr.go:54
> main·Demonize()

What does this function do? In Go you can't call fork and expect the
program to keep running. Yes, the issue of daemonization does need to
be addressed somehow.

Ian
Reply all
Reply to author
Forward
0 new messages