I've run into this myself in Ubuntu 18.04 and 18.10.
I have not found any "eval" command that does not cause bsd-csh to die
with a segmentation fault. For example:
$ bsd-csh -f
% eval date
Segmentation fault (core dumped)
I downloaded the source tarball for csh_20110502, compiled it with "gcc
-g", and reproduced the problem under gdb:
$ gdb ./csh
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./csh...done.
(gdb) run -f
Starting program: /home/kst/src/csh/csh-20110502/csh -f
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
% eval date
Program received signal SIGSEGV, Segmentation fault.
0x000055555556e369 in readc (wanteof=0) at lex.c:1330
1330 if (*(evalp = *evalvec) != '\0') {
(gdb) where
#0 0x000055555556e369 in readc (wanteof=0) at lex.c:1330
#1 0x000055555556b66f in getC1 (flag=3) at lex.c:384
#2 0x000055555556b440 in word () at lex.c:329
#3 0x000055555556ac94 in lex (hp=0x555555783450 <paraml>) at lex.c:164
#4 0x000055555555a9f0 in process (catch=0) at csh.c:1046
#5 0x0000555555567f44 in doeval (v=0x55555578af60, t=0x55555578ae80) at
func.c:1396
#6 0x0000555555564daf in func (t=0x55555578ae80, bp=0x555555781018
<bfunc+408>) at func.c:113
#7 0x000055555557589b in execute (t=0x55555578ae80, wanttty=6242,
pipein=0x0, pipeout=0x0) at sem.c:370
#8 0x0000555555575b78 in execute (t=0x55555578ae40, wanttty=6242,
pipein=0x0, pipeout=0x0) at sem.c:418
#9 0x000055555555ab48 in process (catch=1) at csh.c:1088
#10 0x0000555555559375 in main (argc=0, argv=0x7fffffffe638) at csh.c:553
(gdb) quit
A debugging session is active.
Inferior 1 [process 6242] will be killed.
Quit anyway? (y or n) y
$
I'll note that this problem has not inconvenienced me, and I expect that
most csh users would be using tcsh, which is not affected by this bug.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1739505
Title:
segfault on simple script that involves eval
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/csh/+bug/1739505/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs