mm_sound_server: Terminate the server when MMSoundThreadPoolRun() is failed 23/214323/2 accepted/tizen/unified/20190923.011207 submit/tizen/20190920.075442
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 20 Sep 2019 07:24:46 +0000 (16:24 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 20 Sep 2019 07:51:39 +0000 (16:51 +0900)
[Version] 0.12.51
[Issue Type] Crash

Change-Id: Ia58555507d775426dd1b4633e296f57c4635af2f
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/libmm-sound.spec
server/mm_sound_plugin.c
server/mm_sound_server.c
server/mm_sound_thread_pool.c

index 1f0193b..3523166 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and sound_server binary
-Version:    0.12.50
+Version:    0.12.51
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index e56ec80..92c3799 100644 (file)
@@ -87,6 +87,9 @@ int MMSoundPluginRelease(MMSoundPluginType *pluginlist)
 
        debug_fenter();
 
+       if (!pluginlist)
+               return MM_ERROR_NONE;
+
        while (pluginlist[loop].type != MM_SOUND_PLUGIN_TYPE_NONE)
                MMSoundPluginClose(&pluginlist[loop++]);
 
index 6a7a01f..f7aeb08 100644 (file)
@@ -217,7 +217,10 @@ int main(int argc, char **argv)
 
        if (serveropt.startserver || serveropt.printlist) {
                MMSoundMgrDbusInit();
-               MMSoundThreadPoolInit();
+               if (MMSoundThreadPoolInit()) {
+                       debug_error("failed to MMSoundThreadPoolInit()");
+                       goto exit;
+               }
                MMSoundMgrCodecInit(serveropt.plugdir, _shutdown_cb);
        }
 
@@ -228,6 +231,7 @@ int main(int argc, char **argv)
                _mainloop_run();
        }
 
+exit:
        debug_warning("sound_server [%d] terminating ", getpid());
 
        if (serveropt.startserver || serveropt.printlist) {
index 9525a0b..0ddc346 100644 (file)
@@ -112,7 +112,8 @@ int MMSoundThreadPoolInit()
                his dummy thread will be remained unused as soon as it started */
        debug_msg("run threads to reserve minimum thread");
        for (i = 0; i < MAX_UNUSED_THREADS_IN_THREADPOOL; i++)
-               MMSoundThreadPoolRun((void *)i, __DummyWork);
+               if (MMSoundThreadPoolRun((void *)i, __DummyWork))
+                       return MM_ERROR_SOUND_INTERNAL;
 
        MMSoundThreadPoolDump(TRUE);