Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

segfault/hangs with regexes, or due some other parsing issue...



Hey,

sorry for the vague subject. I've been trying to narrow this down to a
shorter test case but was unsuccessful.

zsh 4.3.11 (x86_64-unknown-linux-gnu) on Ubuntu 11.10 (Ubuntu's stock
package)

The attached script zsh-bug1.sh has serious issues ranging from zsh
segfaulting to it simply hanging. Different outcomes (segfault vs
hanging) can be achieved with small modifications. It should run
everywhere (it doesn't rely on a certain directory structure being
present). I've run it with "zsh -f zsh-bug1.sh", and it hangs directly
after outputting "looping" (it should simply exist afterwards,
obviously).

If I run its "proper" version (zsh-bug2.sh), e.g. replcae
"/doesnotexistdamnit" with the actual directory name, then it actually
segfaults:

--------------------------------------------------
[0 root@ls-bs-ws4 /daten/kundenprojekte] zsh -x -f ~mbunkus/test/zsh-bug2.sh
+/etc/zsh/zshenv:15> [[ -z /opt/rvm/gems/ruby-1.9.2-
p180/bin:/opt/rvm/gems/ruby-1.9.2-p180@global/bin:/opt/rvm/rubies/ruby-1.9.2-
p180/bin:/opt/rvm/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/local-
ls-bs-ws4/bin || /opt/rvm/gems/ruby-1.9.2-p180/bin:/opt/rvm/gems/ruby-1.9.2-
p180@global/bin:/opt/rvm/rubies/ruby-1.9.2-
p180/bin:/opt/rvm/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/local-
ls-bs-ws4/bin == /bin:/usr/bin ]]
+/home/mbunkus/test/zsh-bug2.sh:3> set -e
+/home/mbunkus/test/zsh-bug2.sh:4> setopt noclobber null_glob re_match_pcre
+/home/mbunkus/test/zsh-bug2.sh:25> process_dir dummy /root
+process_dir:2> local 'target=dummy'
+process_dir:3> shift
+process_dir:5> [[ ! -z /root ]]
+process_dir:6> [[ -d /root ]]
+process_dir:7> entries=( /root/essentials.txt '/root/essentials.txt~' 
/root/mysqldump.sql /root/packages.txt /root/pg_dumpall_5432.sql /root/.alias 
/root/.aptitude /root/.bash_history /root/.bashrc /root/.cache /root/.ccache 
/root/.gem /root/.gnupg /root/.inputrc /root/.joe_state /root/.lesshst 
/root/.local /root/.my.cnf /root/.mysql_history /root/.profile 
/root/.psql_history /root/.pulse /root/.pulse-cookie /root/.rvmrc 
/root/.screenrc /root/.screenrc-mbunkus /root/.ssh /root/.tramp_history 
/root/.Xauthority /root/.zsh /root/.zshenv /root/.zshhistfile )
+process_dir:8> [[ 32 -eq 0 ]]
+process_dir:11> print -- dummy//root
dummy//root
+process_dir:15> shift
+process_dir:5> [[ ! -z '' ]]
zsh: segmentation fault  zsh -x -f ~mbunkus/test/zsh-bug2.sh
--------------------------------------------------

Note that it happens whether I run as root or as a normal user.

Kind regards,
Moritz Bunkus

-- 
Dipl.-Inform. Moritz Bunkus
Prokurist/CTO

LINET Services GmbH | Am Alten Bahnhof 4b | 38122 Braunschweig
Tel. 0531-180508-0  | Fax 0531-180508-29  | http://www.linet-services.de

Geschäftsführung: Philip Reetz und Torsten Börner
HR B 9170 Amtsgericht Braunschweig

Attachment: zsh-bug1.sh
Description: application/shellscript

Attachment: zsh-bug2.sh
Description: application/shellscript

Attachment: signature.asc
Description: This is a digitally signed message part.



Messages sorted by: Reverse Date, Date, Thread, Author