#556 make-pipe-output-stream segfaults when sending data

segfault
closed-fixed
Sam Steingold
clisp (525)
5
2010-07-04
2010-07-03
No

This is on gentoo x86_64, with gentoo libsigsegv, ffcall, and clisp emerged.

The same occurs in emacs M-x shell, or directly in xterm.

[pjb@kuiper :0.0 ~]$ clisp -ansi -q -norc
[1]> (with-open-stream (out (ext:make-pipe-output-stream
"/bin/cat"
:external-format charset:utf-8
:buffered nil))
(loop for i below 1000 do (print i out)))

*** - handle_fault error2 ! address = 0x0 not in [0x333d3f000,0x333f8c8f8) !
SIGSEGV cannot be cured. Fault address = 0x0.
GC count: 0
Space collected by GC: 0
Run time: 0 7998
Real time: 62 315214
GC time: 0 0
Permanently allocated: 182192 bytes.
Currently in use: 3593960 bytes.
Free space: 862510 bytes.
Segmentation fault
[pjb@kuiper :0.0 ~]$ clisp --version
GNU CLISP 2.48 (2009-07-28) (built 3487176824) (memory 3487176952)
Software: GNU C 4.3.5
gcc -O2 -pipe -march=native -mno-tls-direct-seg-refs -Wa,--noexecstack -I/usr/include/db4.7 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -Wno-format-nonliteral -O -falign-functions=4 -pthread -DUNICODE -DMULTITHREAD -DPOSIX_THREADS -DDYNAMIC_FFI -I. -Wl,-O1 /usr/lib64/libreadline.so -lncurses -ldl /usr/lib64/libavcall.so /usr/lib64/libcallback.so -L/usr/lib64 -lsigsegv -L/usr/lib64 -lc
SAFETY=0 TYPECODES WIDE_HARD GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY
libsigsegv 2.8
libreadline 6.1
Features:
(READLINE REGEXP SYSCALLS I18N LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP
LISP=CL INTERPRETER MT SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI
GETTEXT UNICODE BASE-CHAR=CHARACTER WORD-SIZE=64 PC386 UNIX)
C Modules: (clisp i18n syscalls regexp readline)
Installation directory: /usr/lib64/clisp-2.48/
User language: ENGLISH
Machine: X86_64 (X86_64) kuiper.lan.informatimago.com [192.168.7.2]
[pjb@kuiper :0.0 ~]$ uname -a
Linux kuiper 2.6.34-gentoo-c5-kvm #8 SMP Fri Jul 2 19:19:27 CEST 2010 x86_64 Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz GenuineIntel GNU/Linux
[pjb@kuiper :0.0 ~]$

Discussion

  • Note: it also occurs with clisp-2.44.1 on debian lenny 32-bit (686):

    [pjb@mdi-development-1 localhost:10.0 |MDI| tools]$ fpm help

    ((2 44 1) (OR))
    *** - handle_fault error2 ! address = 0x0 not in [0x213a6004,0x215c12a4) !
    SIGSEGV cannot be cured. Fault address = 0x0.
    Permanently allocated: 107072 bytes.
    Currently in use: 3837576 bytes.
    Free space: 265182 bytes.
    Segmentation fault
    [pjb@mdi-development-1 localhost:10.0 |MDI| tools]$ uname -a
    Linux mdi-development-1 2.6.34-gentoo-r1 #1 SMP Sun Jun 27 07:02:04 UTC 2010 i686 GNU/Linux
    [pjb@mdi-development-1 localhost:10.0 |MDI| tools]$ /usr/bin/clisp --version
    GNU CLISP 2.44.1 (2008-02-23) (built 3427345644) (memory 3485752987)
    Software: GNU C 4.3.1
    i486-linux-gnu-gcc -g -O2 -Igllib -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -O2 -fexpensive-optimizations -falign-functions=4 -DUNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -I. -x none /usr/lib/libreadline.so -lncurses -ldl /usr/lib/libavcall.so /usr/lib/libcallback.so -L/usr/lib -lsigsegv
    SAFETY=0 HEAPCODES LINUX_NOEXEC_HEAPCODES GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY
    libsigsegv 2.5
    libreadline 5.2
    Features:
    (ASDF CLC-OS-DEBIAN COMMON-LISP-CONTROLLER BERKELEY-DB CLX-ANSI-COMMON-LISP CLX
    READLINE REGEXP SYSCALLS I18N LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP
    LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI
    GETTEXT UNICODE BASE-CHAR=CHARACTER PC386 UNIX)
    C Modules: (clisp i18n syscalls regexp readline linux clx bdb)
    Installation directory: /usr/lib/clisp-2.44.1/
    User language: ENGLISH
    Machine: I686 (I686) mdi-development-1

     
  • Sam Steingold
    Sam Steingold
    2010-07-04

    I guess this bug should serve as a reminder that buffering is a good thing! :-)

     
  • Sam Steingold
    Sam Steingold
    2010-07-04

    thank you for your bug report.
    the bug has been fixed in the CVS tree.
    you can either wait for the next release (recommended)
    or check out the current CVS tree (see http://clisp.cons.org\)
    and build CLISP from the sources (be advised that between
    releases the CVS tree is very unstable and may not even build
    on your platform).

     
  • Sam Steingold
    Sam Steingold
    2010-07-04

    • assigned_to: haible --> sds
    • status: open --> closed-fixed