philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.53k stars 218 forks source link

Core dump aircast 0.2.50.2 #335

Closed eizedev closed 3 years ago

eizedev commented 3 years ago

Hi @philippe44

just want to release the new version 0.2.50.2 of airupnp and aircast in the AirConnect-Synology package and realized that aircast core dumped.

Using 0.2.50.2 - x86-64 (linux build). 0.2.50.1 is working.

/volume1/@appstore/AirConnect/aircast -d all=sdebug
[15:09:12.796217] main:974 Starting aircast version: v0.2.50.2 (Mar 12 2021 @ 17:48:15)
[15:09:12.796547] main:982 no config file, using defaults
[15:09:12.796776] Start:732 Binding to 192.168.1.10
Segmentation fault (core dumped)

Error:

2021-03-13T15:10:22+01:00 Magicbox kernel: [6978563.995017] aircast[23653]: segfault at 0 ip           (null) sp 00007ffddb036d38 error 14 in aircast[400000+8c000]
2021-03-13T15:10:22+01:00 Magicbox coredump: Process aircast[23653] dumped core on signal [11].

btw. i cannot add --noflush, aircast will show the help output. noflush is working in airupnp (not implemented in aircast?)

/volume1/@appstore/AirConnect/aircast --noflush
v0.2.50.2 (Mar 12 2021 @ 17:48:15)
See -t for license terms
Usage: [options]
  -b <ip>       network address to bind to
  -a <port>[:<count>]   set inbound port and range for RTP and HTTP
  -c <mp3[:<rate>]|flc[:0..9]|wav>  audio format send to player
  -v <0..1>      group MediaVolume factor
  -x <config file>  read config from file (default is ./config.xml)
  -i <config file>  discover players, save <config file> and exit
  -I            auto save config at every network scan
  -l <[rtp][:http][:f]> RTP and HTTP latency (ms), ':f' forces silence fill
  -r            let timing reference drift (no click)
  -f <logfile>      Write debug to logfile
  -p <pid file>     write PID in file
  -d <log>=<level>  Set logging level, logs: all|raop|main|util|cast, level: error|warn|info|debug|sdebug
  -z            Daemonize
  -Z            NOT interactive
  -k            Immediate exit on SIGQUIT and SIGTERM
  -t            License terms
  --noflush     ignore flush command (wait for teardown to stop)

Build options: LINUX

Edit: Is it a good idea to add --noflush to the default parameters or does it have any side effects in some environments?

Currently i am using the following command line for starting airupnp in the package for Synology devices:

/volume1/@appstore/AirConnect/airupnp -b 192.168.1.10:49154 -l 1000:2000 -x '/volume1/@appstore/AirConnect/config.xml' -o '<NULL>,S1,S3,S5,S9,S12,ZP80,ZP90,S15,ZP100,ZP120,1.0,LibreWireless' -z -f '/var/log/airconnect.log' -d all=info --noflush

thanks, René

philippe44 commented 3 years ago

The --noflush was an oversight that I corrected in 0.2.50.3 but before I pushed that, can you try the x64 version on any other x64 machine with the same configuration file? I don't have crash on my Linux Ubuntu 20.4 machine I do not recommend using --noflush by default, it likely has side effects that I've not seen yet

eizedev commented 3 years ago

Thanks. i am currently not using a configuration file or any other options, i am just running aircast "as it is" for testing.

