tcg: use QTree instead of GTree 58/289158/1 sandbox/wangbiao/qemu_5_2_dump
authorHyunggi Lee <hyunggi.lee@samsung.com>
Wed, 22 Feb 2023 03:13:48 +0000 (12:13 +0900)
committersk7.park <sk7.park@samsung.com>
Thu, 2 Mar 2023 06:56:59 +0000 (15:56 +0900)
commit2d123e1fd1cdbb86bf15586a6867b8ac5b9b19c8
tree3caa95f9e2bbe4c8f6cc025ba15e83354470cbda
parentd6d103b1dab10b5bce5967df78c17c7213cf174f
tcg: use QTree instead of GTree

qemu-user can hang in a multi-threaded fork. One common
reason is that when creating a TB, between fork and exec
we manipulate a GTree whose memory allocator (GSlice) is
not fork-safe.

Although POSIX does not mandate it, the system's allocator
(e.g. tcmalloc, libc malloc) is probably fork-safe.

Fix some of these hangs by using QTree, which uses the system's
allocator regardless of the Glib version that we used at
configuration time.

Tested with the test program in the original bug report, i.e.:

Fixes: #285

Change-Id: I61bbe16ee5b639615a54f5afad0fa084c63c9b42
Signed-off-by: Emilio Cota <cota@braap.org>
accel/tcg/translate-all.c
tcg/tcg.c