bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash-4.2.53: HISTSIZE=-1 causes segfault on startup


From: tobbez
Subject: bash-4.2.53: HISTSIZE=-1 causes segfault on startup
Date: Mon, 8 May 2017 22:29:59 +0200 (CEST)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.2 
-L/home/abuild/rpmbuild/BUILD/bash-4.2/../readline-6.2
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' 
-DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -fmessage-length=0 
-grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector 
-funwind-tables -fasynchronous-unwind-tables -g  -D_GNU_SOURCE -DRECYCLES_PIDS 
-Wall -g -Wuninitialized -Wextra -Wno-unprototyped-calls -Wno-switch-enum 
-Wno-unused-variable -Wno-unused-parameter -ftree-loop-linear -pipe 
-DBNC382214=0 -DIMPORT_FUNCTIONS_DEF=0 -fprofile-use
uname output: Linux harbinger 4.1.38-50-default #1 SMP PREEMPT Sun Feb 19 
14:35:48 UTC 2017 (6b4d8cb) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 4.2
Patch Level: 53
Release Status: release

Description:
        Bash 4.3 introduced "-1" for unlimited history.

        Starting bash 4.2 with HISTSIZE=-1 in ~/.bashrc causes a segmentation
        fault (assuming you have a ~/.bash_history with at least one entry).
        This can easily happen if several systems (with different bash
        versions) mount the same home directory.

Repeat-By:
        $ cat > poc-bashrc <<EOF
        HISTSIZE=-1
        EOF
        # Make sure you have at least one entry in your history file!
        $ bash --rcfile ./poc-bashrc
        Segmentation fault (core dumped)

        # Here's the backtrace.
        (gdb) bt
        #0  0x00007ffff7bc4b43 in add_history_time 
(string=string@entry=0x755f30 "#1494270344") at ../history.c:323
        #1  0x00007ffff7bc7e84 in read_history_range 
(filename=filename@entry=0x6b3450 "[...]/.bash_history", from=from@entry=0, 
to=117, to@entry=-1) at ../histfile.c:277
        #2  0x00007ffff7bc7f5c in read_history 
(filename=filename@entry=0x6b3450 "[...]/.bash_history") at ../histfile.c:158
        #3  0x0000000000437521 in load_history () at bashhist.c:292
        #4  0x000000000041b417 in main (argc=3, argv=0x7fffffffe278, 
env=0x7fffffffe298) at shell.c:734



reply via email to

[Prev in Thread] Current Thread [Next in Thread]