-
Notifications
You must be signed in to change notification settings - Fork 442
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
flood of recvfrom(udp): Bad address
#655
Comments
@enihcam it is difficult to know which argument of the recvmsg()/recvfrom() call is a bad address :( https://github.com/miniupnp/miniupnp/blob/master/miniupnpd/minissdp.c#L902 |
they all are stack buffers 🤔 |
I'm using archlinux, so the compile flags can be found here: |
the issue can be reproduced without using mimalloc or any memory allocators, so i guess it's probably not a memory management issue. |
As I said, all buffers passed to recvmsg() are on the stack, not on the heap. So that's really strange that it makes the error "Bad address" randomly :( |
looks like it was my newly installed DLNA server listening on the same UDP port as miniupnpd. ~ $ sudo ss -alnp | grep 1900
udp UNCONN 1855488 0 0.0.0.0:1900 0.0.0.0:* users:(("dms",pid=1165,fd=4))
udp UNCONN 0 0 0.0.0.0%br0:1900 0.0.0.0:* users:(("miniupnpd",pid=381,fd=5)) @miniupnp so what's the best practice (or your suggestion) for miniupnpd co-existing with local DLNA server? btw i also asked similar question at anacrolix/dms#122 |
my suggestion is using minissdpd. |
can i just use minissdpd without patching dms? |
I don't think so ;) But patching should not be so difficult ;) |
@enihcam is that dms ? https://github.com/anacrolix/dms |
@enihcam here is the patch : miniupnp/dms@b4b27b7 |
@enihcam can you test it ? If it is working, I will finish it (add configuration option for minissdpd socket path) and submit a Pull Request upstream. |
I'm out of town for few days. will update you asap. |
test result: auser@ahost /etc/systemd/system $ sudo systemctl status dms.service
● dms.service - DMS UPnP Media Server
Loaded: loaded (/etc/systemd/system/dms.service; disabled; preset: disabled)
Active: active (running) since Sat 2023-05-20 13:03:15 UTC; 1min 20s ago
Main PID: 3213 (dms)
CGroup: /system.slice/dms.service
└─3213 /usr/bin/dms -allowedIps 192.168.0.0/24 -fFprobeCachePath /tmp/dms-ffprobe-cache -friendlyName Movies -ifname lo -noProbe -noTranscode -path /home/auser/Share/
May 20 13:03:15 ahost dms[3213]: 2023/05/20 13:03:15 ffprobe and avprobe not found in $PATH
May 20 13:03:15 ahost dms[3213]: 2023-05-20T13:03:15+0000 NIL [main main.mainErr:170]: allowed ip nets are ["192.168.0.0/24"]
May 20 13:03:15 ahost dms[3213]: 2023-05-20T13:03:15+0000 NIL [main main.mainErr:171]: serving folder "/home/auser/Share"
May 20 13:03:15 ahost dms[3213]: 2023-05-20T13:03:15+0000 NIL [main.(*fFprobeCache).load:284]: added 0 items from cache
May 20 13:03:16 ahost dms[3213]: 2023-05-20T13:03:16+0000 NIL [main dms server github.com/anacrolix/dms/dlna/dms.(*Server).Init:1017]: HTTP srv on 0.0.0.0:1338
May 20 13:03:16 ahost dms[3213]: 2023-05-20T13:03:16+0000 NIL [main dms server ssdp lo github.com/anacrolix/dms/ssdp.(*Server).Init:196]: /var/run/minissdpd.sock
auser@ahost /etc/systemd/system $ sudo ss -alnp | grep 1900
udp UNCONN 0 0 0.0.0.0:1900 0.0.0.0:* users:(("dms",pid=3213,fd=7))
udp UNCONN 0 0 0.0.0.0%br0:1900 0.0.0.0:* users:(("miniupnpd",pid=386,fd=5)) and after few hours May 20 13:14:40 ahost miniupnpd[386]: upnp_event_process_notify: connect(192.168.0.117:286>
May 20 13:14:48 ahost miniupnpd[386]: upnp_event_process_notify: connect(192.168.0.117:286>
May 20 13:14:48 ahost miniupnpd[386]: upnpevents_processfds: 0x544f40b0480, remove subscri>
May 20 20:06:36 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:08:48 ahost miniupnpd[386]: remove port mapping 32135 UDP because it has expired
May 20 23:46:35 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:46:41 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:46:41 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:46:56 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:02 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:08 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:14 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:14 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:17 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:20 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:20 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:23 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:29 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:35 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:44 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:44 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:47:59 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:02 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:02 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:05 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:08 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:14 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:17 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:29 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:32 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:35 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:38 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:38 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:56 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:48:59 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:17 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:20 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:35 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:44 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:50 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:53 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:56 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:59 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:49:59 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:11 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:11 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:23 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:23 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:26 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:26 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:26 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:35 ahost miniupnpd[386]: recvfrom(udp): Bad address
May 20 23:50:38 ahost miniupnpd[386]: recvfrom(udp): Bad address
... |
@enihcam have you launched minissdpd BEFORE dms and miniupnpd ? |
ok, I'll start minissdpd at very beginning, take an observation again. |
seems good to me now. |
I often get flood
recvfrom(udp): Bad address
.then i turned on the debug flag and got this:
any suggestions? thanks.
The text was updated successfully, but these errors were encountered: