bug-bash
[Top][All Lists]
Advanced

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

Re: building 5.1.3 -- some probs...


From: L A Walsh
Subject: Re: building 5.1.3 -- some probs...
Date: Mon, 22 Feb 2021 19:09:57 -0800
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

(Doi!) Forgot it was executing initial rc scripts.
Turned on -x since last statement seems pretty mundane.
Also 6 statements after where it claimed it crashed, is
a custom function for printing pwd for the prompt.

I've tried with different compile ops (optim vs. dbg).
with builtin readline and included readline
with bash-malloc set, and unset..

This isn't blocking anything, so no time pressure.
Thanks! & let me know if you want anything else...


locale has:

LANG=
LC_CTYPE=C.UTF-8
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=C
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
---

On 2021/02/22 18:22, Chet Ramey wrote:
You could start with the actual command that's dumping core (something in
one of your startup files) and your locale. A backtrace from the core dump
would help, too, but not as much.
attach is output from bash -x .. last line displayed in that
was line#288.
Starting from line 288, about 4 statements down are
the defines for a "short"-pwd (spwd)
for my prompt.
It might have been in that function -- as it seems it is the
only thing of any complexity. I skipped blank lines and some
comments.  Line number is line after the line# comment.

#line 285:
export LC_COLLATE=C
export MOUNT_PRINT_SOURCE=1
# line 288:
if [[ ! ${qUSER:-""} ]]; then
 printf -v qUSER "%q" $USER
 export qUSER
fi
# line 293:
export _home_prefix=${HOME%/*}/

# return a shortened path when displayed path would
# take up > 50% width of the screen
# line 306:
declare -a _als=( "_e=echo -En"  "ret=return" )
alias "${_als[@]}"
export __dpf__='local -a PF=(
               "/$1/$2/$3/…/\${$[$#-1]}/\${$#}"
               "/$1/$2/…/\${$[$#-1]}/\${$#}"
               "/$1/…/\${$[$#-1]}/\${$#}"
               "/$1/…/\${$#}"
               "…/\${$#}"
               "…" )'
line 314:
spwd () {  my _f_=""                      ;\
 [[ ${_f_:=${-//[^x]/}} ]] && set +$_f_  ;\
 (($#))|| { set "${PWD:=$(echo -En $(     \
 eval "{,{,/usr}/bin/}pwd 2>&-||:" ))}"  ;\
 (($#)) || ret 1; }                      ;\
 int w=COLUMNS/2                         ;\
 ( printf -v _p "%s" "$1" ; export IFS=/ ;\
   set $_p; shift; unset IFS             ;\
   t="${_p#$_home_prefix}"               ;\
   int tl=${#t}                          ;\
   if (($#<=6 && tl<w));then ((tl<=2)) && \
     { _e "$_p"; set -$_f_;  ret 0; }    ;\
   else                                   \
     eval "$__dpf__"                     ;\
     int i pfl=${#PF[*]}                 ;\
     for ((i=0; i<pfl; ++i)); do eval     \
       "printf -v _pa %s \"${PF[i]}\""   ;\
       _p="$(eval "echo -En \"$_pa\"")"  ;\
       ((${#_p}<w)) && break;  done      ;\
   fi                                    ;\
   _e -En "${_p#$_home_prefix}" )        ;\
   set -$_f_                             ;\
}

unalias "${_als[@]%=*}"; unset _als

--------------------
Stacktrace:
Ishtar:tools/bash/bash-5.1> gdb ./bash core
Reading symbols from ./bash...done.
[New LWP 42448]
Core was generated by `./bash -x'.
Program terminated with signal SIGABRT, Aborted.
#0  0x0000003000238d8b in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.29-1.2.x86_64
(gdb) where
#0  0x0000003000238d8b in raise () from /lib64/libc.so.6
#1  0x0000003000222612 in abort () from /lib64/libc.so.6
#2  0x0000000000451933 in programming_error ()
#3  0x00000000004e8d93 in xbotch (mem=mem@entry=0x54e460, e=e@entry=2,
   s=s@entry=0x507308 "free: called with unallocated block argument",
file=file@entry=0x4ef0b0 "subst.c", line=line@entry=4751) at malloc.c:376
#4  0x00000000004e8f1a in internal_free (mem=0x54e460,
   file=0x4ef0b0 "subst.c", line=4751, flags=flags@entry=1) at malloc.c:974
#5 0x00000000004e9b58 in sh_free (mem=<optimized out>, file=<optimized out>,
   line=<optimized out>) at malloc.c:1380
#6  0x000000000049e3d5 in sh_xfree ()
#7  0x0000000000467829 in remove_pattern ()
#8  0x0000000000468c8a in parameter_brace_remove_pattern ()
#9  0x0000000000471b4e in parameter_brace_expand ()
#10 0x00000000004726fa in param_expand ()
#11 0x0000000000473a71 in expand_word_internal ()
#12 0x0000000000476fa2 in shell_expand_word_list ()
#13 0x0000000000477292 in expand_word_list_internal ()
#14 0x00000000004760d5 in expand_words ()
#15 0x0000000000445d15 in execute_simple_command ()
#16 0x000000000043f850 in execute_command_internal ()
#17 0x00000000004a4f54 in parse_and_execute (string=<optimized out>,
   from_file=from_file@entry=0x5f7390 "/etc/local/aliases.sh",
   flags=flags@entry=20) at evalstring.c:489
#18 0x00000000004a4306 in _evalfile (
   filename=0x5f7390 "/etc/local/aliases.sh", flags=14) at evalfile.c:285
#19 0x00000000004a441d in source_file (
   filename=filename@entry=0x5f7390 "/etc/local/aliases.sh",
   sflags=sflags@entry=0) at evalfile.c:380
#20 0x00000000004aebf7 in source_builtin (list=0x5f80b0) at ./source.def:195
#21 0x0000000000446b1e in execute_builtin ()
#22 0x0000000000447a1e in execute_builtin_or_function ()
#23 0x0000000000446420 in execute_simple_command ()
#24 0x000000000043f850 in execute_command_internal ()
#25 0x000000000043ecda in execute_command ()
#26 0x0000000000442aeb in execute_connection ()
#27 0x000000000043fc92 in execute_command_internal ()
#28 0x000000000043ecda in execute_command ()
#29 0x0000000000444791 in execute_if_command ()
---Type <return> to continue, or q <return> to quit---
#30 0x000000000043fb8f in execute_command_internal ()
#31 0x00000000004a4f54 in parse_and_execute (string=<optimized out>,
   from_file=from_file@entry=0x5fd150 "/etc/local/bashrc.sh",
   flags=flags@entry=20) at evalstring.c:489
#32 0x00000000004a4306 in _evalfile (filename=0x5fd150 "/etc/local/bashrc.sh",
   flags=14) at evalfile.c:285
#33 0x00000000004a441d in source_file (
   filename=filename@entry=0x5fd150 "/etc/local/bashrc.sh",
   sflags=sflags@entry=0) at evalfile.c:380
#34 0x00000000004aebf7 in source_builtin (list=0x5f9410) at ./source.def:195
#35 0x0000000000446b1e in execute_builtin ()
#36 0x0000000000447a1e in execute_builtin_or_function ()
#37 0x0000000000446420 in execute_simple_command ()
#38 0x000000000043f850 in execute_command_internal ()
#39 0x00000000004a4f54 in parse_and_execute (string=<optimized out>,
   from_file=from_file@entry=0x5f71d0 "/home/law/.bashrc",
   flags=flags@entry=20) at evalstring.c:489
#40 0x00000000004a4306 in _evalfile (
   filename=filename@entry=0x5f71d0 "/home/law/.bashrc", flags=9)
   at evalfile.c:285
#41 0x00000000004a4358 in maybe_execute_file (fname=<optimized out>,
   force_noninteractive=1) at evalfile.c:330
#42 0x0000000000427111 in run_startup_files ()
#43 0x0000000000426661 in main ()

Attachment: bash_start.txt.xz
Description: application/xz-compressed-tar


reply via email to

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