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 706880 - sysmem: Alignment has to be kept when copying
sysmem: Alignment has to be kept when copying
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-27 11:28 UTC by Sebastian Dröge (slomo)
Modified: 2016-04-20 06:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2013-08-27 11:28:14 UTC
+++ This bug was initially created as a clone of Bug #705678 +++

When copying a system memory with an offset, offset 0 of the copy should have the same alignment as the original data had. Not the same alignment as offset 0 of the original data.
Comment 1 Tim-Philipp Müller 2016-04-17 17:52:40 UTC
I am not sure if I really understand this bug. Jan said in comment #6 of bug #705678 , which was the reason for cloning this aiui:

> Yes, the new memory block will be aligned. The data within it
> may not have the same alignment after the copy - for example,
> copy from a buffer containing uint32's with an offset of
> 3 - the new memory won't have aligned uint32s where the old
> buffer did.

Ok, so the second uint32 wouldn't be aligned any more, but why would one copy data from offset 3 anyway if the data is processed in units of 4 bytes?

How does one determine what the correct alignment is in this case? e.g. if we have 4096 uint32 and we copy data from offset 4094*4 + 3, what should be the alignment of the new &data[1] ?

Conversely, often one may want to explicitly achieve a new clean alignment when copying (and existing code might in fact rely on this behaviour). Example: a demuxer or parser where we have 7 bytes of headers, and then follows some payload, and we want the payload to be aligned nicely.
Comment 2 Jan Schmidt 2016-04-20 03:18:00 UTC
None of it makes sense to me any more. I think we should just mark WONTFIX
Comment 3 Sebastian Dröge (slomo) 2016-04-20 06:17:34 UTC
Agreed