Solaris' printf doesn't support NULL arguments for %s, which pulseaudio unfortunately gives it now and then. Making a safe printf wrapper is just a major pain, so I guess we'll have to find the offenders that provide null pointers. The most glaring one is pa_thread_get_name(): Index: src/pulsecore/thread-posix.c =================================================================== --- src/pulsecore/thread-posix.c (revision 25954) +++ src/pulsecore/thread-posix.c (working copy) @@ -211,6 +211,9 @@ } #endif + if (t->name == NULL) + return "(null)"; + return t->name; }
If there's anything we can do to make it easier to integrate this work, please let us know. Would a git pull request help?
Sorry for ignoring this. There was shortage of maintainer time prior to last November. This particular change seems strange to me. "git grep pa_thread_new" indicates that threads are always created with a name, so t->name should never be NULL. As for handling possibly-NULL strings in printf arguments in general, we have pa_strnull(), which may be in many cases more appropriate than patching string-returning functions to never return NULL.
Threads not created by PulseAudio however can lack a name. In this case the main thread. Alternative patch using pa_strnull(): Index: src/pulsecore/log.c =================================================================== --- src/pulsecore/log.c (revision 27649) +++ src/pulsecore/log.c (working copy) @@ -303,9 +303,9 @@ pa_vsnprintf(text, sizeof(text), format, ap); if ((_flags & PA_LOG_PRINT_META) && file && line > 0 && func) - pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ", pa_thread_get_name(pa_thread_self()), file, line, func); + pa_snprintf(location, sizeof(location), "[%s][%s:%i %s()] ", pa_strnull(pa_thread_get_name(pa_thread_self())), file, line, func); else if ((_flags & (PA_LOG_PRINT_META|PA_LOG_PRINT_FILE)) && file) - pa_snprintf(location, sizeof(location), "[%s] %s: ", pa_thread_get_name(pa_thread_self()), pa_path_get_filename(file)); + pa_snprintf(location, sizeof(location), "[%s] %s: ", pa_strnull(pa_thread_get_name(pa_thread_self())), pa_path_get_filename(file)); else location[0] = 0;
Thanks, patch applied: http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=d90d99bd38be330c9800d40d4054b4135c4e9eb4
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.