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 629910 - jpegparse: properly clean up comment string
jpegparse: properly clean up comment string
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-17 10:01 UTC by Nicola
Modified: 2010-12-11 21:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wireshark dump (294.00 KB, application/octet-stream)
2010-09-17 21:18 UTC, Nicola
  Details
jpegparse: Convert string to utf8 on tag adding (1.76 KB, patch)
2010-09-26 20:05 UTC, Thiago Sousa Santos
none Details | Review
gdppayload (777.26 KB, application/octet-stream)
2010-09-27 07:03 UTC, Nicola
  Details

Description Nicola 2010-09-17 10:01:53 UTC
I have this error connecting to the mjpeg from an axis camera:

GStreamer-WARNING **: Trying to set string on taglist field 'comment', but string is not valid UTF-8. Please file a bug.

according to Wim Taymans "it means an element doesn't properly clean up the comment string before handing it to the application"

thanks
drakkan1000
Comment 1 Nicola 2010-09-17 21:18:37 UTC
Created attachment 170518 [details]
wireshark dump
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-24 11:20:06 UTC
Can't you tell the pipeline? It would be usefuly to limmit cehcking which element it could be.
Comment 3 Tim-Philipp Müller 2010-09-24 11:27:22 UTC
Could you run your code (or gst-launch-0.10) with

 $ G_DEBUG=fatal_warnings gdb --args ./yourapp ...

and then when it breaks at the warnings get a stack trace with 'bt'?

(I suspect jpegparse btw, I noticed other brokenness wrt comment tags there too the other day, moving there for now)
Comment 4 Nicola 2010-09-24 12:31:23 UTC
yes the problem is jpegparse, this pipeline works without warning:

gst-launch-0.10 -v souphttpsrc location=http://root:npgadmin@192.168.2.136/mjpg/1/video.mjpg ! multipartdemux  ! jpegdec ! xvimagesink

while this one give the warning:

gst-launch-0.10 -v souphttpsrc location=http://root:npgadmin@192.168.2.136/mjpg/1/video.mjpg ! multipartdemux ! jpegparse ! jpegdec ! xvimagesink

here is the trace, I suspect it is not useful since I haven't debug symbol:

(gdb) bt
  • #0 raise
    from /lib/libc.so.6
  • #1 abort
    from /lib/libc.so.6
  • #2 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #3 g_log
    from /usr/lib/libglib-2.0.so.0
  • #4 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #5 gst_structure_id_set_value
    from /usr/lib/libgstreamer-0.10.so.0
  • #6 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #7 gst_tag_list_add_valist
    from /usr/lib/libgstreamer-0.10.so.0
  • #8 gst_tag_list_add
    from /usr/lib/libgstreamer-0.10.so.0
  • #9 ??
    from /usr/lib/gstreamer-0.10/libgstjpegformat.so
  • #10 ??
    from /usr/lib/gstreamer-0.10/libgstjpegformat.so
  • #11 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #12 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #13 ??
    from /usr/lib/gstreamer-0.10/libgstmultipart.so
  • #14 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #15 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #16 ??
    from /usr/lib/libgstbase-0.10.so.0
  • #17 ??
    from /usr/lib/libgstreamer-0.10.so.0
  • #18 ??
    from /usr/lib/libglib-2.0.so.0
  • #19 ??
    from /usr/lib/libglib-2.0.so.0
  • #20 start_thread
    from /lib/libpthread.so.0
  • #21 clone
    from /lib/libc.so.6
  • #22 ??

Comment 5 Thiago Sousa Santos 2010-09-26 20:05:05 UTC
Created attachment 171148 [details] [review]
jpegparse: Convert string to utf8 on tag adding

From the bt it seems be jpegparse, this patch should
fix it, can you try it?

Alternatively, you could gdp payload your camera output so
that we could reproduce it over and test. Something like

gst-launch -e souphttpsrc ! gdppay ! filesink location=stream.gdp

should provide us with a sample to test.
Comment 6 Nicola 2010-09-27 07:03:00 UTC
Created attachment 171177 [details]
gdppayload

produced with:

gst-launch-0.10 -e souphttpsrc location=.. ! multipartdemux ! gdppay ! filesink location=stream.gdp

I get the same warning with the following pipeline:

gst-launch-0.10 filesrc location=/home/nicola/stream.gdp ! gdpdepay ! jpegparse ! jpegdec ! xvimagesink
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2010-09-27 09:28:57 UTC
According to the TIFF spec such fields use plain ascii:
ASCII 8-bit byte that contains a 7-bit ASCII code; the last byte
must be NUL (binary zero).

I can't find anything about this in official jfif specs:
http://www.jpeg.org/public/jfif.pdf

Also the libjpeg sources don't help much. So if the attached patch help, it could be okay, otherwise we might want to consider forcing it to be ascii.
Comment 8 Thiago Sousa Santos 2010-09-27 14:11:33 UTC
No, the patch doesn't fix it. Adding a check for is_utf8 in the end should make it not assert. But it will lose the COM tag.
Comment 9 Stefan Sauer (gstreamer, gtkdoc dev) 2010-12-03 08:49:22 UTC
Bug #626618 now also contains a patch that tries to address this.
Comment 10 Mark Nauwelaerts 2010-12-07 13:32:42 UTC
Had not noticed this bug here, but the following handles this essentially as the patch here does:

commit a3144019068b952ee2b74c5daeec7a869075af0b
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Mon Dec 6 19:00:28 2010 +0100

    jpegparse: try to convert comment tag to UTF-8


Note: it seems the attached patch has a minor typo (still adds non-transformed comment to the taglist) and as such may have failed to fix (as mentioned above).  Above commit does eliminate the warning.
Comment 11 Nicola 2010-12-07 21:17:45 UTC
I just compiled the latest svn and I still have the same warning
Comment 12 Nicola 2010-12-11 21:51:05 UTC
My bad, the latest git solve the issue, thanks Nicola