Bug 264009 - shells/zsh: Core dumps on 13.1-RELEASE
Summary: shells/zsh: Core dumps on 13.1-RELEASE
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-15 23:31 UTC by Muhammad Moinur Rahman
Modified: 2022-07-11 21:44 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-05-15 23:31:56 UTC
After upgrading to 13.1-RELEASE and after second "freebsd-update install" and reboot I am getting:
root@nachtwache:~ # zsh
Bus error (core dumped)

Here is the backtrace:
root@nachtwache:~ # lldb -c zsh.core zsh
(lldb) target create "zsh" --core "zsh.core"
Core file '/root/zsh.core' (x86_64) was loaded.
(lldb) thread backtrace all
* thread #1, name = 'zsh', stop reason = signal SIGBUS
  * frame #0: 0x0000000800487ab3 libc.so.7`___lldb_unnamed_symbol4533 + 771
    frame #1: 0x0000000800488ae8 libc.so.7`___lldb_unnamed_symbol4538 + 200
    frame #2: 0x00000008004889d9 libc.so.7`___lldb_unnamed_symbol4537 + 25
    frame #3: 0x00000008004888ad libc.so.7`___lldb_unnamed_symbol4536 + 205
    frame #4: 0x0000000800488513 libc.so.7`setlocale + 1027
    frame #5: 0x0000000000261a35 zsh`zsh_main + 37
    frame #6: 0x000000000022da00 zsh`_start + 256

So far the pkgs should have backward ABI compatibility.
Comment 1 Colin Percival freebsd_committer freebsd_triage 2022-05-16 06:24:34 UTC
(From twitter:)
> After the pkg upgrade it’s just fine.

