GNOME Bugzilla – Bug 749993
Totem crashes at startup on 32bit systems
Last modified: 2016-01-08 20:08:18 UTC
On 32bit systems, I've witnessed totem crashing due when calling g_object_set (bvw->priv->play, "connection-speed", MAX_NETWORK_SPEED, NULL) in bacon_video_widget_initable_init(), which seems to be happening due to the MAX_NETWORK_SPEED macro being declared like this: #define MAX_NETWORK_SPEED 10752 ...instead of this: #define MAX_NETWORK_SPEED G_GUINT64_CONSTANT(10752) The problem is that g_object_set() uses a var_args list internally, which will work fine in 64bit systems without using G_GUINT64_CONSTANT because connection-speed is an uint64 property. However, in 32bit systems the var_args list will read both the MAX_NETWORK_SPEED value and the terminating NULL passed as one element, and then will keep reading after the end of the arguments list, causing the crash. See the relevant excerpt of the crashing backtrace below:
+ Trace 235091
Created attachment 304097 [details] [review] Patch proposal Attached the patch that fixed the issue in my 32-bit system. Please review, thanks.
Review of attachment 304097 [details] [review]: Thanks for the patch! ::: src/backend/bacon-video-widget.c @@ +96,3 @@ #define POPUP_HIDING_TIMEOUT 2 +#define MAX_NETWORK_SPEED G_GUINT64_CONSTANT(10752) I think it would be better to do the (guint64) cast at the g_object_set() call which uses MAX_NETWORK_SPEED, rather than in the definition of MAX_NETWORK_SPEED itself, since there’s no real reason for it to be 64-bit otherwise.
Created attachment 304139 [details] [review] Patch proposal (In reply to Philip Withnall from comment #2) > [...] > I think it would be better to do the (guint64) cast at the g_object_set() > call which uses MAX_NETWORK_SPEED, rather than in the definition of > MAX_NETWORK_SPEED itself, since there’s no real reason for it to be 64-bit > otherwise. No problem, I did that in this new patch as well as added a small comment explaining why we need to do that.
Review of attachment 304139 [details] [review]: Great, please commit to master! Thanks.
Committed, thanks
*** Bug 739034 has been marked as a duplicate of this bug. ***
I've pushed the patch to gnome-3-14 as well.