Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when From number cannot be parsed #199

Open
AutoScrape123TX opened this issue Oct 12, 2024 · 4 comments
Open

Panic when From number cannot be parsed #199

AutoScrape123TX opened this issue Oct 12, 2024 · 4 comments
Assignees
Labels
bug Something isn't working SIP

Comments

@AutoScrape123TX
Copy link

The SIP server is flooded by bots.

Just got an exceptional segmentation violation :

2024/10/12 12:57:08 INFO skip header due to error line="From: \"sip911\"<b0119:[email protected]>;tag=3864356534373562313363340132353633393730333938" err="strconv.Atoi: parsing \"[email protected]\": invalid syntax"
2024/10/12 12:57:08 INFO skip header due to error line="To: \"sip911\"<b0119:[email protected]>" err="strconv.Atoi: parsing \"[email protected]\": invalid syntax"
2024-10-12T12:57:08.437Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_vmnKXM8D7joq"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0xf1a3bc]

goroutine 1421 [running]:
github.com/emiago/sipgo/sip.NewResponseFromRequest(0xc0003b6c40, 0x195, {0x13361da, 0x12}, {0x0, 0x0, 0x0})
        /root/go/pkg/mod/github.com/livekit/[email protected]/sip/response.go:225 +0x5bc
github.com/emiago/sipgo.(*Server).defaultUnhandledHandler(0xc0002ab4f0, 0xc0003b6c40, {0x0?, 0xc000392a90?})
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:354 +0x7a
github.com/emiago/sipgo.(*Server).handleRequest(0xc0002ab4f0, 0xc0003b6c40, {0x14ddc40, 0xc0003c6800})
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:235 +0xc9
created by github.com/emiago/sipgo.(*Server).onRequest in goroutine 82
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:225 +0x8f
@davidzhao
Copy link
Member

hi, can you share which version you are running?

@AutoScrape123TX
Copy link
Author

I was at this commit id 49e84c7

I compile from source.

commit 49e84c723b01eea91ff7d00d5bfb2effc8fbf74e (HEAD -> main, origin/main, origin/HEAD)
Author: David Colburn <[email protected]>
Date:   Thu Oct 3 15:16:02 2024 -0700

    Add inbound media processors (#185)
    
    * add inbound media processors
    
    * fix test handler
    
    * dispatch EnabledFeatures
    
    * add copyright
    
    * updates
    
    * update processor
    
    * fix handler
    
    * update protocol
    
    * merge main

@AutoScrape123TX
Copy link
Author

Again with last commit id 2fa5c7a

2024-10-15T07:55:06.759Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.760Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.769Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.775Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.780Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.792Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.808Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.824Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:06.827Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024-10-15T07:55:12.585Z        INFO    sip     hwstats/cpu.go:112      high cpu load   {"nodeID": "NE_wXXzgu5M4n2V", "load": 0.9122997374531788}
2024-10-15T07:55:14.293Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
2024/10/15 07:55:31 INFO skip header due to error line="From: \"sip911\"<b0119:[email protected]>;tag=3864356534373562313363340133303934383932333231" err="strconv.Atoi: parsing \"[email protected]\": invalid syntax"
2024/10/15 07:55:31 INFO skip header due to error line="To: \"sip911\"<b0119:[email protected]>" err="strconv.Atoi: parsing \"[email protected]\": invalid syntax"
2024-10-15T07:55:31.782Z        WARN    [email protected]/server.go:353       SIP request handler not found   {"nodeID": "NE_wXXzgu5M4n2V"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0xf19f7c]

goroutine 37522 [running]:
github.com/emiago/sipgo/sip.NewResponseFromRequest(0xc00043bea0, 0x195, {0x13391e2, 0x12}, {0x0, 0x0, 0x0})
        /root/go/pkg/mod/github.com/livekit/[email protected]/sip/response.go:225 +0x5bc
github.com/emiago/sipgo.(*Server).defaultUnhandledHandler(0xc0002aae60, 0xc00043bea0, {0xc0006d8788?, 0xc0001368f0?})
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:354 +0x7a
github.com/emiago/sipgo.(*Server).handleRequest(0xc0002aae60, 0xc00043bea0, {0x14e1040, 0xc000139c00})
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:235 +0xc9
created by github.com/emiago/sipgo.(*Server).onRequest in goroutine 68
        /root/go/pkg/mod/github.com/livekit/[email protected]/server.go:225 +0x8f

@dennwc dennwc self-assigned this Oct 16, 2024
@dennwc dennwc added the bug Something isn't working label Oct 16, 2024
@dennwc
Copy link
Contributor

dennwc commented Oct 16, 2024

Confirmed, but needs sipgo update to fix, which is a bit complicated at the moment.

@dennwc dennwc changed the title Exceptional - SIGSEGV: segmentation violation Panic when From number cannot be parsed Oct 16, 2024
@linear linear bot added the SIP label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SIP
Projects
None yet
Development

No branches or pull requests

3 participants