Skip to contentSkip to conversation

gstreamer: fix argument parsing when using Bison 3]

PATCH Marcel Ziswiler 1 participant 1 message Mar 25, 2016 1 message not in the archive

lore
Share & tools
lore

Marcel Ziswiler

author Tested-by
#1 lore raw
In reply to a message not in the archive

Hi Stefan

Thanks, mate! I owe you a couple beers (;-p). Happy Easter and cu soon in Seattle.

Cheers

Marcel

Quoted 11 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Remove the argument fix patch and add a patch which fixes the grammer.y Bison input file. YYLEX_PARAM seems to be no longer supported and has been replaced with %parse-param which has been introduced already in 2003.

This fixes a segmentation fault when launching gst-launch-0.10.

Quoted 165 lines

---
This is the stack trace of the segmentation fault:
(gdb) bt
#0  priv_gst_parse_yylex (yylval_param=yylval_param@entry=0xbe8a4224, yyscanner=0xc8) at lex.priv_gst_parse_yy.c:1153
#1  0x4022d712 in priv_gst_parse_yyparse (scanner=<optimized out>, gr aph=graph@entry=0xbe8a47ec) at grammar.tab.c:1821
#2  0x4022f18c in priv_gst_parse_launch (
    str=0x94f28 "filesrc location=/home/root_2p_key60_q90_aac128_44.mp4 ! qtdemuxemux demux.video_00 ! nv_omx_h264dec ! nv_gl_eglimagesink demux.audio_00 ! nv_omx_aacdec ! alsasink device=hw:0,0 ", error=error@entry=0xbe8a4910, ctx=ctx@entry=0x0, flags=flags@entr y=GST_PARSE_FLAG_NONE) at /usr/src/debug/gstreamer/0.10.36- r2/gstreamer-0.10.36/gst/parse/grammar.y:927
#3  0x402277b8 in gst_parse_launch_full ( pipeline_description=0x94f28 "filesrc location=/home/root_2p_key60_q90_aac128_44.mp4 ! qtdemuxemux demux.video_00 ! nv_omx_h264dec ! nv_gl_eglimagesink demux.audio_00 ! nv_omx_aacdec ! alsasink device=hw:0,0 ", context=context@entry=0x0, flags=flags@entry=GST_PARSE_FLAG_NONE, error=error@entry=0xbe8a4910) at /usr/src/debug/gstreamer/0.10.36-r2/gstreamer- 0.10.36/gst/gstparse.c:336
#4  0x40227968 in gst_parse_launchv_full (argv=argv@entry=0x7ad50, co ntext=context@entry=0x0, flags=flags@entry=GST_PARSE_FLAG_NONE, error =error@entry=0xbe8a4910)
    at /usr/src/debug/gstreamer/0.10.36-r2/gstreamer- 0.10.36/gst/gstparse.c:272
#5  0x402279f2 in gst_parse_launchv (argv=argv@entry=0x7ad50, error=e rror@entry=0xbe8a4910) at /usr/src/debug/gstreamer/0.10.36- r2/gstreamer-0.10.36/gst/gstparse.c:224
#6  0x0000a6d8 in main (argc=16, argv=0xbe8a4ca4) at /usr/src/debug/gstreamer/0.10.36-r2/gstreamer-0.10.36/tools/gst- launch.c:1031

 ...01-parse-make-grammar.y-work-with-Bison-3.patch | 35
++++++++++++++++++++++
 ...mer-change-priv_gst_parse_yylex-arguments.patch | 33 ------------
--------
 .../gstreamer-0.10/gstreamer_0.10.36.bb            |  2 +-

 3 files changed, 36 insertions(+), 34 deletions(-)

 create mode 100644 meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison- 3.patch
 delete mode 100644 meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer-0.10.36/gstreamer-change-priv_gst_parse_yylex- arguments.patch

(quoted diff) +0 -0

0.10/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison- 3.patch b/meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer-0.10.36/0001-parse-make-grammar.y-work-with-Bison- 3.patch
new file mode 100644
index 0000000..dc2d606

meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer- new file +0 -0

0.10.36/0001-parse-make-grammar.y-work-with-Bison-3.patch

meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer- new file +1 -0
@@ -0,0 +1,35 @@
+From 60516f4798894f958fc53b470e1283318d0f8706 Mon Sep 17 00:00:00

2001

meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer- new file +24 -0
+From: Kerrick Staley <[email protected]>
+Date: Tue, 20 Aug 2013 23:59:29 -0700
+Subject: [PATCH 1/2] parse: make grammar.y work with Bison 3
+
+YYLEX_PARAM is no longer supported in Bison 3.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=706462
+---
+ gst/parse/grammar.y | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
+index 24fc87b..7f9dd16 100644
+--- a/gst/parse/grammar.y
++++ b/gst/parse/grammar.y
+@@ -26,7 +26,6 @@
+  */
+ 
+ #define YYERROR_VERBOSE 1
+-#define YYLEX_PARAM scanner
+ 
+ #define YYENABLE_NLS 0
+ 
+@@ -648,6 +647,7 @@ static int yyerror (void *scanner, graph_t

*graph, const char *s);
+ %right '.'
+ %left '!' '='
+
++%lex-param { void *scanner }
+ %parse-param { void *scanner }
+ %parse-param { graph_t *graph }
+ %pure-parser
+--
+2.7.2

meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer- new file +1 -0
+
(quoted diff) +0 -0

0.10/gstreamer-0.10.36/gstreamer-change-priv_gst_parse_yylex- arguments.patch b/meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer-0.10.36/gstreamer-change-priv_gst_parse_yylex- arguments.patch
deleted file mode 100644
index bf93cb2..0000000
--- a/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer- 0.10.36/gstreamer-change-priv_gst_parse_yylex-arguments.patch +++ /dev/null

(quoted diff) +0 -7
@@ -1,33 +0,0 @@
-gstreamer: change priv_gst_parse_yylex arguments
-
-Change priv_gst_parse_yylex to fit new bison version, else we will
-get following error:
-
-| grammar.tab.c: In function 'priv_gst_parse_yyparse':
-| grammar.tab.c:67:25: error: too few arguments to function

'priv_gst_parse_yylex'
-|  #define yylex           priv_gst_parse_yylex
-|                          ^

(quoted diff) +0 -17
-
-Upstream-Status: Pending
-
-Signed-off-by: Chong Lu <[email protected]>
----
- gst/parse/grammar.y | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gst/parse/grammar.y b/gst/parse/grammar.y
-index 24fc87b..24fe906 100644
---- a/gst/parse/grammar.y
-+++ b/gst/parse/grammar.y
-@@ -36,7 +36,7 @@
- 
- typedef void* yyscan_t;
- 
--int priv_gst_parse_yylex (void * yylval_param , yyscan_t

yyscanner);
-+int priv_gst_parse_yylex (yyscan_t yyscanner);
- int priv_gst_parse_yylex_init (yyscan_t scanner);
- int priv_gst_parse_yylex_destroy (yyscan_t scanner);
- struct yy_buffer_state * priv_gst_parse_yy_scan_string (char* , yyscan_t);
---
-1.9.1

(quoted diff) +0 -1
-
(quoted diff) +0 -0

0.10/gstreamer_0.10.36.bb b/meta-multimedia/recipes- multimedia/gstreamer-0.10/gstreamer_0.10.36.bb index 5b30603..ad7cf99 100644
--- a/meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer_0.10.36.bb
+++ b/meta-multimedia/recipes-multimedia/gstreamer- 0.10/gstreamer_0.10.36.bb

(quoted diff) +0 -0
@@ -15,7 +15,7 @@ SRC_URI = "http://gstreamer.freedesktop.org/src/gst

reamer/gstreamer-${PV}.tar.bz
            file://check_fix.patch \
            file://gst-inspect-check-error.patch \
            file://0001-baseparse-Fix-self-comparison-always- evaluates-to-tr.patch \
-           file://gstreamer-change-priv_gst_parse_yylex- arguments.patch \
+           file://0001-parse-make-grammar.y-work-with-Bison-3.patch \
 "

 SRC_URI[md5sum] = "a0cf7d6877f694a1a2ad2b4d1ecb890b"