owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.05k stars 235 forks source link

Crashes on openwrt #1388

Closed monsterzzzz closed 2 years ago

monsterzzzz commented 2 years ago

I build owntone on openwrt(x86-64 platform). It crashes every time while opening the webpage. I find that it crashes when the client requests "/api/library/count?expression=....". No problem occurs if the request is just "/api/library/count". It is related to the latest musl version(1.2.2) openwrt toolchain uses. It is unknown if there are any other similar problems. Using musl 1.1.24 everything seems to work fine. This happens from version 27.4 to 28.2, and other versions are not tested. So any idea to solve this problem? log.txt

ejurgensen commented 2 years ago

Thanks for an excellent error report, seems you have examined the issue very well. Two questions:

  1. Can you try running owntone in gdb and get a backtrace? Something like this 1) Stop owntone, 2) "gdb --args /usr/sbin/owntone -f", 3) "run", 4) Wait for startup to complete, go to the web page, trigger crash, 5) "bt"
  2. To test possible fixes: Are you able to build from github? Or would you prefer an ipkg from me?

My own options for testing on OpenWrt aren't so good currently, but I can build ipkg's relatively easily.

monsterzzzz commented 2 years ago

Here is the log. It looks like it crashes while calling memcpy() gdb.log.txt .

ejurgensen commented 2 years ago

Looks like the issue is in libantlr3c, which matches your description about the error happening when "expression" is a parameter. Incidently, I'm working on removing antlr3 dependencies (in PR #1386), so one option to solve this is that you become a tester of this change. That brings us to my second question above.

monsterzzzz commented 2 years ago

I'll take a try.