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

Server keeps crashing. #89

Open
raidolo opened this issue Feb 16, 2022 · 14 comments
Open

Server keeps crashing. #89

raidolo opened this issue Feb 16, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@raidolo
Copy link

raidolo commented Feb 16, 2022

Hi,

I'm using Home Assistant and the RTPStoWebRTC addon.

I'm using a simple Sricam RTSP camera:

camera:
  - platform: generic
    name: Sricam
    stream_source: rtsp://192.168.1.50/onvif1

The RTSPWeb server keeps crashing when I open the stream from the RTSPtoWebRTC integration in HA.

Any advice?

Here is the log from the addon, at end you can see the RTSPWeb crash:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[14:04:02] INFO: Starting discovery service
[14:04:02] INFO: Starting RSTPtoWebRTC
time="2022-02-16T14:04:02+01:00" level=info msg="Server CORE start" func=main module=main
time="2022-02-16T14:04:02+01:00" level=info msg="Server RTSP start" call=Start func=RTSPServer module=rtsp_server
time="2022-02-16T14:04:02+01:00" level=info msg="Server HTTP start" call=Start func=RTSPServer module=http_server
time="2022-02-16T14:04:02+01:00" level=info msg="Server start success a wait signals" func=main module=main
[14:04:03] INFO: Successfully send discovery information to Home Assistant.
time="2022-02-16T14:04:18+01:00" level=error msg="stream not found" call=StreamChannelExist channel=0 func=HTTPAPIServerStreamHLSM3U8 module=http_hls stream=camera.sricam
time="2022-02-16T14:04:19+01:00" level=error msg="stream not found" call=StreamChannelExist channel=0 func=HTTPAPIServerStreamHLSM3U8 module=http_hls stream=camera.sricam
time="2022-02-16T14:04:49+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:51+01:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.sricam
time="2022-02-16T14:04:51+01:00" level=error msg="Stream error restart stream stream stop rtsp signal" call=Restart
time="2022-02-16T14:04:51+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:53+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:53+01:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.sricam
time="2022-02-16T14:04:53+01:00" level=error msg="Stream error restart stream stream stop rtsp signal" call=Restart
time="2022-02-16T14:04:54+01:00" level=error msg="Stream error restart stream read tcp 192.168.1.30:53574->192.168.1.50:554: read: connection reset by peer" call=Restart
time="2022-02-16T14:04:55+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:56+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:57+01:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.sricam
time="2022-02-16T14:04:57+01:00" level=error msg="Stream error restart stream stream stop rtsp signal" call=Restart
time="2022-02-16T14:04:58+01:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.sricam
time="2022-02-16T14:04:59+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:04:59+01:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.sricam
time="2022-02-16T14:05:01+01:00" level=error msg="stream no video" call=ErrorStreamNoVideo channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=camera.sricam
time="2022-02-16T14:05:28+01:00" level=error msg="WebRTC Client Offline" call=WritePacket channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=camera.sricam
time="2022-02-16T14:05:37+01:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
time="2022-02-16T14:05:37+01:00" level=info msg="Stream exit by signal or not client" call=StreamServerRunStream channel=0 func=StreamServerRunStreamDo module=core stream=camera.sricam
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xba062b]
goroutine 53 [running]:
main.(*MuxerHLS).SetFPS(...)
	/build/github.com/deepch/RTSPtoWeb/hlsMuxer.go:43
main.(*StorageST).HlsMuxerSetFPS(0xc000434000, 0xc00035657d, 0xd, 0x12a7380, 0x1, 0xf)
	/build/github.com/deepch/RTSPtoWeb/storageStreamChannel.go:353 +0x20b
main.StreamServerRunStream(0xc00035657d, 0xd, 0x12a7380, 0x1, 0xc0000c28f0, 0x0, 0x0, 0x0)
	/build/github.com/deepch/RTSPtoWeb/streamCore.go:173 +0xa98
main.StreamServerRunStreamDo(0xc00035657d, 0xd, 0x12a7380, 0x1)
	/build/github.com/deepch/RTSPtoWeb/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamAdd
	/build/github.com/deepch/RTSPtoWeb/storageStream.go:35 +0x3bf
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
@deepch deepch closed this as completed in 7beb35a Feb 16, 2022
@deepch
Copy link
Owner

deepch commented Feb 16, 2022

try update

@deepch deepch self-assigned this Feb 16, 2022
@deepch deepch added the bug Something isn't working label Feb 16, 2022
@raidolo
Copy link
Author

raidolo commented Feb 20, 2022

The addon was updated with the latest version of RTSPtoWeb but I still got the segfault. The stream appears for few seconds then RTSPtoWeb crashes.

[14:51:47] INFO: Successfully send discovery information to Home Assistant (8083).
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb94673]
goroutine 101 [running]:
main.(*MuxerHLS).WritePacket(0x0, 0xc0011c9780)
	/workspace/hlsMuxer.go:48 +0x33
main.(*StorageST).HlsMuxerWritePacket(0xc0000320f0, 0xc000038f3d, 0xd, 0x12af380, 0x1, 0xc0011c9780)
	/workspace/storageStreamChannel.go:366 +0x1f9
main.StreamServerRunStream(0xc000038f3d, 0xd, 0x12af380, 0x1, 0xc0000e0370, 0x0, 0x0, 0x0)
	/workspace/streamCore.go:173 +0xb09
main.StreamServerRunStreamDo(0xc000038f3d, 0xd, 0x12af380, 0x1)
	/workspace/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamEdit
	/workspace/storageStream.go:65 +0x5ff
[cont-finish.d] executing container finish scripts...

@deepch
Copy link
Owner

deepch commented Feb 20, 2022

share you camera and send me rtsp url

@deepch deepch reopened this Feb 20, 2022
@deepch
Copy link
Owner

deepch commented Feb 20, 2022

check add-on version it fix it crash

7beb35a

@deepch
Copy link
Owner

deepch commented Feb 20, 2022

@allenporter you can check?

@allenporter
Copy link
Collaborator

Yes, that fix was included, and it appears to hit a similar error a little bit later in the code. I can try just adding a similar chek on this function too.

@raidolo
Copy link
Author

raidolo commented Feb 20, 2022

share you camera and send me rtsp url

Hi, I really can't disable audio or set the visitor password on this thing, I can't share the stream securely....I'm sorry. Is there another way?

@allenporter
Copy link
Collaborator

I've updated the add-on to version 1.2.0, which includes RTSPtoWeb 2.1.0 which includes this fix. (though it may take a few moments to build the docker image)

@allenporter
Copy link
Collaborator

Assigning to raidolo to verify the results

@mrulrich1
Copy link

mrulrich1 commented Feb 21, 2022

I'm running 1.2.0 of the addon and also experiencing the server crashing. My log looks a bit different so let me know if it's best to open a new issue:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb9b686]
goroutine 17190 [running]:
main.(*Segment).WritePacket(0x0, 0xc0046d1340)
/workspace/hlsSegment.go:44 +0x26
main.(*MuxerHLS).WritePacket(0xc000128600, 0xc0046d1340)
/workspace/hlsMuxer.go:62 +0x1bd
main.(*StorageST).HlsMuxerWritePacket(0xc0004144e0, 0xc0003cdadd, 0x12, 0x12b73c0, 0x1, 0xc0046d1340)
/workspace/storageStreamChannel.go:377 +0x205
main.StreamServerRunStream(0xc0003cdadd, 0x12, 0x12b73c0, 0x1, 0xc001608370, 0x0, 0x0, 0x0)
/workspace/streamCore.go:173 +0xb09
main.StreamServerRunStreamDo(0xc0003cdadd, 0x12, 0x12b73c0, 0x1)
/workspace/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamEdit
/workspace/storageStream.go:65 +0x5ff
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

@raidolo
Copy link
Author

raidolo commented Feb 21, 2022

