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 557587 - crash or damaged ID3 tag when reencoding from flac->mp3 using gst-launch
crash or damaged ID3 tag when reencoding from flac->mp3 using gst-launch
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.15
Other Linux
: Normal critical
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-23 11:26 UTC by Stanislav Brabec
Modified: 2009-05-07 17:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
head.flac (500.00 KB, audio/x-flac)
2009-05-07 14:48 UTC, Stanislav Brabec
Details

Description Stanislav Brabec 2008-10-23 11:26:08 UTC
I have my CDs collection encoded in FLAC. Files are encoded as regular FLAC (not OGG FLAC) and tagged with FLAC tag (not ID3).

I am trying to reencode them to tagged MP3 using gst-launch. Conversion is done, but tags are damaged (ID3v1 contain nonsense, ID3v2 is not created). It happens for both ASCII and non-ASCII/non-ISO-8859-1 comments.

FLAC decoder seems to work correctly.

It sometimes crashes. If it does not crash, it creates an MP3 with damaged ID3 tag.

gstreamer-0_10-0.10.21
gst-plugins-base-0.10.21
gst-plugins-good-0.10.10.4 (prerelease build from released snapshot)
gst-plugins-bad-0.10.8
gst-plugins-ugly-0.10.9

Older versions (-1) crash as well.

gst-launch filesrc location=CD/Rūp\ Verma/चेतना\ -\ chētnā\ -\consciousness\ -\ vědomí/02\ -\ Rāga\ Gujrī\ Tōḍī.flac ! flacdec ! audioconvert ! lame ! id3mux name=tag v2-tag=true v1-tag=true ! filesink location=music.mp3
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Caught SIGSEGV accessing address 0x772000
  • #0 ??
  • #1 ??
  • #2 ??
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 ??
  • #7 ??
  • #8 ??
  • #9 ??
  • #10 ??
  • #11 ??
  • #12 ??
  • #13 ??
  • #14 ??
  • #15 ??
  • #16 ??
  • #17 ??
  • #18 ??
  • #19 ??
  • #20 ??
  • #21 ??
  • #22 ??
  • #23 ??
  • #24 ??
  • #25 ??
  • #26 ??
  • #27 ??
  • #28 ??
  • #29 ??
  • #30 ??
  • #31 ??
  • #32 ??
  • #33 ??


gst-launch filesrc location=CD/Rūp\ Verma/चेतना\ -\ chētnā\ -\ cosciousness\ -\ vědomí/02\ -\ Rāga\ Gujrī\ Tōḍī.flac ! flacdec ! fakesink -t
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
FOUND TAG      : found by element "flacdec0".
     audio codec: FLAC
           title: Rāga Gujrī Tōḍī
          artist: Rūp Verma
           album: चेतना - chētnā - consciousness - vědomí
            date: 1993-01-01
    track number: 2
     track count: 2
           genre: Meditative
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 5654329432 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...

id3v2 -l music.mp3 
id3v1 tag info for music.mp3:
Title  : �������!���!����                Artist: �������A����������           
Album  : ��������������                  Year: ���1, Genre: Other (12)
Comment:
Comment 1 Sebastian Dröge (slomo) 2008-10-23 12:44:50 UTC
Could you try if it works better with id3v2mux (id3mux is more or less deprecated nowadays).

Also, could you install debug packages for glib, gstreamer, gst-plugins-base, gst-plugins-good and gst-plugins-ugly and try to get a better backtrace? I've tried (on a 32 bit system) to do the same as you did but it didn't crash for me and the tags looked fine too.
Comment 2 Stanislav Brabec 2008-10-23 13:46:52 UTC
id3v2mux does not crash, but ID3 tag is empty:

gst-launch filesrc location=CD/VA/Café\ Del\ Mar\ Ibiza/01\ -\ José\ Padilla\ -\ Agua.flac ! flacdec ! audioconvert ! lame ! id3v2mux name=tag ! filesink location=music.mp3

id3v2 -l music.mp3 
music.mp3: No ID3 tag
Comment 3 Tobias Mueller 2009-04-19 23:14:40 UTC
Hey Sebastian, you set this bug to NEEDINFO in comment #1. I think the question has been answered in comment #2 and I am thus reopening this issue. Feel free to ask further questions :)
Comment 4 Tim-Philipp Müller 2009-05-07 09:31:18 UTC
Also, could you attach the first few kB of that flac file so we can investigate why the ID3v2 tag is empty?

  head --bytes=500k foo.flac > head.flac

should get you just the beginning (100k might be enough as well if it the tag is small).


Comment 5 Stanislav Brabec 2009-05-07 14:48:30 UTC
Created attachment 134196 [details]
head.flac

With the latest released gstreamer packages on openSUSE 11.2 Factory (Milestone 1) x86_64.

