[PATCH] Crash in mdssvc with older glib2 versions

Jeremy Allison jra at samba.org
Thu Mar 17 21:14:30 UTC 2016


On Thu, Mar 17, 2016 at 04:43:25PM +0100, Ralph Boehme wrote:
> On Thu, Mar 17, 2016 at 04:07:53PM +0100, Ralph Boehme wrote:
> > Hi!
> > 
> > Older glib2 versions will crash if g_type_init is not called:
> > 
> > (process:6712): GLib-GObject-CRITICAL **: ... ./gobject/gtype.c:2722:
> > You forgot to call g_type_init()
> > 
> > Please review & push if ok. Thanks!
> 
> ENOPATCH.

Confirmed here:

https://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g-type-init

LGTM. Pushed !

> -- 
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de

> From 94e4419bd674e80e7ea03dda6891994b839900d0 Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Thu, 17 Mar 2016 14:05:58 +0100
> Subject: [PATCH] s3:mdssvc: older glib2 versions require g_type_init()
> 
> Older glib2 versions will crash if g_type_init is not called:
> 
> (process:6712): GLib-GObject-CRITICAL **: ... ./gobject/gtype.c:2722:
> You forgot to call g_type_init()
> 
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11801
> 
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
>  source3/rpc_server/mdssvc/mdssvc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/source3/rpc_server/mdssvc/mdssvc.c b/source3/rpc_server/mdssvc/mdssvc.c
> index abfea43..44d7703 100644
> --- a/source3/rpc_server/mdssvc/mdssvc.c
> +++ b/source3/rpc_server/mdssvc/mdssvc.c
> @@ -1783,10 +1783,13 @@ done:
>  }
>  
>  /**
> - * Init callbacks at startup, nothing to do here really
> + * Init callbacks at startup
>   **/
>  bool mds_init(struct messaging_context *msg_ctx)
>  {
> +#if (GLIB_MAJOR_VERSION < 3) && (GLIB_MINOR_VERSION < 36)
> +	g_type_init();
> +#endif
>  	return true;
>  }
>  
> -- 
> 2.5.0
> 




More information about the samba-technical mailing list