GNOME Bugzilla – Bug 765251
Trying to set string on structure field 'debug', but string is not valid UTF-8
Last modified: 2016-05-22 17:42:46 UTC
When I am trying to launch the following pipeline with LC_ALL=pl_PL $ gst-launch-1.0 udpsrc caps=application/x-rtp,media=audio timeout=5000000000 ! rtpjitterbuffer latency=200 do-lost=true ! rtpopusdepay ! opusdec plc=true use-inband-fec=true apply-gain=false ! audioconvert ! audioresample quality=5 ! queue ! osxaudiosink Ustawianie potoku na PAUZOWANIE... the following warning appears (gst-launch-1.0:45100): GStreamer-WARNING **: Trying to set string on structure field 'debug', but string is not valid UTF-8. Please file a bug. BŁĄD: potok odmawia pauzowania. BŁĄD: od elementu /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Nie udało się pobrać/ustawić ustawień zasobu. Ustawianie potoku na NULL... Zwalnianie potoku...
Could you get a stack trace? (G_DEBUG=fatal_warnings gdb --args gst-launch-1.0 ...) My guess is that it tries to add a debug string in an error message that's locale encoding and not UTf-8 or so.
I've found out that this happens when something is already bound to the UDP port with reuse=false. (lldb) bt * thread #1: tid = 0x0000, 0x000000010d79975d libglib-2.0.0.dylib`g_logv + 941, stop reason = signal SIGSTOP * frame #0: 0x000000010d79975d libglib-2.0.0.dylib`g_logv + 941 frame #1: 0x000000010d799396 libglib-2.0.0.dylib`g_log + 134 frame #2: 0x000000010d5da6f1 libgstreamer-1.0.0.dylib`gst_structure_set_field + 577 frame #3: 0x000000010d5d7f87 libgstreamer-1.0.0.dylib`gst_structure_id_set_valist_internal + 423 frame #4: 0x000000010d5d814b libgstreamer-1.0.0.dylib`gst_structure_new_id + 171 frame #5: 0x000000010d5a8e3f libgstreamer-1.0.0.dylib`gst_message_new_error + 95 frame #6: 0x000000010d59a16f libgstreamer-1.0.0.dylib`gst_element_message_full + 431 frame #7: 0x000000010db6cbc7 libgstudp.so`gst_udpsrc_change_state + 1399 frame #8: 0x000000010d59ae62 libgstreamer-1.0.0.dylib`gst_element_change_state + 210 frame #9: 0x000000010d59c166 libgstreamer-1.0.0.dylib`gst_element_set_state_func + 438 frame #10: 0x000000010d575463 libgstreamer-1.0.0.dylib`gst_bin_change_state_func + 1827 frame #11: 0x000000010d5bddca libgstreamer-1.0.0.dylib`gst_pipeline_change_state + 378 frame #12: 0x000000010d59ae62 libgstreamer-1.0.0.dylib`gst_element_change_state + 210 frame #13: 0x000000010d59c166 libgstreamer-1.0.0.dylib`gst_element_set_state_func + 438 frame #14: 0x000000010d55db0f gst-launch-1.0`main + 1519 frame #15: 0x00007fff8dd415ad libdyld.dylib`start + 1
Created attachment 326313 [details] Screenshot of non-unicode error The message means in Polish "error while binding to the address: ..."
Not quite sure what's going on here. So the debug string comes from the GError error->message in gstudpsrc.c: bind_error: { GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL), ("bind failed: %s", err->message)); g_clear_error (&err); ... } which should be UTF-8. The error message in turn comes from glib/gio/gsocket.c if (bind (socket->priv->fd, ... ) < 0) { int errsv = get_socket_errno (); g_set_error (error, G_IO_ERROR, socket_io_error_from_errno (errsv), _("Error binding to address: %s"), socket_strerror (errsv)); return FALSE; } which looks ok so far. The garbled string is the socket_strerror(errsv) part if I'm not mistaken. This, however, just maps to g_strerror() or non-Windows systems, which should also return UTF-8 ("Unlike strerror(), this always returns a string in UTF-8 encoding, and the pointer is guaranteed to remain valid for the lifetime of the process."). So not quite sure what's going on here, bug in g_strerror() seems unlikely. Is this reproducable every time or does it only happen every now and then? Is it also reproducable with a minimal pipeline? (like udpsrc .. ! fakesink) Could you run this through valgrind perhaps? Or step through g_strerror in a debugger to see what's going on? In any case, I don't think the bug is in GStreamer.
Also, could you check if your glib build detected strerror_r support? $ grep HAVE_STRERROR_R config.h
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!