From c4906ef9cf0204460375affab31b29eccad8768c Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Mon, 26 Nov 2018 19:33:27 +0900 Subject: [PATCH] null-source: avoid crash by limiting push size of memblock when it exceeds allocated size. This is workaround solution for avoiding crash due to pushing unexpected size from dedicated chunk allocation. It seems that sometimes rtpoll returns later than what we expected, which cause unexpected length request. As of now, the root cause of that situation is not found (maybe lack of process scheuduling, etc.), we need to limit the size of pushing data to allocated memblock size when it exceeds. [Version] 11.1-53 [Issue Type] Fix crash Change-Id: Ia7481244802ad85e4fc2fd7ab653dd35c54360b6 --- packaging/pulseaudio.spec | 2 +- src/modules/module-null-source.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 341231a..e66a140 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -3,7 +3,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 11.1 -Release: 52 +Release: 53 Group: Multimedia/Audio License: LGPL-2.1 URL: http://pulseaudio.org diff --git a/src/modules/module-null-source.c b/src/modules/module-null-source.c index efa1622..8538d7a 100644 --- a/src/modules/module-null-source.c +++ b/src/modules/module-null-source.c @@ -150,6 +150,20 @@ static void thread_func(void *userdata) { chunk.memblock = pa_memblock_new(u->core->mempool, (size_t) -1); /* or chunk.length? */ chunk.index = 0; + +#ifdef __TIZEN__ + if (chunk.length > pa_memblock_get_length(chunk.memblock)) { + pa_log("state(%d), elapsed(%llu), latency_time(%llu), chunk.length(%zu) > chunk.memblock length(%zu)", + u->source->state, + (long long unsigned)(now - u->timestamp), + (long long unsigned)u->latency_time, + chunk.length, + pa_memblock_get_length(chunk.memblock)); + + chunk.length = pa_memblock_get_length(chunk.memblock); + } +#endif + pa_source_post(u->source, &chunk); pa_memblock_unref(chunk.memblock); -- 2.7.4