Bug 232901 - multimedia/librtmp: patch Broken
Summary: multimedia/librtmp: patch Broken
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ben Woods
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2018-11-02 05:44 UTC by takefu
Modified: 2018-12-07 07:07 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (hrs)
koobs: merge-quarterly?


Attachments
Failure script (4.08 KB, text/plain)
2018-12-07 07:07 UTC, takefu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description takefu 2018-11-02 05:44:49 UTC
bug #231940 after application rtmpdump(1) core dumps and dies

The patch for OpenSSL-1.1 is broken.
The core dump is vomited just before the start of communication even if build is completed and it dies.


> /usr/local/bin/rtmpdump -v -r rtmpe://f-radiko.smartstream.ne.jp --app OBC/_definst_ --playpath simul-stream.stream -W http://radiko.jp/apps/js/flash/myplayer-release.swf -C S: -C S: -C S: -C S:2t0YoVV-4fCMPhwpUT8HDA --live --flv OBC_2018-11-02-14_04.flv
> RTMPDump v2.4
> (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
> WARNING: No application or playpath in URL!
> Segmentation fault (core dumped)
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-02 05:53:17 UTC
Note that the original commit (ports rr482833) of bug 231940, was then reverted in ports r482870 due to breaking librtmp consumers.

The last commit (ports r482967) then landed and merged.

Please make sure you have updated your tree past r482967 and confirm that the issue is still reproducible.

Assign to committer of ports r482967 and CC antoine (who merged the last commit)
Comment 2 w.schwarzenfeld freebsd_triage 2018-11-02 07:09:09 UTC
I have libressl. With or without openssl patch:

The command core dumps.

If I quoted parts of the command:
rtmpdump -v -r "rtmpe://f-radiko.smartstream.ne.jp" --app "OBC/_definst_" --playpath "simul-stream.stream -W http://radiko.jp/apps/js/flash/myplayer-release.swf -C S: -C S: -C S: -C S:2t0YoVV-4fCMPhwpUT8HDA" --live --flv "OBC_2018-11-02-14_04.flv"

I got
c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
WARNING: No application or playpath in URL!
Failed to open file! OBC_2018-11-02-14_04.flv

and no segfault.

So I think it is not related to the patch.
Comment 3 takefu 2018-11-02 08:19:38 UTC
(In reply to w.schwarzenfeld from comment #2)

libressl does not dump the core.
However, if the patch file exists, the build will fail.
By removing the patch file added by r482870, The build succeeds in libressl.
Comment 4 takefu 2018-12-07 07:07:26 UTC
Created attachment 199920 [details]
Failure script

Japan is a service in the domestic streaming service `radiko.jp', which seems to be streaming at the time of capturing core dumps.

Results of a failed script run.

$ env LANG=C sh -x /usr/local/bin/rec_radiko MBS
+ pid=65215
+ env 'TZ=JST-09' date +%Y-%m-%d-%H_%M
+ date=2018-12-07-13_16
+ playerurl=http://radiko.jp/apps/js/flash/myplayer-release.swf
+ tmpdir=/tmp
+ cookiefile=/tmp/cookie.txt
+ playerfile=/tmp/player.swf
+ keyfile=/tmp/authkey.png
+ AUTH1=/tmp/auth1_fms_65215
+ AUTH2=/tmp/auth2_fms_65215
+ echo MBS
+ tr '[[a-z]]' '[[A-Z]]'
+ channel=MBS
+ [ 1 -eq 1 ]
+ output=MBS_2018-12-07-13_16.flv
+ [ ]
+ [ ! -f /tmp/player.swf ]
+ /usr/local/bin/wget -q -O /tmp/player.swf http://radiko.jp/apps/js/flash/myplayer-release.swf
+ [ 0 -ne 0 ]
+ [ ! -f /tmp/authkey.png ]
+ /usr/local/bin/swfextract -b 12 /tmp/player.swf -o /tmp/authkey.png
+ [ ! -f /tmp/authkey.png ]
+ rm -f /tmp/player.swf
+ [ -f /tmp/auth1_fms_65215 ]
+ /usr/local/bin/wget -q '--header=pragma: no-cache' '--header=X-Radiko-App: pc_ts' '--header=X-Radiko-App-Version: 4.0.0' '--header=X-Radiko-User: test-stream' '--header=X-Radiko-Device: pc' '--post-data=\r\n' --no-check-certificate --load-cookies /tmp/cookie.txt --save-headers -O /tmp/auth1_fms_65215 https://radiko.jp/v2/api/auth1_fms
+ [ 0 -ne 0 ]
+ /usr/local/bin/perl -ne 'print $1 if(/x-radiko-authtoken: ([\w-]+)/i)' /tmp/auth1_fms_65215
+ authtoken=JJXlJFbFfTn4CWkXcW8iIg
+ /usr/local/bin/perl -ne 'print $1 if(/x-radiko-keyoffset: (\d+)/i)' /tmp/auth1_fms_65215
+ offset=105274
+ /usr/local/bin/perl -ne 'print $1 if(/x-radiko-keylength: (\d+)/i)' /tmp/auth1_fms_65215
+ length=16
+ dd 'if=/tmp/authkey.png' 'bs=1' 'skip=105274' 'count=16'
+ openssl enc -base64
+ partialkey='3kf/AFv1pZHAX7ikg8cY6w=='
+ printf 'authtoken: JJXlJFbFfTn4CWkXcW8iIg \noffset: 105274 length: 16 \npartialkey: 3kf/AFv1pZHAX7ikg8cY6w=='
authtoken: JJXlJFbFfTn4CWkXcW8iIg
offset: 105274 length: 16
partialkey: 3kf/AFv1pZHAX7ikg8cY6w==+ rm -f /tmp/authkey.png /tmp/auth1_fms_65215
+ [ -f /tmp/auth2_fms_65215 ]
+ /usr/local/bin/wget -q '--header=pragma: no-cache' '--header=X-Radiko-App: pc_ts' '--header=X-Radiko-App-Version: 4.0.0' '--header=X-Radiko-User: test-stream' '--header=X-Radiko-Device: pc' '--header=X-Radiko-AuthToken: JJXlJFbFfTn4CWkXcW8iIg' '--header=X-Radiko-PartialKey: 3kf/AFv1pZHAX7ikg8cY6w==' '--post-data=\r\n' --load-cookies /tmp/cookie.txt --no-check-certificate -O /tmp/auth2_fms_65215 https://radiko.jp/v2/api/auth2_fms
+ [ 0 -ne 0 -o ! -f /tmp/auth2_fms_65215 ]
+ echo 'authentication success'
authentication success
+ /usr/local/bin/perl -ne 'print $1 if(/^([^,]+),/i)' /tmp/auth2_fms_65215
+ areaid=JP27
+ echo 'areaid: JP27'
areaid: JP27
+ rm -f /tmp/auth2_fms_65215
+ [ -f MBS.xml ]
+ /usr/local/bin/wget -q http://radiko.jp/v2/station/stream/MBS.xml
+ echo 'cat /url/item[1]/text()'
+ /usr/local/bin/xmllint --shell MBS.xml
+ tail -2
+ head -1
+ stream_url=rtmpe://f-radiko.smartstream.ne.jp/MBS/_definst_/simul-stream.stream
+ echo rtmpe://f-radiko.smartstream.ne.jp/MBS/_definst_/simul-stream.stream
+ /usr/local/bin/perl -pe 's!^(.*)://(.*?)/(.*)/(.*?)$/!$1://$2!'
+ url_parts0=rtmpe://f-radiko.smartstream.ne.jp
+ echo rtmpe://f-radiko.smartstream.ne.jp/MBS/_definst_/simul-stream.stream
+ /usr/local/bin/perl -pe 's!^(.*)://(.*?)/(.*)/(.*?)$/!$3!'
+ url_parts1=MBS/_definst_
+ echo rtmpe://f-radiko.smartstream.ne.jp/MBS/_definst_/simul-stream.stream
+ /usr/local/bin/perl -pe 's!^(.*)://(.*?)/(.*)/(.*?)$/!$4!'
+ url_parts2=simul-stream.stream
+ rm -f MBS.xml
+ /usr/local/bin/rtmpdump -v -r rtmpe://f-radiko.smartstream.ne.jp --app MBS/_definst_ --playpath simul-stream.stream -W http://radiko.jp/apps/js/flash/myplayer-release.swf -C S: -C S: -C S: -C S:JJXlJFbFfTn4CWkXcW8iIg --live --flv MBS_2018-12-07-13_16.flv
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
WARNING: No application or playpath in URL!
Segmentation fault (core dumped)
+ /usr/local/bin/wget -q --load-cookies /tmp/cookie.txt --no-check-certificate -O /dev/null https://radiko.jp/ap/member/webapi/member/logout
+ rm -f /tmp/cookie.txt
+ exit 0

Take a look at the core dumps in the debugger.

$ gdb -c rtmpdump.core /usr/local/bin/rtmpdump
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `/usr/local/bin/rtmpdump -v -r rtmpe://f-radiko.smartstream.ne.jp --app MBS/_defi'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/librtmp.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/librtmp.so.1
Reading symbols from /usr/lib/libssl.so.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssl.so.8
Reading symbols from /lib/libcrypto.so.8...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypto.so.8
Reading symbols from /lib/libz.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000800f27817 in EVP_MD_CTX_init () from /lib/libcrypto.so.8