Summary: | crash because of null string on solaris | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | Pierre Ossman <pierre-bugzilla> |
Component: | core | Assignee: | pulseaudio-bugs |
Status: | RESOLVED FIXED | QA Contact: | pulseaudio-bugs |
Severity: | normal | ||
Priority: | medium | CC: | astrand, lennart |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Pierre Ossman
2012-10-04 08:58:36 UTC
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; |
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.