[FFmpeg-devel] [PATCHv2] ffmpeg: modify tty state when stderr is redirected

Michael Niedermayer michael at niedermayer.cc
Mon Oct 12 14:19:02 CEST 2015

On Mon, Oct 12, 2015 at 08:03:03AM -0400, Ganesh Ajjanagadde wrote:
> On Mon, Oct 12, 2015 at 7:46 AM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > On Fri, Jul 31, 2015 at 01:48:18PM +0200, Nicolas George wrote:
> > [...]
> >>    -> "ttyctl -f" in ~/.zshrc, "bash_tty_mode=$(stty -g);
> >>    PROMPT_COMMAND='stty $bash_tty_mode'" in ~/.bashrc; that can be added in
> >>    the FAQ or the wiki.
> >
> >
> > the patch was applied and this does not work
> >
> > the first segfault i see breaks the terminal
> >
> > a testcase is a script like:
> > #!/bin/sh
> > valgrind ./ffmpeg_g -i matrixbench_mpeg2.mpg -encryption_key 0123456789abcdef0011223344556677  -encryption_iv aabbccddeeff11335577999876542222  crypto:file-crypt.nut
> >
> > (with the aesni patches or anything else that causes a segfault)
> >
> > ls -alF /bin/sh
> > lrwxrwxrwx 1 root root 4 Mar 29  2012 /bin/sh -> dash*
> > (this is default on ubuntu)
> Didn't we discuss this already in gory detail? You explicitly said
> that you withdrew your objection. The solution is simply to fix your
> shell with a 2 line solution given by Nicolas. Or are you saying that
> Nicolas's method does not work?

it doesnt work with dash

this testcase: (assuming it crashes)
valgrind ./ffmpeg_g -i ~/videos/matrixbench_mpeg2.mpg -encryption_key 0123456789abcdef0011223344556677  -encryption_iv aabbccddeeff11335577999876542222  crypto:file-crypt.nut  > tmp0 2>tmp2

when run under dash that is

will mess up your terminal to the point that you cannot even enter
exit or reset

i need to kill -KILL it from a 2nd terminal

it works if i use bash instead, which is what i do now

git revert  3ae98497c2fc6409828cdd1f2fad9ab244505581
make -j12 ffmpeg_g

does work, terminal works, exit works

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151012/8513a471/attachment.sig>

More information about the ffmpeg-devel mailing list