-
Notifications
You must be signed in to change notification settings - Fork 78
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
lib/utils.c:192: utils_data_to_string: Assertion `str' failed. #192
Comments
Will look into this. Does it happen without using -d (debug) mode? Does it happen just when connecting to a client, or on the middle of streaming? Thanks for any more description you can give. I suppose it crashes UxPlay? Coincidently (?) This function utils_data_to_string just had a little work done to it a day or two ago (to replace sprintf by the safer snprintf because of a compiler warning that sprintf was declared obsolete) |
Running with no command line flags. I am playing Apple Music from an iPad. I don't know precisely when the assertion fails but it isn't at connecting a client time. Connection time is usually when I spot the problem because uxplay is not running. I do suspend/resume the system several times a day which may be an influence. uxplay is compiled myself, running on Ubuntu 22.10. Example output
|
Hmm: chars_per_line is always 12, 16 or 20. If it is called with datalen = 0 maybe that would cause the assertion to fail. (but then len +1 would be 2, which seems OK) Maybe it should test test for datalen <= 0, and just return a null pointer immediately in that case.
The previous version (which you are probably using) is
|
I'll think about it. Since the assertion kills uxplay. maybe should If you get this regularly, that should produce some clues. |
this utils_data_to_string is mainly used in -d (debug) mode. But you are not using the -d option.
|
I'm getting this on both of the v1.63 installs I've tried on a pi3a and pi3b today. Error starts as soon as I try to share screen from device and crashes UxPlay. |
@chasecee That is now fixed. (But I dont think it is @rogerbinns issue) |
Unnecessary calls to utils_data_string when the -d (debug) option is not used have now been removed, as well as some other unnecessary things, and I think this improves the code for normal operation. Thanks for bringing up this issue.
Since I didn't understand why the assertion was triggered, it might be a symptom of some other issue, |
I ran the existing version under gdb and got a backtrace:
There are no symbols or locals as far as gdb is concerned for frames 7 and 8. |
Good, I see the problem was in raop_ntp_thread.... As I said, I "fixed" it so utils_data_to_string is never called without the -d option, but I could not see what could cause it to fail to allocate memory for str in the first place, so I have probably just address a symptom not a cause in the latest . The code you are running is
where request and response are 16 bytes of timing data sent to and received from the client. HMMM `` datalen'' could be a negative return value from sendto( ), it it failed .. this is probably the issue.
|
OK its easy to see now: just move the call to utils_to_string to AFTER the testto see if sendlen is < 0
|
I've not had any problems since doing a build earlier as requested. The assertion failure has in the past been correlated with clients coming and going, and with the system being suspended and resumed. I've done light amounts of those and the assertion failure has not repeated. Note that with suspend resume it is quite possible to have timeouts and similar in those routines reading and writing the network, and hours could pass in what is normally instant. |
Thanks
|
I get this every few days, but don't have a reliable way to reproduce:
The text was updated successfully, but these errors were encountered: