Subject: [clisp-list] readline & gcc 3.2 problem

From: "Vadim V. Zhytnikov" <[email-masked]>
Date: Sun Mar 2 10:05:53 2003

Several months ago wrote to the clisp-list about
problems which I experience with clisp 2.30 & clisp CVS.
Unfortunately I was not able to debug the problem more
thoroughly then and I'm doing it now.

The problem is that various readline operations
don't work as expected and may even crash clisp.
In particular if I just start clisp, press "a",
and then hit TAB then normally clisp beeps and
after second tab prints a list of symbols
whose names begins with a.  But in my case
first TAB causes stack overflow if libsigsegv
is present and core dump if libsigsegv is
absent.  Please, the the transcript below:

==========================================

Script started on Sun Mar  2 15:35:04 2003
[vadim@proxl src]$ LANG=C ./clisp
   i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo
   I I I I I I I      8     8   8           8     8     o  8    8
   I  \ `+' /  I      8         8           8     8        8    8
    \  `-+-'  /       8         8           8      ooooo   8oooo
     `-__|__-'        8         8           8           8  8
         |            8     o   8           8     o     8  8
   ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2003

[1]> a
*** - Program stack overflow. RESET
[2]> (quit)
Bye.
[vadim@proxl src]$
Script done on Sun Mar  2 15:35:28 2003

==========================================

My environment is:
Linux 2.4.18, glibc 2.2.6, readline 4.3.

I recompiled lisp with debug option and to my
astonishment problem magically disappeared!
So the same code compiled without debug crashes
and with debug works fine.  I've attached pieces
of strace log for both this cases.

I didn't mentioned yet that in all test I used
gcc 3.2.1.  So I tried to build clisp with the
with other available compilers namely gcc
2.95 and 2.95.3.  In both cases clisp
works fine and I don't observe any troubles
with readline.  It seems that there is
some subtle point concerning readline and
gcc 3.2 in clisp.

Can anybody reproduce the problem?
I'm ready to debug it further to pin
down the problem.

Best wishes,

Vadim

-- 
      Vadim V. Zhytnikov

       <[email-masked]>
      <[email-masked]>
read(0, "a", 1)                         = 1
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000
write(1, "a", 1)                        = 1
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(0, "\t", 1)                        = 1
open("/usr/lib/gconv/KOI8-R.so", O_RDONLY) = 9
read(9, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\6\0\000"..., 1024) = 1024
fstat64(9, {st_mode=S_IFREG|0755, st_size=7316, ...}) = 0
mmap2(NULL, 10328, PROT_READ|PROT_EXEC, MAP_PRIVATE, 9, 0) = 0x40021000
mprotect(0x40023000, 2136, PROT_NONE)   = 0
mmap2(0x40023000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 9, 0x1) = 0x40023000
close(9)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
mprotect(0x202b9000, 4096, PROT_READ|PROT_WRITE) = 0
sigreturn()                             = ? (mask now [])
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
open("/proc/self/maps", O_RDONLY)       = 9
fstat64(9, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40024000
read(9, "08048000-08173000 r-xp 00000000 "..., 4096) = 2936
close(9)                                = 0
munmap(0x40024000, 4096)                = 0
open("/usr/share/locale/ru_RU.KOI8-R/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/ru_RU.koi8r/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/ru_RU/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/ru.KOI8-R/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/ru.koi8r/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/ru/LC_MESSAGES/clisplow.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "\n*** - Program stack overflow. R"..., 36
*** - Program stack overflow. RESET) = 36
mmap2(0x202f2000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x202f2000
select(1024, [0], NULL, NULL, {0, 0})   = 0 (Timeout)
write(1, "\n", 1)                       = 1
write(1, "[2]> ", 5)                    = 5
fsync(1)                                = -1 EINVAL (Invalid argument)
read(0, "a", 1)                         = 1
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000
write(1, "a", 1)                        = 1
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(0, "\t", 1)                        = 1
open("/usr/lib/gconv/KOI8-R.so", O_RDONLY) = 9
read(9, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\6\0\000"..., 1024) = 1024
fstat64(9, {st_mode=S_IFREG|0755, st_size=7316, ...}) = 0
mmap2(NULL, 10328, PROT_READ|PROT_EXEC, MAP_PRIVATE, 9, 0) = 0x40021000
mprotect(0x40023000, 2136, PROT_NONE)   = 0
mmap2(0x40023000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 9, 0x1) = 0x40023000
close(9)                                = 0
write(2, "\7", 1)                       = 1
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(0, "\t", 1)                        = 1
mmap2(0x2034a000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2034a000
write(1, "\n", 1)                       = 1
write(1, "abort                       appl"..., 67) = 67
write(1, "abs                         apro"..., 73) = 73
write(1, "acons                       apro"..., 78) = 78
write(1, "acos                        aref"..., 73) = 73
write(1, "acosh                       argl"..., 79) = 79
write(1, "add-method                  arit"..., 60) = 60
write(1, "address                     arit"..., 61) = 61
write(1, "adjoin                      arit"..., 62) = 62
write(1, "adjustable-array-p          arra"..., 63) = 63
write(1, "adjust-array                arra"..., 62) = 62
write(1, "allocate-instance           arra"..., 65) = 65
write(1, "alpha-char-p                arra"..., 69) = 69
write(1, "alphanumericp               arra"..., 61) = 61
write(1, "and                         arra"..., 62) = 62
write(1, "appease-cerrors             arra"..., 61) = 61
write(1, "append                      arra"..., 57) = 57
write(1, "apply                       arra"..., 57) = 57
write(1, "[1]> a", 6)                   = 6

---

From: Sam Steingold <[email-masked]>
Date: Sun Mar 2 12:35:55 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] readline & gcc 3.2 problem"
> * Sent on Sun, 02 Mar 2003 17:08:42 +0300
> * Honorable "Vadim V. Zhytnikov" <[email-masked]> writes:
>

the problem starts with SAFETY<=1 (see lispbibl.d)
See <http://sourceforge.net/mailarchive/message.php?msg_id=3599900>

> I didn't mentioned yet that in all test I used gcc 3.2.1.  So I tried
> to build clisp with the with other available compilers namely gcc 2.95
> and 2.95.3.  In both cases clisp works fine and I don't observe any
> troubles with readline.  It seems that there is some subtle point
> concerning readline and gcc 3.2 in clisp.

> Can anybody reproduce the problem?
yes. plese see <http://clisp.cons.org/wanted.html#completion>

> I'm ready to debug it further to pin down the problem.

Please do, by all means!!!

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
(let((a'(list'let(list(list'a(list'quote a)))a)))`(let((a(quote ,a))),a))

