• Bug#868876: xvfb-run: 2>&1 breaks wkhtmltopdf

    From Frank Doepper@21:1/5 to All on Wed Jul 19 15:20:02 2017
    XPost: linux.debian.bugs.dist

    Package: xvfb
    Version: 2:1.12.4-6+deb7u7
    Severity: normal
    Tags: patch

    Dear Maintainer,

    * What led up to the situation?

    running
    xvfb-run -a --server-args="-screen 0, 2048x1536x24" /usr/bin/wkhtmltopdf $*

    * What exactly did you do (or not do) that was effective (or
    ineffective)?

    wkhtmltopdf outputs its result to stdout and other things to stderr

    * What was the outcome of this action?

    the data on the output was broken

    * What outcome did you expect instead?

    a usable output of the called program, which is not mixed up with
    stderr.

    Removing the 2>&1 from the exec line in xfvb-run solves this.

    --- /usr/bin/xvfb-run 2017-07-07 07:09:57.000000000 +0200
    +++ - 2017-07-19 14:07:29.727690002 +0200
    @@ -180,7 +180,7 @@

    # Start the command and save its exit status.
    set +e
    -DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
    +DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@"
    RETVAL=$?
    set -e



    -- System Information:
    Debian Release: 7.11
    APT prefers oldoldstable
    APT policy: (500, 'oldoldstable')
    Architecture: amd64 (x86_64)
    Foreign Architectures: i386

    Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
    Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
    Shell: /bin/sh linked to /bin/dash

    Versions of packages xvfb depends on:
    ii libaudit0 1:1.7.18-1.1
    ii libc6 2.13-38+deb7u12
    ii libgcrypt11 1.5.0-5+deb7u6
    ii libpixman-1-0 0.26.0-4+deb7u2
    ii libselinux1 2.1.9-5
    ii libxau6 1:1.0.7-1
    ii libxdmcp6 1:1.1.1-1
    ii libxfont1 1:1.4.5-5
    ii xserver-common 2:1.12.4-6+deb7u7

    Versions of packages xvfb recommends:
    ii xauth 1
  • From Sven Joachim@21:1/5 to All on Thu Jul 20 19:10:02 2017
    XPost: linux.debian.bugs.dist

    Control: found -1 xorg-server/1:1.0.2-6

    Am 19.07.2017 um 14:09 schrieb Frank Doepper:

    Package: xvfb
    Version: 2:1.12.4-6+deb7u7
    Severity: normal
    Tags: patch

    Dear Maintainer,

    * What led up to the situation?

    running
    xvfb-run -a --server-args="-screen 0, 2048x1536x24" /usr/bin/wkhtmltopdf $*

    * What exactly did you do (or not do) that was effective (or
    ineffective)?

    wkhtmltopdf outputs its result to stdout and other things to stderr

    * What was the outcome of this action?

    the data on the output was broken

    * What outcome did you expect instead?

    a usable output of the called program, which is not mixed up with
    stderr.

    Removing the 2>&1 from the exec line in xfvb-run solves this.

    --- /usr/bin/xvfb-run 2017-07-07 07:09:57.000000000 +0200
    +++ - 2017-07-19 14:07:29.727690002 +0200
    @@ -180,7 +180,7 @@

    # Start the command and save its exit status.
    set +e
    -DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
    +DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@"
    RETVAL=$?
    set -e

    Makes sense. FWIW, the bug has also been reported in Ubuntu a few years
    ago: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1059947.

    I did some research on snapshot.debian.org, and it seems this mixing of
    stderr and stdout has always been there since the xvfb-run script was
    added to the xvfb package.

    I'll commit the patch to git in a few days, unless somebody objects or
    beats me to it.

    Cheers,
    Sven

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sven Joachim@21:1/5 to All on Sat Jul 22 18:20:01 2017
    XPost: linux.debian.bugs.dist

    Control: tags -1 pending

    Am 20.07.2017 um 18:00 schrieb Sven Joachim:

    Control: found -1 xorg-server/1:1.0.2-6

    Am 19.07.2017 um 14:09 schrieb Frank Doepper:

    Package: xvfb
    Version: 2:1.12.4-6+deb7u7
    Severity: normal
    Tags: patch

    Dear Maintainer,

    * What led up to the situation?

    running
    xvfb-run -a --server-args="-screen 0, 2048x1536x24" /usr/bin/wkhtmltopdf $* >>
    * What exactly did you do (or not do) that was effective (or
    ineffective)?

    wkhtmltopdf outputs its result to stdout and other things to stderr

    * What was the outcome of this action?

    the data on the output was broken

    * What outcome did you expect instead?

    a usable output of the called program, which is not mixed up with
    stderr.

    Removing the 2>&1 from the exec line in xfvb-run solves this.

    --- /usr/bin/xvfb-run 2017-07-07 07:09:57.000000000 +0200
    +++ - 2017-07-19 14:07:29.727690002 +0200
    @@ -180,7 +180,7 @@

    # Start the command and save its exit status.
    set +e
    -DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
    +DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@"
    RETVAL=$?
    set -e

    Makes sense. FWIW, the bug has also been reported in Ubuntu a few years
    ago: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1059947.

    I did some research on snapshot.debian.org, and it seems this mixing of stderr and stdout has always been there since the xvfb-run script was
    added to the xvfb package.

    I'll commit the patch to git in a few days, unless somebody objects or
    beats me to it.

    Done that now, but it will take two almost years before it appears in a
    stable Debian release, so if you continue to use oldoldstable you will
    have to keep modifying xvfb-run locally for a while. ;-)

    Cheers,
    Sven

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)