I have also tested 0.2.50.2 on an x86 nas system (Intel(R) Atom(TM) CPU CE5335, kernel 3.2.40) and there aircast also does not start up (core dump - kernel: [15654250.295244] aircast-x86[23160]: segfault at 0 ip (null) sp bfa4163c error 4 in aircast-x86[8048000+9c000]). (wget https://github.com/philippe44/AirConnect/raw/master/bin/aircast-x86; chmod +x aircast-x86; ./aircast-x86) 0.2.50.1 is also working there.

My primary nas on which aircast 0.2.50.2 is not working, has cpu Intel(R) Atom(TM) CPU C2538 and kernel 3.10.105.

Also tried on my macbook pro (aircast-osx-multi), same behavior and problem.

On a Debian 10.8 (Intel(R) Xeon(R) Gold 6230R) it is working and aircast is running.

Edit: Also tested the arm version on my synology router (ARMv7 Processor rev 0 (v7l) - kernel 4.4.60), also core dump

philippe44 commented 3 years ago

okay, so I might have again a build problem. Let me try that

philippe44 commented 3 years ago

Can you try 0.2.50.3? I've not tagged it but it's a full rebuild

eizedev commented 3 years ago

Same problem:

image

kernel: [7009531.934065] aircast-x86-64[17767]: segfault at 0 ip           (null) sp 00007ffc8beec8d8 error 14 in aircast-x86-64[400000+8c000]
2021-03-13T23:46:12+01:00 Magicbox coredump: Process aircast-x86-64[17767] dumped core on signal [11].
philippe44 commented 3 years ago

Crap - that version has debug symbols. Can you try it with gdb? aircast-x86-64.zip

(use --args if you want to add args aircast and aircast itself must part of the --args command, not appear before)

eizedev commented 3 years ago

i have some problems running gdb on my synology nas. Need to investigate that, give me a few minutes (gdb starts if running gdb --args airconnect-x86-64, but then i need to kill that process because i cannot do anything). But i think this is a synology problem, their OS is really cropped).

For the meantime i used strace to start aircast. The core dump occurs after loading lilbssl.so if i am correct?

execve("./aircast-x86-64", ["./aircast-x86-64"], [/* 23 vars */]) = 0
brk(0)                                  = 0xf76000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de56000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7ffd970a58a0) = -1 ENOENT (No such file or directory)
open("/lib/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls", 0x7ffd970a58a0)        = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7ffd970a58a0)     = -1 ENOENT (No such file or directory)
open("/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p`\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=97800, ...}) = 0
mmap(NULL, 2208976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66da1b000
mprotect(0x7fc66da32000, 2093056, PROT_NONE) = 0
mmap(0x7fc66dc31000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fc66dc31000
mmap(0x7fc66dc33000, 13520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc66dc33000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=14672, ...}) = 0
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66d817000
mprotect(0x7fc66d81a000, 2093056, PROT_NONE) = 0
mmap(0x7fc66da19000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fc66da19000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000U\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=1067376, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de55000
mmap(NULL, 3162456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66d512000
mprotect(0x7fc66d615000, 2097152, PROT_NONE) = 0
mmap(0x7fc66d815000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x103000) = 0x7fc66d815000
close(3)                                = 0
open("/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\"\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=31688, ...}) = 0
mmap(NULL, 2128920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66d30a000
mprotect(0x7fc66d311000, 2093056, PROT_NONE) = 0
mmap(0x7fc66d510000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fc66d510000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\1\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=1714384, ...}) = 0
mmap(NULL, 3821376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66cf65000
mprotect(0x7fc66d100000, 2097152, PROT_NONE) = 0
mmap(0x7fc66d300000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19b000) = 0x7fc66d300000
mmap(0x7fc66d306000, 16192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc66d306000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de54000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de53000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de52000
arch_prctl(ARCH_SET_FS, 0x7fc66de53700) = 0
mprotect(0x7fc66d300000, 16384, PROT_READ) = 0
mprotect(0x7fc66dc31000, 4096, PROT_READ) = 0
mprotect(0x7fc66d510000, 4096, PROT_READ) = 0
mprotect(0x7fc66d815000, 4096, PROT_READ) = 0
mprotect(0x7fc66da19000, 4096, PROT_READ) = 0
mprotect(0x68c000, 8192, PROT_READ)     = 0
mprotect(0x7fc66de57000, 4096, PROT_READ) = 0
set_tid_address(0x7fc66de539d0)         = 7412
set_robust_list(0x7fc66de539e0, 24)     = 0
rt_sigaction(SIGRTMIN, {0x7fc66da20b40, [], SA_RESTORER|SA_SIGINFO, 0x7fc66da2b1c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7fc66da20bd0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7fc66da2b1c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
rt_sigaction(SIGINT, {0x4079f0, [INT], SA_RESTORER|SA_RESTART, 0x7fc66cf98990}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGTERM, {0x4079f0, [TERM], SA_RESTORER|SA_RESTART, 0x7fc66cf98990}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {0x4079f0, [QUIT], SA_RESTORER|SA_RESTART, 0x7fc66cf98990}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGHUP, {0x4079f0, [HUP], SA_RESTORER|SA_RESTART, 0x7fc66cf98990}, {SIG_DFL, [], 0}, 8) = 0
brk(0)                                  = 0xf76000
brk(0xf97000)                           = 0xf97000
open("./config.xml", O_RDONLY)          = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2910, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=2910, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fc66de51000
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\r\0\0\0\r\0\0\0\0"..., 4096) = 2910
lseek(3, -1829, SEEK_CUR)               = 1081
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\r\0\0\0\r\0\0\0\0"..., 4096) = 1829
close(3)                                = 0
munmap(0x7fc66de51000, 4096)            = 0
write(2, "[00:32:55.550973] main:974 Start"..., 88[00:32:55.550973] main:974 Starting aircast version: v0.2.50.3 (Mar 13 2021 @ 12:32:56)
) = 88
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2910, ...}) = 0
write(2, "[00:32:55.551701] main:982 no co"..., 58[00:32:55.551701] main:982 no config file, using defaults
) = 58
uname({sys="Linux", node="Magicbox", ...}) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
ioctl(3, SIOCGIFCONF, {120, {{"lo", {AF_INET, inet_addr("127.0.0.1")}}, {"ovs_bond0", {AF_INET, inet_addr("192.168.1.10")}}, {"docker0", {AF_INET, inet_addr("172.17.0.1")}}}}) = 0
ioctl(3, SIOCGIFFLAGS, {ifr_name="lo", ifr_flags=IFF_UP|IFF_LOOPBACK|IFF_RUNNING}) = 0
ioctl(3, SIOCGIFFLAGS, {ifr_name="ovs_bond0", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0
close(3)                                = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2910, ...}) = 0
write(2, "[00:32:55.552330] Start:732 Bind"..., 52[00:32:55.552330] Start:732 Binding to 192.168.1.10
) = 52
futex(0x7fc66da1a0c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/lib/libcrypto.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0A\7\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=3015128, ...}) = 0
mmap(NULL, 5127056, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66ca81000
mprotect(0x7fc66cd34000, 2097152, PROT_NONE) = 0
mmap(0x7fc66cf34000, 184320, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2b3000) = 0x7fc66cf34000
mmap(0x7fc66cf61000, 15248, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc66cf61000
close(3)                                = 0
mprotect(0x7fc66cf34000, 131072, PROT_READ) = 0
open("/lib/libssl.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\211\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=452296, ...}) = 0
mmap(NULL, 2547824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fc66c812000
mprotect(0x7fc66c875000, 2097152, PROT_NONE) = 0
mmap(0x7fc66ca75000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x63000) = 0x7fc66ca75000
mmap(0x7fc66ca80000, 112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc66ca80000
close(3)                                = 0
mprotect(0x7fc66ca75000, 20480, PROT_READ) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
eizedev commented 3 years ago

cannot find libthread_db, is that mandatory?

(gdb) run
Starting program: /root/aircast-x86-64
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[00:39:28.876945] main:974 Starting aircast version: v0.2.50.3 (Mar 13 2021 @ 12:32:56)
[00:39:28.877131] main:982 no config file, using defaults
[00:39:28.877219] Start:732 Binding to 192.168.1.10

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
philippe44 commented 3 years ago

I think I have it, give me a few minutes

philippe44 commented 3 years ago

Solved, I think - I really hate C macros. I need to compile with the old openssl library headers but run with new ones and vice versa - it's painful

eizedev commented 3 years ago

Thanks @philippe44 0.2.53.1 (commit message - i think you mean 0.2.50.4, right?) is working again! Just out of interest, why do you need to compile with old openssl library headers?

philippe44 commented 3 years ago

Some users, like me, have compile machine with older distribution and so older openssl (it's not always a good idea to change the openssl of a distro and complicated to have different openssl-dev). The reason why I have an old distro is because it's a complicated cross-compiling environment for Linux (x86, x64, sparc, mips, ppc, armv5, armv6, aarch64), FreeBSD, Solaris, MacOS. So it took me a long while to get that cross-compiling system to work and I don't have the motivation to do it all over again.