Still got the issue with latest 1.2.0 addon....

[23:04:02] INFO: Successfully send discovery information to Home Assistant (8083).
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb9b686]
goroutine 73 [running]:
main.(*Segment).WritePacket(0x0, 0xc00069e900)
	/workspace/hlsSegment.go:44 +0x26
main.(*MuxerHLS).WritePacket(0xc000368d80, 0xc00069e900)
	/workspace/hlsMuxer.go:62 +0x1bd
main.(*StorageST).HlsMuxerWritePacket(0xc00039c9c0, 0xc0000381ed, 0xd, 0x12b73c0, 0x1, 0xc00069e900)
	/workspace/storageStreamChannel.go:377 +0x205
main.StreamServerRunStream(0xc0000381ed, 0xd, 0x12b73c0, 0x1, 0xc0000e1290, 0x0, 0x0, 0x0)
	/workspace/streamCore.go:173 +0xb09
main.StreamServerRunStreamDo(0xc0000381ed, 0xd, 0x12b73c0, 0x1)
	/workspace/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamAdd
	/workspace/storageStream.go:35 +0x3bf
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

@allenporter
Copy link
Collaborator

Addon 1.2.1 contains an additional fix. Can you also give that a try? I don't have an easy way to reproduce this, so it seems like it requires patching and testing so I really appreciate your help.

@mrulrich1
Copy link

installed 1.2.1, same result with the following logs:

[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb9b686]
goroutine 98 [running]:
main.(*Segment).WritePacket(0x0, 0xc00172e680)
	/workspace/hlsSegment.go:44 +0x26
main.(*MuxerHLS).WritePacket(0xc0008f2280, 0xc00172e680)
	/workspace/hlsMuxer.go:62 +0x1bd
main.(*StorageST).HlsMuxerWritePacket(0xc0004944e0, 0xc0000a4a5d, 0x12, 0x12b73c0, 0x1, 0xc00172e680)
	/workspace/storageStreamChannel.go:377 +0x205
main.StreamServerRunStream(0xc0000a4a5d, 0x12, 0x12b73c0, 0x1, 0xc0000c4840, 0x0, 0x0, 0x0)
	/workspace/streamCore.go:173 +0xb09
main.StreamServerRunStreamDo(0xc0000a4a5d, 0x12, 0x12b73c0, 0x1)
	/workspace/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamEdit
	/workspace/storageStream.go:65 +0x5ff
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

@raidolo
Copy link
Author

raidolo commented Feb 22, 2022

Same here, 1.2.1 with latest RTSPToWeb

I can say that when I try to start the stream in the Lovelace card, I can see it in RTSPtoWeb UI and I can change between the various methods, MSE and HLS are way behind, like then seconds delay, WebRTC has less delay.
After few seconds while having the Lovelace card opened (Picture Glance with the camera entity) the RTSPtoWeb crashes...

[09:42:14] INFO: Successfully send discovery information to Home Assistant (8083).
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb9b686]
goroutine 65 [running]:
main.(*Segment).WritePacket(0x0, 0xc000aef480)
	/workspace/hlsSegment.go:44 +0x26
main.(*MuxerHLS).WritePacket(0xc000612400, 0xc000aef480)
	/workspace/hlsMuxer.go:62 +0x1bd
main.(*StorageST).HlsMuxerWritePacket(0xc0003eab60, 0xc0000a4f6d, 0xd, 0x12b73c0, 0x1, 0xc000aef480)
	/workspace/storageStreamChannel.go:377 +0x205
main.StreamServerRunStream(0xc0000a4f6d, 0xd, 0x12b73c0, 0x1, 0xc000134840, 0x0, 0x0, 0x0)
	/workspace/streamCore.go:173 +0xb09
main.StreamServerRunStreamDo(0xc0000a4f6d, 0xd, 0x12b73c0, 0x1)
	/workspace/streamCore.go:43 +0x4fa
created by main.(*StorageST).StreamAdd
	/workspace/storageStream.go:35 +0x3bf
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants