spice-common/common
Christophe Fergeau 2a4bf49edd log: Make sure glib threading is initialized
While testing spice-server on EL6, I was getting random crashes in the
glib logging code because g_logv was called recursively even though this
was not visible in a backtrace.

It turns out on older glib versions (EL6 has 2.28), g_logv is not
thread-safe unless g_thread_init() is called first. If g_thread_init()
is not called, the GMutex/GPrivate calls g_logv makes are turned into
no-ops, which is going to cause the recursion issue I was seeing.

This commit adds a call to g_thread_init() for these older glib
versions.

(gdb) bt
    0x7fff9f9fb110 "item.type: 114", unused_data=0x0) at gmessages.c:863
    format=0x7ffff50e72ac "item.type: %d", args1=0x7fff9f9fb640) at gmessages.c:517
    SPICE_LOG_LEVEL_DEBUG, strloc=0x7ffff50e72ba "dcc.c:1652", function=
    0x7ffff50e7320 "release_item_before_push", format=0x7ffff50e72ac "item.type: %d", args=
    0x7fff9f9fb640) at log.c:163
    SPICE_LOG_LEVEL_DEBUG, strloc=0x7ffff50e72ba "dcc.c:1652", function=
    0x7ffff50e7320 "release_item_before_push", format=0x7ffff50e72ac "item.type: %d") at log.c:195
    at dcc.c:1652
    at dcc.c:1719
    at dcc-send.c:2450
    at red-channel.c:578
    at red-channel.c:1587
    at event-loop.c:122
    0x7ffff4fb2ef2 <watch_func>, user_data=0x7fff980244e0) at giounix.c:166
    0x7ffff86ec770) at gmain.c:3092
2016-04-05 15:38:18 +02:00
..
backtrace.c Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
backtrace.h common/backtrace: for mingw32 no pipe/wait_pid, just disable 2012-03-20 15:25:55 +01:00
bitops.h Remove INLINE usage 2013-10-04 12:45:00 +02:00
canvas_base.c draw: Add spice_image_descriptor_is_lossy 2016-01-20 15:56:00 +00:00
canvas_base.h Add support for A8 images to the LZ routines 2012-08-24 13:37:51 -04:00
canvas_utils.c Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
canvas_utils.h Use SPICE_{BEGIN,END}_DECLS 2012-03-20 15:30:23 +01:00
client_demarshallers.h build-sys: make it a seperately buildable spice-common library 2012-03-22 20:21:05 +01:00
client_marshallers.h Remove 2 unused vfuncs from client_marshallers.h 2016-03-11 09:55:09 +01:00
draw.h draw: Add spice_image_descriptor_is_lossy 2016-01-20 15:56:00 +00:00
gdi_canvas.c use macro to define constructor function 2016-03-23 15:06:08 +00:00
gdi_canvas.h Remove need for SPICE_CANVAS_INTERNAL 2012-03-20 15:30:24 +01:00
gl_canvas.c use macro to define constructor function 2016-03-23 15:06:08 +00:00
gl_canvas.h Get rid of SW_CANVAS_IMAGE_CACHE 2015-03-26 10:15:04 +01:00
gl_utils.h Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
glc.c Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
glc.h Use SPICE_{BEGIN,END}_DECLS 2012-03-20 15:30:23 +01:00
lines.c Remove trailing whitespace 2015-12-18 11:41:15 +01:00
lines.h build-sys: make it a seperately buildable spice-common library 2012-03-22 20:21:05 +01:00
log.c log: Make sure glib threading is initialized 2016-04-05 15:38:18 +02:00
log.h log: Kill spice_warn_if 2016-01-26 15:58:43 +01:00
lz_common.h ppc: Fix lz magic endianess 2015-07-02 13:31:28 +02:00
lz_compress_tmpl.c remove wrong statement terminator from preprocessor macro 2016-01-26 16:45:32 +00:00
lz_config.h common: use INLINE instead of inline 2012-03-20 15:25:53 +01:00
lz_decompress_tmpl.c Add support for A8 images to the LZ routines 2012-08-24 13:37:51 -04:00
lz.c ppc: Fix lz magic endianess 2015-07-02 13:31:28 +02:00
lz.h Add printf format annotations to all '...' functions 2012-03-20 15:30:24 +01:00
macros.h define SPICE_CONSTRUCTOR_FUNC and SPICE_DESTRUCTOR_FUNC macros 2016-03-17 17:16:30 +00:00
Makefile.am Revert "Remove files moved to spice-protocol" 2016-03-10 16:01:36 +01:00
marshaller.c marshaller: fix uninitialized field usage 2016-02-03 11:48:43 +00:00
marshaller.h marshaller: track if add_fd() was given -1 2016-02-02 12:38:54 +00:00
mem.c small spice_strdup optimization 2016-01-26 17:17:08 +00:00
mem.h Use SPICE_{BEGIN,END}_DECLS 2012-03-20 15:30:23 +01:00
messages.h Add GL scanout structures 2016-01-14 11:49:25 +00:00
ogl_ctx.c Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
ogl_ctx.h Use SPICE_{BEGIN,END}_DECLS 2012-03-20 15:30:23 +01:00
pixman_utils.c Remove headers that are included in spice_common.h 2016-01-07 12:46:42 +01:00
pixman_utils.h pixman_utils: Add macros for color byte ordering 2015-12-17 16:03:19 +01:00
quic_config.h Use SPICE_{BEGIN,END}_DECLS 2012-03-20 15:30:23 +01:00
quic_family_tmpl.c quic_family_tmpl: Fix "FORWARD_NULL" caught by coverity 2014-07-23 17:20:30 +02:00
quic_rgb_tmpl.c common: Fix -Wunused-parameter 2014-09-18 13:15:29 +02:00
quic_tmpl.c common: Fix -Wunused-parameter 2014-09-18 13:15:29 +02:00
quic.c use macro to define constructor function 2016-03-23 15:06:08 +00:00
quic.h use macro to define constructor function 2016-03-23 15:06:08 +00:00
rect.h Remove INLINE usage 2013-10-04 12:45:00 +02:00
region.c region.c: fix region_bounds_intersects 2013-04-02 08:45:42 -04:00
region.h region: add region_extents 2012-05-02 14:47:27 +03:00
ring.h ring: use NULL instead of 0 for null pointers 2016-01-07 16:46:19 +00:00
rop3.c use macro to define constructor function 2016-03-23 15:06:08 +00:00
rop3.h use macro to define constructor function 2016-03-23 15:06:08 +00:00
snd_codec.c common: Fix -Wunused-variable 2014-10-23 14:54:48 +02:00
snd_codec.h Add support for the Opus codec. 2014-01-02 12:28:21 +01:00
spice_common.h Use a log handler to modify abort() behaviour 2012-03-20 15:30:23 +01:00
ssl_verify.c ssl-verify: Don't leak GInetAddress 2015-11-27 17:50:02 +01:00
ssl_verify.h ssl_verify: Move wincrypt.h related #ifdef closer to the include 2015-03-26 10:15:04 +01:00
sw_canvas.c use macro to define constructor function 2016-03-23 15:06:08 +00:00
sw_canvas.h use macro to define constructor function 2016-03-23 15:06:08 +00:00
verify.h Add compile-time check for lz arrays 2013-04-10 09:53:51 +02:00