read builtin goes into uninterruptible loop if input only contains zeros

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

read builtin goes into uninterruptible loop if input only contains zeros

Siteshwar Vashisht-2
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g -O0 -Wno-parentheses -Wno-format-security
uname output: Linux localhost.localdomain 4.11.6-201.fc25.x86_64 #1 SMP Tue Jun 20 20:21:11 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release

Description:
        read builtin goes into uninterruptible loop if input comes from /dev/zero.

Repeat-By:
        read -N 1 _ < /dev/zero

Fix:
        Attached patch fixes the bug.


--
--
Siteshwar Vashisht

0001-Make-read-builtin-interruptible-if-input-contains-ze.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read builtin goes into uninterruptible loop if input only contains zeros

Siteshwar Vashisht-2
Modified the patch to print warning only once when null byte is ignored.

----- Original Message -----

> From: "Siteshwar Vashisht" <[hidden email]>
> To: [hidden email]
> Sent: Friday, July 28, 2017 3:59:15 PM
> Subject: read builtin goes into uninterruptible loop if input only contains zeros
>
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
> -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale'
> -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g
> -O0 -Wno-parentheses -Wno-format-security
> uname output: Linux localhost.localdomain 4.11.6-201.fc25.x86_64 #1 SMP Tue
> Jun 20 20:21:11 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-unknown-linux-gnu
>
> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
>
> Description:
>         read builtin goes into uninterruptible loop if input comes from
>         /dev/zero.
>
> Repeat-By:
>         read -N 1 _ < /dev/zero
>
> Fix:
>         Attached patch fixes the bug.
>
>
> --
> --
> Siteshwar Vashisht
>
--
--
Siteshwar Vashisht

0001-Make-read-builtin-interruptible-if-input-contains-ze.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read builtin goes into uninterruptible loop if input only contains zeros

Chet Ramey
In reply to this post by Siteshwar Vashisht-2
On 7/28/17 9:59 AM, Siteshwar Vashisht wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
>
> Description:
>         read builtin goes into uninterruptible loop if input comes from /dev/zero.

Thanks for the report. This was fixed at the end of June, and the fix is in
the devel branch.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [hidden email]    http://cnswww.cns.cwru.edu/~chet/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: read builtin goes into uninterruptible loop if input only contains zeros

Siteshwar Vashisht-2


----- Original Message -----
> From: "Chet Ramey" <[hidden email]>
> To: "Siteshwar Vashisht" <[hidden email]>, [hidden email]
> Cc: "chet ramey" <[hidden email]>
> Sent: Sunday, July 30, 2017 4:33:09 PM
> Subject: Re: read builtin goes into uninterruptible loop if input only contains zeros
>
> Thanks for the report. This was fixed at the end of June, and the fix is in
> the devel branch.

Thanks for pointing to the fix, however I see that the fix is missing a warning about ignoring null character. You might want to add it.

>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    [hidden email]    http://cnswww.cns.cwru.edu/~chet/
>

--
--
Siteshwar Vashisht

Loading...