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 623240 - Memory allocation fails when reading .xm (audio/x-mod) file metadata
Memory allocation fails when reading .xm (audio/x-mod) file metadata
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-30 20:02 UTC by infertux
Modified: 2012-01-31 19:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Dumps (4.88 KB, text/plain)
2010-06-30 20:02 UTC, infertux
Details
Example XM file (74.06 KB, audio/x-mod)
2011-01-07 00:14 UTC, infertux
Details

Description infertux 2010-06-30 20:02:37 UTC
Created attachment 164993 [details]
Dumps

The attachment is a dump from Rhythmbox launched with the "-d" switch, but I've the same error with Quodlibet (see my previous bug report here: https://bugzilla.redhat.com/show_bug.cgi?id=585545).

As you can see in the attachment, the bug raises not when processing a particular tag but "randomly" while reading metadata of a .xm file.
Moreover, sometimes the error is "realloc(): invalid next size" whereas sometimes it's "malloc(): memory corruption".
Comment 1 Vincent Penquerc'h 2011-01-06 23:21:30 UTC
Can you post a file that exhibits the problem ?
I don't have xm files apparently, and I don't see the problem with s3m/mod/it (using gst-launch with playbin2 using modplug).
Thanks
Comment 2 infertux 2011-01-07 00:14:20 UTC
I just tried to play some bogus xm files and I have no error as before (GStreamer 0.10.31). I attached an example file if you want to try but I think you can close the bug.
Comment 3 infertux 2011-01-07 00:14:32 UTC
Created attachment 177714 [details]
Example XM file
Comment 4 Vincent Penquerc'h 2011-01-07 11:11:41 UTC
Seems fine with that file as well. I noticed a little bug in libmodplug with Impulse Tracker modules, though, patch below (Sourceforge doesn't seem to want me to post that patch on the modplug tracker). I doubt it'd cause memory corruption, but it depends how delete/delete[] are implemented. In any case, that issue doesn't seem to be with gstreamer itself.


diff --git a/libmodplug/src/sndfile.cpp b/libmodplug/src/sndfile.cpp
index 4cb0646..1145986 100644
--- a/libmodplug/src/sndfile.cpp
+++ b/libmodplug/src/sndfile.cpp
@@ -285,12 +285,12 @@ BOOL CSoundFile::Destroy()
        m_nPatternNames = 0;
        if (m_lpszPatternNames)
        {
-               delete m_lpszPatternNames;
+               delete[] m_lpszPatternNames;
                m_lpszPatternNames = NULL;
        }
        if (m_lpszSongComments)
        {
-               delete m_lpszSongComments;
+               delete[] m_lpszSongComments;
                m_lpszSongComments = NULL;
        }
        for (i=1; i<MAX_SAMPLES; i++)
Comment 5 Tim-Philipp Müller 2011-01-07 11:17:37 UTC
This may be a bug in modplug it seems:

<slomo> tpm: yes, modplug believes that long is a 32 bit integer
<slomo> tpm: causing it to write twice as much data as it should on amd64

Marking as duplicate of bug #614361

*** This bug has been marked as a duplicate of bug 614361 ***
Comment 6 Tim-Philipp Müller 2011-01-07 11:18:33 UTC
Oh sorry, wrong bug
Comment 7 Vincent Penquerc'h 2012-01-31 19:02:33 UTC
Testing again here, I see no memory corruption playing with playbin2, or using gst-discoverer. Valgrind's happy about it too. Most likely, either the bug is fixed, or lies elsewhere.

If you can repdroduce it with gst-launch, can you please run valgrind on it, eg:

G_SLICE=always-malloc valgrind --leak-check=full --suppressions=/.../gstreamer/common/gst.supp --suppressions=/.../gst-plugins-base/tests/check/gst-plugins-base.supp --suppressions=/.../gst-plugins-good/tests/check/gst-plugins-good.supp --suppressions=/.../gst-plugins-bad/tests/check/gst-plugins-bad.supp --suppressions=/.../gst-plugins-ugly/tests/check/gst-plugins-ugly.supp gst-launch-0.10 uri=file:///.../test.xm

Then attach the output and reopen.