After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797127 - Build Error on linux: gstfilesink: format '%u' exprects argument of type 'unsigned int', but argument 10 has type 'guint64'
Build Error on linux: gstfilesink: format '%u' exprects argument of type 'uns...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-12 00:07 UTC by Kim,Tae-Soo
Modified: 2018-09-12 02:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screen shot of build error. (66.17 KB, image/jpeg)
2018-09-12 00:07 UTC, Kim,Tae-Soo
  Details
filesink: Fix wrong printf format (1.50 KB, patch)
2018-09-12 01:33 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Kim,Tae-Soo 2018-09-12 00:07:49 UTC
Created attachment 373610 [details]
Screen shot of build error.

Dear all.

When I downloaded GStreamer source code and tried to build, this error occued on gstfilesink.c like below:

1)
GST_DEBUG_OBJECT (sink,
 "Queueing buffer list of %u bytes (%u buffers) at offset"
 G_GSIZE_FORMAT, size, num_buffers,
 sink->current_pos + sink->current_buffer_size);
2)
GST_DEBUG_OBJECT (filesink,
 "Queueing buffer of %" G_GSIZE_FORMAT " bytes at offset"
 G_GSIZE_FORMAT, gst_buffer_get_size (buffer),
 filesink->current_pos + filesink->current_buffer_size);

In these 2 cases, G_GSIZE_FORMAT is defined as "%u" while sink->current_pos is guint64, so this error occurs.

So I think these 2 line should be fixed like

1)
GST_DEBUG_OBJECT (sink,
 "Queueing buffer list of %u bytes (%u buffers) at offset %llu",
 size, num_buffers,
 sink->current_pos + sink->current_buffer_size);
2)
GST_DEBUG_OBJECT (filesink,
 "Queueing buffer of %" G_GSIZE_FORMAT " bytes at offset %llu",
 gst_buffer_get_size (buffer),
 filesink->current_pos + filesink->current_buffer_size);

Would you please check this??
Comment 1 Nicolas Dufresne (ndufresne) 2018-09-12 01:31:18 UTC
Looks like this is a built for 32bit linux. gsize would be 32bit, where doing uint64 + uint == uint64. Clearly the compiler is right, and we need to use G_GUINT64_FORMAT here.
Comment 2 Nicolas Dufresne (ndufresne) 2018-09-12 01:33:53 UTC
Created attachment 373611 [details] [review]
filesink: Fix wrong printf format

We add a guint64 and a guint, the result is a guint64. On 64bit
architecture, this is the same, but on 32bit architecture, it's not.
Comment 3 Nicolas Dufresne (ndufresne) 2018-09-12 01:36:36 UTC
This regression was added this summer, and went unnoticed since.

commit b324e4b802cf15f6f0688df5552ba762b1774844
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Tue Aug 28 14:22:16 2018 +0300

    filesink: Flush buffers before directly writing out buffers with the SYNC_AFTER flag
    
    Otherwise we write out the SYNC_AFTER buffer immediately, and the
    previously queued up buffers afterwards which then breaks the order of
    data.
    
    Also add various debug output.
Comment 4 Kim,Tae-Soo 2018-09-12 01:41:32 UTC
Review of attachment 373611 [details] [review]:

I think this modification can solve this build error on 32bit machine.
Comment 5 Kim,Tae-Soo 2018-09-12 01:57:56 UTC
Review of attachment 373611 [details] [review]:

I tested with this modification and gstreamer is built well on 32 bit machine.
Comment 6 Nicolas Dufresne (ndufresne) 2018-09-12 02:02:13 UTC
Attachment 373611 [details] pushed as c81b2f6 - filesink: Fix wrong printf format