Opened 9 years ago

Last modified 7 years ago

#14426 closed defect

Runaway/Segfaulting ECL processes — at Version 17

Reported by: Jeroen Demeyer Owned by: Jeroen Demeyer
Priority: blocker Milestone: sage-5.9
Component: packages: standard Keywords:
Cc: Leif Leonhardy, Jean-Pierre Flori Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: Reported upstream. Developers acknowledge bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

On some systems, when executing

./sage -tp --long devel/sage/sage/interfaces/lisp.py

there are two ECL processes which do (strace log)

read(0, "(setq sage0 2)\n", 1024)       = 15
write(1, "\n", 1)                       = 1
write(1, "2", 1)                        = 1
write(1, "\n", 1)                       = 1
write(1, ">", 1)                        = 1
write(1, " ", 1)                        = 1
read(0, 0x7f2c263b1000, 1024)           = -1 EIO (Input/output error)
--- SIGHUP (Hangup) @ 0 (0) ---
--- SIGCONT (Continued) @ 0 (0) ---
select(1, [0], NULL, NULL, {0, 0})      = 1 (in [0], left {0, 0})
select(1, [0], NULL, NULL, {0, 0})      = 1 (in [0], left {0, 0})
read(0, "", 1024)                       = 0
write(2, "\n", 1)                       = -1 EIO (Input/output error)
write(2, "\n", 1)                       = -1 EIO (Input/output error)
write(2, "\n", 1)                       = -1 EIO (Input/output error)
write(2, "\n", 1)                       = -1 EIO (Input/output error)
[...]

after which they either segfault or keep running forever.

A different way to see this problem:

jdemeyer@boxen:/release/merger/sage-5.9.beta2$ ./sage --sh -c 'echo syntax error |ecl 2>/dev/full'
ECL (Embeddable Common-Lisp) 12.12.1 (git:UNKNOWN)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  
Top level.
> /bin/bash: line 1: 11264 Done                    echo syntax error
     11265 Segmentation fault      | ecl 2> /dev/full

upstream: https://sourceforge.net/p/ecls/bugs/257/

spkg: http://boxen.math.washington.edu/home/jdemeyer/spkg/ecl-12.12.1.p2.spkg (diff)

apply: 14426_doctest.patch

ecl-12.12.1.p2 (Jeroen Demeyer, 9 April 2013)

  • #14426: write_error.patch: avoid an infinite loop when reporting an error while writing to stderr.
  • Rename spkg-make to spkg-src.
  • Don't unset MAKEFLAGS (it was not clear why this was needed).
  • It seems no longer needed to disable Altivec.
  • Support ECL_CONFIGURE environment variable for options to ./configure.

Change History (17)

comment:1 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)
Summary: Runaway ECL processesRunaway/Segfaulting ECL processes

comment:2 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)

comment:3 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)

comment:4 Changed 9 years ago by Jeroen Demeyer

Component: doctest frameworkpackages: standard
Description: modified (diff)
Owner: changed from David Roe to Jeroen Demeyer

comment:5 Changed 9 years ago by Jeroen Demeyer

Authors: Jeroen Demeyer
Description: modified (diff)

comment:6 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)
Report Upstream: N/AReported upstream. No feedback yet.
Status: newneeds_review

comment:7 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)

comment:8 Changed 9 years ago by John Cremona

I am testing this now, on a machine which showed the problem up to now. I expect it to work since it's the machine on which Jeroen diagnosed the problem, so anyone else who saw the problem should test it too.

comment:9 Changed 9 years ago by Leif Leonhardy

Cc: Leif Leonhardy added

comment:10 Changed 9 years ago by Leif Leonhardy

Isn't the problem also that PExpect interfaces apparently do not properly get shut down?


The bug / patch should be (better) documented in the spkg; AFAICS there's not even a link to the upstream report there.

comment:11 Changed 9 years ago by Andrey Novoseltsev

Fixes the problem for me!

comment:12 Changed 9 years ago by John Cremona

I installed the spkg and patch and now almost no file can be doctested successfully. For example

      File "/home/jec/sage-5.9.beta4/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 80, in <module>
        ecl_eval("(require 'maxima)")
      File "ecl.pyx", line 1225, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:7102)
      File "ecl.pyx", line 1240, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:7039)
      File "ecl.pyx", line 246, in sage.libs.ecl.ecl_safe_eval (sage/libs/ecl.c:2901)
    RuntimeError: ECL says: Module error: Don't know how to REQUIRE MAXIMA.

comment:13 in reply to:  12 Changed 9 years ago by Leif Leonhardy

Replying to cremona:

I installed the spkg and patch and now almost no file can be doctested successfully. For example

      File "/home/jec/sage-5.9.beta4/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.py", line 80, in <module>
        ecl_eval("(require 'maxima)")
      File "ecl.pyx", line 1225, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:7102)
      File "ecl.pyx", line 1240, in sage.libs.ecl.ecl_eval (sage/libs/ecl.c:7039)
      File "ecl.pyx", line 246, in sage.libs.ecl.ecl_safe_eval (sage/libs/ecl.c:2901)
    RuntimeError: ECL says: Module error: Don't know how to REQUIRE MAXIMA.

You of course have to rebuild the spkgs that depend on ECL as well, i.e., Maxima, and do sage -b afterwards.

comment:14 Changed 9 years ago by Leif Leonhardy

FWIW, I think we met that "double-fault" problem with stderr before, quite a while ago, and IIRC discussed it with upstream, so it's a bit astonishing it's still in. (Although the circumstances were probably slightly different.)

comment:15 Changed 9 years ago by Leif Leonhardy

SPKG.txt lacks a "Patches" section, and the following "Special Update/Build? Instructions" should get corrected:

 * Note: the way we configure Sage, CXX and CXXFLAGS are unused.
 * Note: for the time being, ECL is built single threaded library as it
   seems to interact badly with the pexpect interface and Sage's signal
   handling when built multithreaded.

(Related to the first, printing the settings of CXX and CXXFLAGS in spkg-install then makes no sense.)

comment:16 Changed 9 years ago by Leif Leonhardy

As expected, for me solves the issues with ECL and (Ubuntu's) GNU Make 3.81 and the new doctesting framework on Ubuntu 10.04.4 LTS x86_64. (Haven't tested on x86 yet, but I assume it will fix the specific ECL issue there as well.)

Still, a working cleaner should have properly killed the processes, and it's not obvious what actually caused ECL running amok (i.e., why writing to stderr fails in the first place).

comment:17 Changed 9 years ago by Jeroen Demeyer

Description: modified (diff)

I made some further small changes to the spkg-install file.

Note: See TracTickets for help on using tickets.