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 743871 - validate: Provide a way to test failing socket operations.
validate: Provide a way to test failing socket operations.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-devtools
unspecified
Other All
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-02 16:36 UTC by Mathieu Duponchelle
Modified: 2015-02-03 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
validate: Implement a fault injection library. (12.82 KB, patch)
2015-02-02 16:36 UTC, Mathieu Duponchelle
reviewed Details | Review
scenario: implement an action to corrupt socket recv. (5.66 KB, patch)
2015-02-02 16:36 UTC, Mathieu Duponchelle
rejected Details | Review
validate: Implement a fault injection library. (12.81 KB, patch)
2015-02-02 20:20 UTC, Mathieu Duponchelle
none Details | Review
validate: Implement a fault injection library. (17.07 KB, patch)
2015-02-03 14:23 UTC, Mathieu Duponchelle
committed Details | Review

Description Mathieu Duponchelle 2015-02-02 16:36:46 UTC
This implements a fault injection library, and an action to corrupt recv,
by modifying errno to the desired error.
Comment 1 Mathieu Duponchelle 2015-02-02 16:36:50 UTC
Created attachment 295960 [details] [review]
validate: Implement a fault injection library.
Comment 2 Mathieu Duponchelle 2015-02-02 16:36:55 UTC
Created attachment 295961 [details] [review]
scenario: implement an action to corrupt socket recv.

Example of new action:

corrupt-socket-recv, playback-time=3.0, port=8000, errno=ECONNRESET,
times=42
Comment 3 Thibault Saunier 2015-02-02 17:07:37 UTC
Review of attachment 295960 [details] [review]:

::: validate/configure.ac
@@ +64,3 @@
 
+dnl Tiny library overriding calls such as socket recv / send
+FAULTINJECTION_LIBS="-L$(top_srcdir)/fault_injection/.libs/ -lfaultinjection-$GST_API_VERSION"

That does not look right (ie. specifiing .libs)

::: validate/gst/validate/Makefile.am
@@ +47,3 @@
 lib_LTLIBRARIES = libgstvalidate-@GST_API_VERSION@.la
+libgstvalidate_@GST_API_VERSION@_la_CFLAGS = $(GST_ALL_CFLAGS)\
+	$(GIO_CFLAGS) $(GST_PBUTILS_CFLAGS) -I$(top_srcdir)/fault_injection

I do not understand why you link Validate against that lib here?
Comment 4 Mathieu Duponchelle 2015-02-02 20:20:33 UTC
Created attachment 295978 [details] [review]
validate: Implement a fault injection library.
Comment 5 Mathieu Duponchelle 2015-02-02 20:24:39 UTC
(In reply to comment #3)
> Review of attachment 295960 [details] [review]:
> 
> ::: validate/configure.ac
> @@ +64,3 @@
> 
> +dnl Tiny library overriding calls such as socket recv / send
> +FAULTINJECTION_LIBS="-L$(top_srcdir)/fault_injection/.libs/
> -lfaultinjection-$GST_API_VERSION"
> 
> That does not look right (ie. specifiing .libs)

Indeed, and it's not needed

> 
> ::: validate/gst/validate/Makefile.am
> @@ +47,3 @@
>  lib_LTLIBRARIES = libgstvalidate-@GST_API_VERSION@.la
> +libgstvalidate_@GST_API_VERSION@_la_CFLAGS = $(GST_ALL_CFLAGS)\
> +    $(GIO_CFLAGS) $(GST_PBUTILS_CFLAGS) -I$(top_srcdir)/fault_injection
> 
> I do not understand why you link Validate against that lib here?

As discussed on IRC, this is needed to implement the action. Furthermore, one can't register validate actions in a GstPlugin, as at the first inspection without the validate library being loaded the plugin will get blacklisted. We should rework this when we have a happy conclusion with https://bugzilla.gnome.org/show_bug.cgi?id=741260 in my opinion.

Resubmitted the patch with the ".libs" correction.
Comment 6 Mathieu Duponchelle 2015-02-02 20:25:25 UTC
Furthermore, one can't register validate actions in a GstPlugin's *init function*.
Comment 7 Thibault Saunier 2015-02-03 09:37:50 UTC
(In reply to comment #6)
> Furthermore, one can't register validate actions in a GstPlugin's *init
> function*.

Why not ?
Comment 8 Mathieu Duponchelle 2015-02-03 14:23:43 UTC
Created attachment 296023 [details] [review]
validate: Implement a fault injection library.

+ And implement a corrupt-socket-recv action
+ Only compile this on Linux, LD_PRELOAD won't work on Windows.

For now the registering of the action is done through
a call to socket_interposer_init, this will get better
when we refactor the action logic.
Comment 9 Thibault Saunier 2015-02-03 14:27:38 UTC
Review of attachment 296023 [details] [review]:

Fix that small issue and go ahead :)

::: validate/gst/validate/gst-validate-scenario.c
@@ +48,3 @@
+#include <socket_interposer.h>
+
+#include <netinet/in.h>

You should not include it here anymore
Comment 10 Mathieu Duponchelle 2015-02-03 14:31:53 UTC
commit 4ce91b98f015993583e1c7f1c7190afac8cb5258
Author: Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Date:   Fri Jan 30 18:52:57 2015 +0100

    validate: Implement a fault injection library.
    
    + And implement a corrupt-socket-recv action
    + Only compile this on Linux, LD_PRELOAD won't work on Windows.
    
    For now the registering of the action is done through
    a call to socket_interposer_init, this will get better
    when we refactor the action logic.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743871

Done :)
Comment 11 Mathieu Duponchelle 2015-02-03 14:32:42 UTC
Review of attachment 295961 [details] [review]:

reworked
Comment 12 Mathieu Duponchelle 2015-02-03 14:33:03 UTC
Review of attachment 296023 [details] [review]:

commited with that change :)