Am I right in understanding this to mean that you had an old version of zsh installed and after running `pkg upgrade` on FreeBSD 13.1 you no longer get a core dump?
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-05-16 14:34:19 UTC
(In reply to Colin Percival from comment #1)
No. I was running a current version. While upgrading across major/minor versions I use "pkg upgrade -fy" so it refetches and reinstalls all the existing pkgs too. 

But I have somewhat found a clue. This problem happened in 3 out 26 servers and all 3 had non-default LOCALES system-wide. This problem didn't occur on other systems where I had the default ones. And my poudriere make.conf has a line:

OPTIONS_UNSET+=NLS

So from my small brain I think that the locales might have played a role in this.
Comment 3 rainer 2022-05-18 08:59:53 UTC
I have this, too.


=>> Building shells/zsh
build started at Wed May 18 10:50:07 CEST 2022
port directory: /usr/ports/shells/zsh
package name: zsh-5.8.1
building for: FreeBSD 13_1-amd64-2022Q2-unified-job-06 13.1-RELEASE FreeBSD 13.1-RELEASE amd64
maintained by: bapt@FreeBSD.org
Makefile ident: 
Poudriere version: 3.3.7_1
Host OSVERSION: 1301000
Jail OSVERSION: 1301000
Job Id: 06

---Begin Environment---
SHELL=/bin/csh
OSVERSION=1301000
UNAME_v=FreeBSD 13.1-RELEASE
UNAME_r=13.1-RELEASE
BLOCKSIZE=K
MAIL=/var/mail/root
MM_CHARSET=UTF-8
LANG=C.UTF-8
STATUS=1
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
LOCALBASE=/usr/local
USER=root
LIBEXECPREFIX=/usr/local/libexec/poudriere
POUDRIERE_VERSION=3.3.7_1
MASTERMNT=/usr/local/poudriere/data/.m/13_1-amd64-2022Q2-unified/ref
POUDRIERE_BUILD_TYPE=bulk
PACKAGE_BUILDING=yes
SAVED_TERM=screen
PWD=/usr/local/poudriere/data/.m/13_1-amd64-2022Q2-unified/ref/.p/pool
P_PORTS_FEATURES=FLAVORS SELECTED_OPTIONS
MASTERNAME=13_1-amd64-2022Q2-unified
SCRIPTPREFIX=/usr/local/share/poudriere
OLDPWD=/usr/local/poudriere/data/.m/13_1-amd64-2022Q2-unified/ref/.p
SCRIPTPATH=/usr/local/share/poudriere/bulk.sh
POUDRIEREPATH=/usr/local/bin/poudriere
---End Environment---

---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=
DEPENDS_ARGS=
MAKE_ARGS=
---End Poudriere Port Flags/Env---

...


mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Solaris
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Solaris
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/openSUSE
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/openSUSE
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Unix
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Unix
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/X
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/X
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Zsh
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Completion/Zsh
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Zle
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/functions/Zle
/bin/sh ../mkinstalldirs /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/man/man1
for file in zsh.1 zshbuiltins.1 zshcalsys.1 zshcompctl.1 zshcompwid.1 zshcompsys.1  zshcontrib.1 zshexpn.1 zshmisc.1 zshmodules.1  zshoptions.1 zshparam.1 zshroadmap.1 zshtcpsys.1 zshzftpsys.1 zshzle.1  zshall.1; do  test -s $file || exit 1;  install  -m 0644 $file /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/man/man1/`echo $file | sed 's|zsh|zsh|'` || exit 1;  done
if test x"/usr/local/share/zsh/5.8.1/help" != x""; then  /bin/sh ../mkinstalldirs /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help;  install  -m 0644 help/* /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help;  while read from to; do  rm -f /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help/$to || : ;  ln -s $from /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help/$to;  done < help.txt;  fi
mkdir /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help
chmod 755 /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/5.8.1/help
/bin/mkdir -p /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/share/zsh/site-functions
/bin/ln -f /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/bin/zsh /wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/bin/rzsh
(/wrkdirs/usr/ports/shells/zsh/work/stage/usr/local/bin/zsh -fc '  setopt extendedglob nomark_dirs;  cd /wrkdirs/usr/ports/shells/zsh/work/stage//usr/local/share/zsh/5.8.1 ;  rm -f functions/**/*.orig ;  for i in functions/**/*(/) ; do  zcompile -U -M $i.zwc $i/*~*.zwc(^/) ;  /bin/chmod 644 $i.zwc ;  done')
*** Signal 10

Stop.
make: stopped in /usr/ports/shells/zsh
=>> Cleaning up wrkdir
===>  Cleaning for zsh-5.8.1
build of shells/zsh | zsh-5.8.1 ended at Wed May 18 10:52:16 CEST 2022
build time: 00:02:09
!!! build failure encountered !!!
root@bsd1-build-prod:~ # 


options:
# This file is auto-generated by 'make config'.
# Options for zsh-5.2_2
_OPTIONS_READ=zsh-5.2_2
_FILE_COMPLETE_OPTIONS_LIST=DEBUG DOCS ETCDIR EXAMPLES GDBM MAILDIR MEM PCRE SECURE_FREE STATIC
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_UNSET+=ETCDIR
OPTIONS_FILE_SET+=EXAMPLES
OPTIONS_FILE_UNSET+=GDBM
OPTIONS_FILE_SET+=MAILDIR
OPTIONS_FILE_SET+=MEM
OPTIONS_FILE_SET+=PCRE
OPTIONS_FILE_SET+=SECURE_FREE
OPTIONS_FILE_SET+=STATIC
root@bsd1-build-prod:~ # 


locale output:

LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

I don't really set any locales. When I install, I use the default charset etc.

I do run zsh as my main shell - is that a problem?
Comment 4 rainer 2022-05-18 09:01:55 UTC
I am trying to upgrade the build-host to 13.1 - it's currently running 13.1 but 13.0 pkgs.

I usually, do a freebsd-update -r then run a build-run, upgrade the packages and then do another clean-slate build-run.
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-05-18 09:32:06 UTC
(In reply to rainer from comment #3)
This is the culprit:
OPTIONS_FILE_SET+=MEM

Try disabling it.
Comment 6 rainer 2022-05-18 09:47:52 UTC
ok, it does build now - thanks a lot!
Comment 7 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-05-18 09:55:29 UTC
(In reply to rainer from comment #6)
Good that it worked. The MEM option often breaks stuff; so it's better to avoid it. 
And this is not the relevant problem we are trying to discuss here.