FAQ
I have a program like this:

package main

import (
"fmt"
"net"
"time"
)

func main() {
_, err := net.Listen("tcp", ":80")
if err != nil {
fmt.Println(err)
return
}
time.Sleep(1e12)
}

When I ran it twice, the second one printed error message "listen tcp
<nil>:80: Only one usage of ea..." , then hung up.
1-2 minutes after I killed it in taskmanager, it finally quitted.
There was no problem when I ran this kind of program ago.
I use windows 7(32bit) and golang 1.0.3.
Does anyone know what's going on here?
Thank you.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Itmitica at Jan 29, 2013 at 3:26 pm
    listen tcp <nil>:80: Only one usage of each socket address
    (protocol/network address/port) is normally permitted.

    It means there's already an app listening to that port: Skype, Apache
    httpd, nginx...

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at Jan 29, 2013 at 3:30 pm

    On Tue, Jan 29, 2013 at 11:09 PM, Jedy Wu wrote:

    I have a program like this:

    package main

    import (
    "fmt"
    "net"
    "time"
    )

    func main() {
    _, err := net.Listen("tcp", ":80")
    if err != nil {
    fmt.Println(err)
    return
    }
    time.Sleep(1e12)
    }

    When I ran it twice, the second one printed error message "listen tcp
    <nil>:80: Only one usage of ea..." , then hung up.
    1-2 minutes after I killed it in taskmanager, it finally quitted.
    There was no problem when I ran this kind of program ago.
    I use windows 7(32bit) and golang 1.0.3.
    Does anyone know what's going on here?
    Thank you.
    I can't reproduce the hung with either go1.0.3 and tip on windows/386.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jedy Wu at Jan 29, 2013 at 3:44 pm
    I think it maybe conflicts with other programs, because there was no such
    problem weeks ago.
    But now even in safe mode, it hung up.
    Do you have any idea how to debug or trace?

    在 2013年1月29日星期二UTC+8下午11时30分12秒,minux写道:

    On Tue, Jan 29, 2013 at 11:09 PM, Jedy Wu <jed...@gmail.com <javascript:>>wrote:
    I have a program like this:

    package main

    import (
    "fmt"
    "net"
    "time"
    )

    func main() {
    _, err := net.Listen("tcp", ":80")
    if err != nil {
    fmt.Println(err)
    return
    }
    time.Sleep(1e12)
    }

    When I ran it twice, the second one printed error message "listen tcp
    <nil>:80: Only one usage of ea..." , then hung up.
    1-2 minutes after I killed it in taskmanager, it finally quitted.
    There was no problem when I ran this kind of program ago.
    I use windows 7(32bit) and golang 1.0.3.
    Does anyone know what's going on here?
    Thank you.
    I can't reproduce the hung with either go1.0.3 and tip on windows/386.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at Jan 29, 2013 at 4:08 pm

    On Tue, Jan 29, 2013 at 11:39 PM, Jedy Wu wrote:

    I think it maybe conflicts with other programs, because there was no such
    problem weeks ago.
    But now even in safe mode, it hung up.
    you mean the safe mode of windows?
    Do you have any idea how to debug or trace?
    perhaps your anti-virus/firewall software don't like that program.

    you can try gdb the program, and press ^C when the program hangs,
    then use "thread apply all bt" to view what the program is doing at
    that time.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jedy Wu at Jan 29, 2013 at 4:26 pm
    Yes, safe mode of windows, so no anti-virus or firewall.
    And I tried gdb, two kind of results.
    1.
    (gdb) run
    Starting program: d:\server.exe
    [New Thread 1056.0x13f8]
    [New Thread 1056.0x790]
    listen tcp <nil>:9000: Only one usage of each socket address
    (protocol/network a
    ddress/port) is normally permitted.

    Program exited normally.
    (gdb) q

    gdb said it exited, but in taskmanager the process was still there .

    2.
    (gdb) run
    Starting program: d:\server.exe
    [New Thread 512.0x1628]
    [New Thread 512.0x764]
    listen tcp <nil>:9000: Only one usage of each socket address
    (protocol/network a
    ddress/port) is normally permitted.

    Process didn't quit, ^C had no response.

    在 2013年1月30日星期三UTC+8上午12时00分12秒,minux写道:

    On Tue, Jan 29, 2013 at 11:39 PM, Jedy Wu <jed...@gmail.com <javascript:>>wrote:
    I think it maybe conflicts with other programs, because there was no such
    problem weeks ago.
    But now even in safe mode, it hung up.
    you mean the safe mode of windows?
    Do you have any idea how to debug or trace?
    perhaps your anti-virus/firewall software don't like that program.

    you can try gdb the program, and press ^C when the program hangs,
    then use "thread apply all bt" to view what the program is doing at
    that time.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jedy at Jan 29, 2013 at 4:44 pm
    It's not just go. A python program has the same problem.
    I should fix my system.
    Thank you, minux.

    On Wed, Jan 30, 2013 at 12:26 AM, Jedy Wu wrote:

    Yes, safe mode of windows, so no anti-virus or firewall.
    And I tried gdb, two kind of results.
    1.
    (gdb) run
    Starting program: d:\server.exe
    [New Thread 1056.0x13f8]
    [New Thread 1056.0x790]
    listen tcp <nil>:9000: Only one usage of each socket address
    (protocol/network a
    ddress/port) is normally permitted.

    Program exited normally.
    (gdb) q

    gdb said it exited, but in taskmanager the process was still there .

    2.
    (gdb) run
    Starting program: d:\server.exe
    [New Thread 512.0x1628]
    [New Thread 512.0x764]
    listen tcp <nil>:9000: Only one usage of each socket address
    (protocol/network a
    ddress/port) is normally permitted.

    Process didn't quit, ^C had no response.

    在 2013年1月30日星期三UTC+8上午12时00分12秒,minux写道:
    On Tue, Jan 29, 2013 at 11:39 PM, Jedy Wu wrote:

    I think it maybe conflicts with other programs, because there was no
    such problem weeks ago.
    But now even in safe mode, it hung up.
    you mean the safe mode of windows?
    Do you have any idea how to debug or trace?
    perhaps your anti-virus/firewall software don't like that program.

    you can try gdb the program, and press ^C when the program hangs,
    then use "thread apply all bt" to view what the program is doing at
    that time.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 29, '13 at 3:09p
activeJan 29, '13 at 4:44p
posts7
users3
websitegolang.org

3 users in discussion

Jedy: 4 posts Minux: 2 posts Itmitica: 1 post

People

Translate

site design / logo © 2021 Grokbase