---

From: Scott Williams <[email-masked]>
Date: Sun Mar 2 21:18:58 2003

I was perusing the wanted list when I saw that clisp wants a GUI. I had 
been working on slowly porting OpenGL (slowed by school, lack of 
knowledge about clisp, and lack of knowledge about OpenGL in general) so 
that I could write a GUI library for an application I'd been working on. 
In a different, unrelated project, I ran across www.picoGUI.org and 
www.fresco.org which both looked promising.

Fresco looks like it has more potential for coolness in the future, but 
PicoGUI works NOW. Does the list think either of these projects are 
worth supporting in clisp? From where I stand, the main advantage to 
supporting PicoGUI or Fresco is that they're neatly cross-platform and 
most of all, don't depend explicitly on FFI! (in fact, picoGUI 
developers discourage other languages from wrapping the C client library).

The downside is that I haven't perused the picogui client code all that 
much, and being a relatively inexperienced lisp programmer, the task of 
implementing the whole client seems a little daunting (but not wholly 
unwelcome).

Input?

-Scott

---

From: Sam Steingold <[email-masked]>
Date: Mon Mar 3 07:45:44 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] CLISP wanted: GUI"
> * Sent on Sun, 02 Mar 2003 22:15:59 -0700
> * Honorable Scott Williams <[email-masked]> writes:
>
> I ran across www.picoGUI.org and www.fresco.org which both looked
> promising.  Does the list think either of these projects are worth
> supporting in clisp?

From what I can glean from 30 sec at each web site, these are not GUI
toolkits but new window systems.
Interfacing with them will not bring GUI capabilities to CLISP running
on a woe32 or a Linux/X/GNOME/KDE.

I think it would be more valuable to either
- finish new-clx (for faster CLX in CLISP)
- finish&port the closure web browser to CLISP
  <http://www.stud.uni-karlsruhe.de/~unk6/closure/>
- finish&port the hemlock editor to CLISP
  <http://www.stud.uni-karlsruhe.de/~unk6/export/>

OTOH, I do not want to discourage you.
Pick your project and fire off!

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Parachute for sale, used once, never opened, small stain.

---

From: C Y <[email-masked]>
Date: Mon Mar 3 08:24:33 2003

--- Sam Steingold <[email-masked]> wrote:
> Interfacing with them will not bring GUI capabilities to CLISP
> running on a woe32 or a Linux/X/GNOME/KDE.
> 

You might also look at helping port the Garnet Lisp GUI toolkit to
Win32 and fixing up bitrot issues (http://garnetlisp.sf.net) or help
the McCLIM GUI toolkit project http://www.mikemac.com/mikemac/McCLIM/
which is more advanced than the website would lead you to believe.  I
think closure is being reimplimented in McCLIM, but the author hasn't
released his code to the public yet.

CY

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

---

From: Dan Stanger <[email-masked]>
Date: Mon Mar 3 09:45:06 2003

As someone who has some experience with porting gui's I think the easiest
thing to do is to make garnet work on win32.  We are close to that,
I planned to work on it as soon as I finish packing my house, in
preparing to move.  Then, we should concentrate on McClim, as that
is the most modern lisp gui, which would make clisp more functionally
compatible
with modern lisps.
Dan Stanger

Scott Williams wrote:

> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> clisp-list mailing list
> [email-masked]
> https://lists.sourceforge.net/lists/listinfo/clisp-list