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

audio packets from anonymous clients result cause segmentation fault on server #37

Open
MichaelRenner opened this issue Apr 1, 2022 · 4 comments

Comments

@MichaelRenner
Copy link

Moin,

Server 1: Raspberry Pi 3 Model B Plus Rev 1.3 with Raspbian 11.3 and USB Logitech Headset (also tested with simple USB Sound Adapter)
Server 2: AMD64 Notebook with Debian 11 and internal Sound
Client: Ubuntu with pulseaudio
Nats-Server: 2.7.4 in the same network

Receiving is working fine.
As soon as a press the PTT button serverside remoteaudio crash:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x10028be]

goroutine 2131 [running]:
github.com/dh1tw/remoteAudio/audio/sources/pbReader.(*PbReader).Enqueue(0xc0002ff020, {0xc00003a948, 0x12, 0x12})
        /usr/src/myapp/audio/sources/pbReader/pbReader.go:144 +0x3be
github.com/dh1tw/remoteAudio/cmd.(*natsServer).enqueueFromWire(0xc0000ae0e0, {0x15b2d70, 0xc0001283f0})
        /usr/src/myapp/cmd/server_nats.go:395 +0x53
github.com/asim/go-micro/plugins/broker/nats/v3.(*natsBroker).Subscribe.func1(0xc00010eae0)
        /go/pkg/mod/github.com/asim/go-micro/plugins/broker/nats/v3@v3.7.0/nats.go:224 +0x2a9
github.com/nats-io/nats%2ego.(*Conn).waitForMsgs(0xc0003ae600, 0xc00032c180)
        /go/pkg/mod/github.com/nats-io/nats.go@v1.13.0/nats.go:2667 +0x442
created by github.com/nats-io/nats%2ego.(*Conn).subscribeLocked
        /go/pkg/mod/github.com/nats-io/nats.go@v1.13.0/nats.go:3882 +0x3f1

This happens in every combination (server / soundcard)

Server:
pi@alschain:~ $ remoteAudio server nats -Y "PuxingPX2R" -i 'Logitech USB Headset: Audio (hw:1,0)' -o 'Logitech USB Headset: Audio (hw:1,0)' -u hermes.fritz.box

Client:
renner@solaris:~$ remoteAudio client nats -Y "PuxingPX2R" -i 'pulse' -o 'pulse' -u hermes.fritz.box

I am lost. Any hint?

@dh1tw
Copy link
Owner

dh1tw commented Apr 1, 2022

Hi Michael,
just to be sure, have you updated both remoteAudio instances to the latest version (0.5.4)?

Tobias

@MichaelRenner
Copy link
Author

Hi Tobias,

actually on both devices the version was 0.5.4. Tested twice. Now I have installed version 0.5.3 on both computers - and the error does not occur. That's why I'm using this version now and I'm looking forward to version 0.5.5 ;-)
If I can help you with debugging: write me a DM.

vy 73 de Micha, DD0UL

dh1tw added a commit that referenced this issue Apr 4, 2022
For each user an Audio Codec is created on the fly with the first
received packet. The Protobuf Message contains a UserID field
which should be set by the client. The UserID is used to ensure
that the audio frames are correcty decoded and that simultaneously
received packets from multiple users are not mixed.
In case a packet with an empty UserID is received, the userID
will be set to 'unknown-client' and a warning is logged.
@dh1tw dh1tw changed the title panic: runtime error: invalid memory address or nil pointer dereference audio packets from anonymous clients result cause segmentation fault on server Apr 4, 2022
@dh1tw
Copy link
Owner

dh1tw commented Apr 4, 2022

I was able to reproduce and fix the problem. Should be solved with v0.5.5

@K6TD
Copy link

K6TD commented Apr 11, 2022

FWIW, I ran into this on 0.5.4, and found two fixes ...use 0.5.5, or fill in the user= parameter in the [NATS] section info the .remoteAudio.toml file.
Nice added benefit. When a user enables TX, the userid is sent to all clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants