unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* "class-of" causes segmentation fault when display'd
@ 2005-06-27 14:21 Alan Grover
  2005-06-27 23:05 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Grover @ 2005-06-27 14:21 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 6050 bytes --]

Environment:
* Guile 1.6.4
* Linux xxxxx 2.6.8-24.14-default #1 Tue Mar 29 09:27:43 UTC 2005 i686
i686 i386 GNU/Linux
* SuSE 9.2
buildstamp = Fri Dec  3 18:43:57 UTC 2004
LIBS =  -lqthreads -lpthread -lcrypt -lm
libguileinterface = 15:0:3

Summary:
Applying "class-of" causes segmentation fault if the (oop goops) module
is not loaded (and if the result is display'd). Works fine if the module
is loaded.

Steps to reproduce:
% guile -c '(display (class-of 1))'
; or
% guile -q
guile> (class-of 1)


Notes:
Does not seg-fault if the result is not displayed. 'write' and
'object->string' cause same behavior.

I find it odd that the procedure is defined (before (oop goops) is loaded).

Same behavior existed in previous guile release (1.4?).

Transcript:
; repl
% guile -q
guile> class-of
#<primitive-procedure class-of>
guile> (class-of 1)
Segmentation fault

; only if display'd
% guile -q
guile> (begin (class-of 1) (display "hello") (newline))
hello

; it's a true value
guile> (if (class-of 1) (display #t) (display #f)) (newline)
#t
guile>

; immediate code
% guile -c 'class-of'
% guile -c '(display class-of)'
#<primitive-procedure class-of
% guile -c '(class-of 1)'
% guile -c '(display (class-of 1))'
Segmentation fault

; same if -c or -s
% cat > x
(class-of 1)
% guile -s x
%

% cat > x
(display (class-of 1))
% guile -s x
Segmentation fault

; --debug has no effect
% guile --debug -c '(display (class-of 1))'
Segmentation fault
%

Backtrace:
I don't know when/why core files are created. This doesn't seem to leave
a core file (neither in ~ or cwd).

% gdb guile
gdb guile
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...(no debugging symbols
found)...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -c '(display (class-of 1))'
Starting program: /usr/bin/guile -c '(display (class-of 1))'
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...[Thread debugging using libthread_db enabled]
[New Thread 1076195456 (LWP 9267)]
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1076195456 (LWP 9267)]
0x400863c0 in scm_iprin1 () from /usr/lib/libguile.so.12
(gdb) bt
#0  0x400863c0 in scm_iprin1 () from /usr/lib/libguile.so.12
#1  0x40087220 in scm_prin1 () from /usr/lib/libguile.so.12
#2  0x40087683 in scm_display () from /usr/lib/libguile.so.12
#3  0x4005678d in scm_ceval () from /usr/lib/libguile.so.12
#4  0x400526b2 in scm_i_eval_x () from /usr/lib/libguile.so.12
#5  0x4005d79c in scm_primitive_eval_x () from /usr/lib/libguile.so.12
#6  0x40098378 in inner_eval_string () from /usr/lib/libguile.so.12
#7  0x4005edbc in scm_c_with_fluids () from /usr/lib/libguile.so.12
#8  0x4005eec9 in scm_c_with_fluid () from /usr/lib/libguile.so.12
#9  0x40076a85 in scm_c_call_with_current_module () from
/usr/lib/libguile.so.12
#10 0x400986ca in scm_eval_string () from /usr/lib/libguile.so.12
#11 0x4005631a in scm_ceval () from /usr/lib/libguile.so.12
#12 0x400555be in scm_ceval () from /usr/lib/libguile.so.12
#13 0x400526b2 in scm_i_eval_x () from /usr/lib/libguile.so.12
#14 0x4005d79c in scm_primitive_eval_x () from /usr/lib/libguile.so.12
#15 0x4005d7fd in inner_eval_x () from /usr/lib/libguile.so.12
#16 0x4004c785 in scm_internal_dynamic_wind () from /usr/lib/libguile.so.12
#17 0x40053f29 in scm_eval_x () from /usr/lib/libguile.so.12
#18 0x4008e99f in scm_shell () from /usr/lib/libguile.so.12
#19 0x400709e8 in scm_boot_guile () from /usr
#20 0x080489f9 in main ()
(gdb)

'strace' doesn't look helpful:

% strace guile -c '(display (class-of 1))'
...
open("/usr/share/guile/1.6/ice-9/rdelim.scm", O_RDONLY) = 4
fcntl64(4, F_GETFL)                     = 0 (flags O_RDONLY)
lseek(4, 0, SEEK_CUR)                   = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=6715, ...}) = 0
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, ";;; installed-scm-file\n\n;;;; Cop"..., 4096) = 4096
mmap2(NULL, 167936, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x4027d000
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, "t (car args)))\n\t\t     (set! args"..., 4096) = 2619
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, "", 4096)                       = 0
close(4)                                = 0
select(1024, [3], [], [], {0, 0})       = 1 (in [3], left {0, 0})
read(3, "", 4096)                       = 0
close(3)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

% strace guile -c '(class-of 1)'
...
open("/usr/share/guile/1.6/ice-9/rdelim.scm", O_RDONLY) = 4
fcntl64(4, F_GETFL)                     = 0 (flags O_RDONLY)
lseek(4, 0, SEEK_CUR)                   = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=6715, ...}) = 0
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, ";;; installed-scm-file\n\n;;;; Cop"..., 4096) = 4096
mmap2(NULL, 167936, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x4027d
000
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, "t (car args)))\n\t\t     (set! args"..., 4096) = 2619
select(1024, [4], [], [], {0, 0})       = 1 (in [4], left {0, 0})
read(4, "", 4096)                       = 0
close(4)                                = 0
select(1024, [3], [], [], {0, 0})       = 1 (in [3], left {0, 0})
read(3, "", 4096)                       = 0
close(3)                                = 0
exit_group(0)                           = ?

-- 
Alan Grover
awgrover@mail.msen.com
+1.734.476.0969



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

[-- Attachment #2: Type: text/plain, Size: 137 bytes --]

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-27 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 14:21 "class-of" causes segmentation fault when display'd Alan Grover
2005-06-27 23:05 ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).