Starting program: /usr/bin/gst-launch filesrc location=head.flac \! flacdec \! audioconvert \! lame \! id3mux name=tag v2-tag=true v1-tag=true \! filesink location=music.mp3
[Thread debugging using libthread_db enabled]
Executing new program: /usr/bin/gst-launch-0.10
[Thread debugging using libthread_db enabled]
Setting pipeline to PAUSED ...
[New Thread 0x7ffff4096950 (LWP 11212)]

Program received signal SIGSEGV, Segmentation fault.

Thread 140737287645520 (LWP 11212)

  • #0 id3_ucs4_copy
    at ucs4.c line 171
  • #1 id3_ucs4_duplicate
    at ucs4.c line 185
  • #2 id3_field_addstring
    at field.c line 638
  • #3 tag_list_to_id3_tag_foreach
    at gstid3tag.c line 841
  • #4 structure_foreach_wrapper
    at gsttaglist.c line 914
  • #5 gst_structure_foreach
    at gststructure.c line 914
  • #6 gst_tag_list_foreach
    at gsttaglist.c line 939
  • #7 gst_mad_tag_list_to_id3_tag
    at gstid3tag.c line 857
  • #8 gst_id3_tag_chain
    at gstid3tag.c line 1390
  • #9 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #10 gst_pad_push
    at gstpad.c line 4057
  • #11 gst_lame_chain
    at gstlame.c line 1115
  • #12 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #13 gst_pad_push
    at gstpad.c line 4057
  • #14 gst_base_transform_chain
    at gstbasetransform.c line 2030
  • #15 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #16 gst_pad_push
    at gstpad.c line 4057
  • #17 gst_flac_dec_write
    at gstflacdec.c line 1147
  • #18 gst_flac_dec_write_stream
    at gstflacdec.c line 1189
  • #19 write_audio_frame_to_client_
    at stream_decoder.c line 2960
  • #20 read_frame_
    at stream_decoder.c line 2132
  • #21 FLAC__stream_decoder_process_single
    at stream_decoder.c line 1060
  • #22 gst_flac_dec_loop
    at gstflacdec.c line 1235
  • #23 gst_task_func
    at gsttask.c line 192
  • #24 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #25 g_thread_create_proxy
    at gthread.c line 635
  • #26 start_thread
    at pthread_create.c line 297
  • #27 clone
    from /lib64/libc.so.6
  • #28 ??

Comment 6 Sebastian Dröge (slomo) 2009-05-07 15:18:19 UTC
This is a bug in libid3tag IMHO as it crashes on something that seems to be valid UCS4 data.

Closing as NOTGNOME... you should use id3v2mux anyway :)
Comment 7 Tim-Philipp Müller 2009-05-07 15:36:47 UTC
Well, id3mux is in -ugly, so it's supposed to be reliable and work well. We need to do something about that (I have a plan, work in progress). Will create a clone bug to keep track of this.
Comment 8 Sebastian Dröge (slomo) 2009-05-07 15:42:08 UTC
What's this plan? Another problem here is that the FLAC contains vorbiscomments in ISO-8859-1 or something and not UTF8...
Comment 9 Stanislav Brabec 2009-05-07 17:00:29 UTC
Note that it still may be a problem of gstreamer, as it sometimes show:

*** glibc detected *** /usr/bin/gst-launch-0.10: malloc: top chunk is corrupt: 0x0000000000821e00 ***

After setting breakpoint to id3_ucs4_copy and stepping in gdb by "n" it generated a different backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff40a231c in id3_frame_render (frame=0x6500000076, ptr=0x0, options=0) at frame.c:513
513	  if ((frame->flags & ID3_FRAME_FLAG_TAGALTERPRESERVATION) ||
(gdb) bt 
  • #0 id3_frame_render
    at frame.c line 513
  • #1 id3_tag_render
    at tag.c line 793
  • #2 gst_id3_tag_chain
    at gstid3tag.c line 1394
  • #3 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #4 gst_pad_push
    at gstpad.c line 4057
  • #5 gst_lame_chain
    at gstlame.c line 1115
  • #6 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #7 gst_pad_push
    at gstpad.c line 4057
  • #8 gst_base_transform_chain
    at gstbasetransform.c line 2030
  • #9 gst_pad_chain_unchecked
    at gstpad.c line 3890
  • #10 gst_pad_push
    at gstpad.c line 4057
  • #11 gst_flac_dec_write
    at gstflacdec.c line 1147
  • #12 gst_flac_dec_write_stream
    at gstflacdec.c line 1189
  • #13 write_audio_frame_to_client_
    at stream_decoder.c line 2960
  • #14 read_frame_
    at stream_decoder.c line 2132
  • #15 FLAC__stream_decoder_process_single
    at stream_decoder.c line 1060
  • #16 gst_flac_dec_loop
    at gstflacdec.c line 1235
  • #17 gst_task_func
    at gsttask.c line 192
  • #18 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #19 g_thread_create_proxy
    at gthread.c line 635
  • #20 start_thread
    at pthread_create.c line 297
  • #21 clone
    from /lib64/libc.so.6
  • #22 ??