I've found the cause of the problem. It can be fixed by grabbing the latest csh sources from OpenBSD and removing one of the Debian patches.
I've examined the csh sources obtained by running "apt-get source csh", and the upstream OpenBSD csh sources from https://github.com/openbsd/src . In the OpenBSD version from which the Debian/Ubuntu version was copied, lex.c contains the following lines: if ((evalp = *evalvec) != '\0') { evalvec++; goto top; } evalp is a pointer, so the comparison should be to NULL, not '\0'. debian/patches/pointer_deref_comparison.patch changes the first line to: if (*(evalp = *evalvec) != '\0') { This fixes the compiler warning for comparing a pointer to '\0', but it causes a segmentation fault if &evalvec is a null pointer -- which happens whenever the "eval" command is invoked. It's line 1330 of lex.c in the patched csh 20110502-3 sources on Ubuntu 18.04.2 LTS package. A later OpenBSD version of the csh sources changes that line to: if ((evalp = *evalvec) != NULL) { The change was made in commit bdb0dae4088 in https://github.com/openbsd/src on 2018-09-19 The same problem occurs with csh 20110502-4 on Debian 10. -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs