unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* slib and scm_shell() conflicts
@ 2006-02-20  9:50 William Xu
  2006-02-21  1:00 ` Kevin Ryde
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: William Xu @ 2006-02-20  9:50 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Hi, 

I checked out a recent guile repo days ago. It seems there're some
conflictions between slib and scm_shell() function. 

Basically, when i try to load slib(i.e., guile.init), and invoke
scm_shell() thereafter, then the program will block there. `top' shows
the program is consuming lots of cpu time.

I have attached a reproducible testcase, consisting of three files,
foo.c, foo.scm and Makefile.

System Info: 

- Guile 1.9.0
- Debian Unstable GNU/Linux 2.6.14.3 #4, ppc
- slib in cvs and debian repo
- gcc (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6)

-- 
William

[-- Attachment #2: testcase.tar.gz --]
[-- Type: application/octet-stream, Size: 646 bytes --]

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

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

* Re: slib and scm_shell() conflicts
  2006-02-20  9:50 slib and scm_shell() conflicts William Xu
@ 2006-02-21  1:00 ` Kevin Ryde
  2006-02-21  3:34 ` William Xu
  2006-02-24 15:05 ` William Xu
  2 siblings, 0 replies; 6+ messages in thread
From: Kevin Ryde @ 2006-02-21  1:00 UTC (permalink / raw)
  Cc: guile-user

William Xu <william.xwl@gmail.com> writes:
>
> I have attached a reproducible testcase,

It works ok for me, unfortunately (on i386 with gcc 2.95).


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: slib and scm_shell() conflicts
  2006-02-20  9:50 slib and scm_shell() conflicts William Xu
  2006-02-21  1:00 ` Kevin Ryde
@ 2006-02-21  3:34 ` William Xu
  2006-02-21  9:28   ` Ken Raeburn
  2006-02-24 15:05 ` William Xu
  2 siblings, 1 reply; 6+ messages in thread
From: William Xu @ 2006-02-21  3:34 UTC (permalink / raw)


William Xu <william.xwl@gmail.com> writes:

> Hi,
>
> I checked out a recent guile repo days ago. It seems there're some
> conflictions between slib and scm_shell() function.
>
> Basically, when i try to load slib(i.e., guile.init), and invoke
> scm_shell() thereafter, then the program will block there. `top' shows
> the program is consuming lots of cpu time.
>
> I have attached a reproducible testcase, consisting of three files,
> foo.c, foo.scm and Makefile.
>
> System Info:
>
> - Guile 1.9.0
> - Debian Unstable GNU/Linux 2.6.14.3 #4, ppc
> - slib in cvs and debian repo
> - gcc (GCC) 4.0.3 20060104 (prerelease) (Debian 4.0.2-6)

Further investigation, see below.

But don't know what does "Corrupted DWARF expression." mean...

---------------------------------8<------------------------------------- 
5934	  res = scm_primitive_eval_x (exp);
(gdb) 
\x03

Program received signal SIGINT, Interrupt.
0x0fd5c424 in pthread_getspecific () from /lib/tls/libpthread.so.0
(gdb) Single stepping until exit from function pthread_getspecific, 
which has no line number information.
deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4635
4635	  return proc;
(gdb) where
#0  deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4635
#1  0x0ff38378 in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4201
#2  0x0ff36588 in scm_dapply (proc=0x300d9330, arg1=0x404, args=<value optimized out>) at eval.c:4990
#3  0x0ff34c74 in scm_apply (proc=0x300d9320, arg1=0x309f3b20, args=<value optimized out>) at eval.c:4798
#4  0x0ff35b24 in scm_call_2 (proc=0x300d9320, arg1=0x309f3b20, arg2=<value optimized out>) at eval.c:4665
#5  0x0ff35be4 in expand_user_macros (expr=0x300d9870, env=0x300d9830) at eval.c:693
#6  0x0ff34964 in m_expand_body (forms=0x3010df60, env=0x300fe318) at eval.c:749
#7  0x0ff38144 in deval (x=0x3008eb40, env=0x300fe318) at eval.c:3378
#8  0x0ff388ec in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:3458
#9  0x0ff3d4a0 in scm_primitive_eval_x (exp=0x300fe8a8) at eval.c:5899
#10 0x0ff59724 in scm_primitive_load (filename=<value optimized out>) at load.c:109
#11 0x0ff372dc in deval (x=0x30121078, env=0x30121090) at eval.c:4221
#12 0x0ff25354 in scm_start_stack (id=0x300783c0, exp=0x3005cb00, env=0x30121090) at debug.c:454
#13 0x0ff25a5c in scm_m_start_stack (exp=<value optimized out>, env=0x30121090) at debug.c:470
#14 0x0ff36398 in scm_dapply (proc=<value optimized out>, arg1=0x3005cb38, args=<value optimized out>)
    at eval.c:4860
#15 0x0ff368d4 in deval (x=0x3005cb38, env=0x30121090) at eval.c:4048
#16 0x0ff36588 in scm_dapply (proc=0x300cf150, arg1=0x404, args=<value optimized out>) at eval.c:4990
#17 0x0ff34c74 in scm_apply (proc=0x301210e0, arg1=0x404, args=<value optimized out>) at eval.c:4798
#18 0x0ff3d588 in scm_call_0 (proc=0x10012008) at eval.c:4653
#19 0x0ff3fe10 in apply_thunk (thunk=0x10012008) at fluids.c:390
#20 0x0ff3fef4 in scm_c_with_fluid (fluid=0x1001aed0, value=0x4, cproc=0xff3fe00 <apply_thunk>, 
    cdata=0x301210e0) at fluids.c:453
#21 0x0ff3ff60 in scm_with_fluid (fluid=0x10012008, value=0x300d9870, thunk=0xff1ecd0) at fluids.c:440
#22 0x0ff392ac in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4470
#23 0x0ff36588 in scm_dapply (proc=0x300cf2d8, arg1=0x404, args=<value optimized out>) at eval.c:4990
#24 0x0ff34c74 in scm_apply (proc=0x301212a0, arg1=0x404, args=<value optimized out>) at eval.c:4798
#25 0x0ff3d588 in scm_call_0 (proc=0x10012008) at eval.c:4653
#26 0x0ff29e78 in scm_dynamic_wind (in_guard=0x30121258, thunk=0x301212a0, out_guard=0x30121230)
    at dynwind.c:107
#27 0x0ff392ac in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4470
#28 0x0ff36294 in scm_dapply (proc=0x30121380, arg1=<value optimized out>, args=<value optimized out>)
    at eval.c:4986
#29 0x0ff34c74 in scm_apply (proc=0x30121370, arg1=0x404, args=<value optimized out>) at eval.c:4798
#30 0x0ff3d588 in scm_call_0 (proc=0x10012008) at eval.c:4653
#31 0x0ffa19e4 in scm_body_thunk (body_data=<value optimized out>) at throw.c:356
#32 0x0ffa152c in scm_c_catch (tag=0x10015750, body=0xffa19d0 <scm_body_thunk>, body_data=0x7fa17c38, 
    handler=0xffa1a00 <scm_handle_by_proc>, handler_data=0x7fa17c48, pre_unwind_handler=0, 
    pre_unwind_handler_data=0x7fa17c4c) at throw.c:204
#33 0x0ffa1f60 in scm_catch_with_pre_unwind_handler (key=0x10012008, thunk=<value optimized out>, 
    handler=0x30121338, pre_unwind_handler=0x7fa170b4) at throw.c:583
#34 0x0ff51ab8 in scm_gsubr_apply (args=<value optimized out>) at gsubr.c:220
#35 0x0ff36418 in scm_dapply (proc=<value optimized out>, arg1=0x30065cf0, args=<value optimized out>)
    at eval.c:4908
#36 0x0ff3932c in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4393
#37 0x0ff398f8 in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:3580
#38 0x0ff36588 in scm_dapply (proc=0x300d1af8, arg1=0x300d1af8, args=<value optimized out>) at eval.c:4990
#39 0x0ff34c74 in scm_apply (proc=0x30121938, arg1=0x404, args=<value optimized out>) at eval.c:4798
#40 0x0ff3d588 in scm_call_0 (proc=0x10012008) at eval.c:4653
#41 0x0ff29e78 in scm_dynamic_wind (in_guard=0x301218f0, thunk=0x30121938, out_guard=0x301218c8)
    at dynwind.c:107
#42 0x0ff392ac in deval (x=dwarf2_read_address: Corrupted DWARF expression.
) at eval.c:4470
#43 0x0ff3d4a0 in scm_primitive_eval_x (exp=0x30121a48) at eval.c:5899
#44 0x0ff59724 in scm_primitive_load (filename=<value optimized out>) at load.c:109
#45 0x0ff5a19c in scm_primitive_load_path (filename=0x30088790) at load.c:477
#46 0x0ff372dc in deval (x=0x30100e90, env=0x30100e78) at eval.c:4221
#47 0x0ff25354 in scm_start_stack (id=0x300783c0, exp=0x3005d4f8, env=0x30100e78) at debug.c:454
#48 0x0ff25a5c in scm_m_start_stack (exp=<value optimized out>, env=0x30100e78) at debug.c:470
#49 0x0ff36398 in scm_dapply (proc=<value optimized out>, arg1=0x3005d5d8, args=<value optimized out>)
    at eval.c:4860
#50 0x0ff368d4 in deval (x=0x3005d5d8, env=0x30100e78) at eval.c:4048
#51 0x0ff3d4a0 in scm_primitive_eval_x (exp=0x30100e38) at eval.c:5899
#52 0x0ff59724 in scm_primitive_load (filename=<value optimized out>) at load.c:109
#53 0x0ff3aed8 in ceval (x=0x104, env=0x30100a38) at eval.c:4221
#54 0x0ff3bec8 in ceval (x=0xffef788, env=0x300fe3b8) at eval.c:3357
#55 0x0ff3d4a0 in scm_primitive_eval_x (exp=0x300fe388) at eval.c:5899
#56 0x0ff3d540 in scm_eval_x (exp=0x300fe388, module_or_state=0x30088990) at eval.c:5934
#57 0x0ff7a73c in scm_shell (argc=1, argv=<value optimized out>) at script.c:738
#58 0x100015f8 in main_prog (closure=0x0, argc=1, argv=0x7fa189a4) at foo.c:11
#59 0x0ff56334 in invoke_main_func (body_data=<value optimized out>) at init.c:367
#60 0x0ff23aa8 in c_body (d=0x7fa186c8) at continuations.c:362
#61 0x0ffa152c in scm_c_catch (tag=0x104, body=0xff23a80 <c_body>, body_data=0x7fa186c8, 
    handler=0xff23ad0 <c_handler>, handler_data=0x7fa186c8, 
    pre_unwind_handler=0xffa1e04 <scm_handle_by_message_noexit>, pre_unwind_handler_data=0x0) at throw.c:204
#62 0x0ff23a30 in scm_i_with_continuation_barrier (body=0xff23a80 <c_body>, body_data=0x7fa186c8, 
    handler=0xff23ad0 <c_handler>, handler_data=0x3002dc00, 
    pre_unwind_handler=0xffa1e04 <scm_handle_by_message_noexit>, pre_unwind_handler_data=0x0)
    at continuations.c:338
#63 0x0ff23b38 in scm_c_with_continuation_barrier (func=<value optimized out>, data=<value optimized out>)
    at continuations.c:380
#64 0x0ff9ec20 in scm_i_with_guile_and_parent (func=0xff562e4 <invoke_main_func>, data=0x7fa18728, 
    parent=<value optimized out>) at threads.c:645
#65 0x0ff9ec90 in scm_with_guile (func=0x10012008, data=0x300d9870) at threads.c:633
#66 0x0ff562c0 in scm_boot_guile (argc=<value optimized out>, argv=<value optimized out>, 
    main_func=0x300d9830, closure=0xff1ecd0) at init.c:350
#67 0x10001634 in main (argc=Cannot access memory at address 0x8
) at foo.c:19
(gdb) 
---------------------------------8<------------------------------------- 

-- 
William


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: slib and scm_shell() conflicts
  2006-02-21  3:34 ` William Xu
@ 2006-02-21  9:28   ` Ken Raeburn
  2006-02-24  8:45     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Ken Raeburn @ 2006-02-21  9:28 UTC (permalink / raw)
  Cc: guile-user

On Feb 20, 2006, at 22:34, William Xu wrote:
> But don't know what does "Corrupted DWARF expression." mean...

DWARF is the name of the new debug info format used in ELF object  
files.  This suggests a bug in either gcc or gdb (or, possibly,  
binutils), and should be reported if you can figure out which one has  
the problem.  Unfortunately I don't know enough about available DWARF  
tools to help you with that. :-(

It looks like it only happens in deval, and only in some places  
there.  Try removing the object file with that function, rebuild with  
the --save-temps compiler option added, and (assuming the resulting  
executable still shows the problem), send the .i and .s files as  
attachments in a bug report -- probably to the Debian folks, unless  
you know that the compiler you've got has no Debian-local patches  
that could influence this problem.  (You could also try getting the  
latest GDB release from the GNU FTP site, if the Debian one isn't the  
latest.)

Ken


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: slib and scm_shell() conflicts
  2006-02-21  9:28   ` Ken Raeburn
@ 2006-02-24  8:45     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2006-02-24  8:45 UTC (permalink / raw)
  Cc: guile-user

Hi,

Ken Raeburn <raeburn@raeburn.org> writes:

> DWARF is the name of the new debug info format used in ELF object
> files.  This suggests a bug in either gcc or gdb (or, possibly,
> binutils), and should be reported if you can figure out which one has
> the problem.  Unfortunately I don't know enough about available DWARF
> tools to help you with that. :-(

To work around this DWARF bug, you could resort to using the traditional
GNU stabs format instead of DWARF.  You can achieve this by compiling
with `-gstabs+' instead of just `-g' (I think the stabs format is
supported on most, if not all, platforms supported by GCC).

Thanks,
Ludovic.


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

* Re: slib and scm_shell() conflicts
  2006-02-20  9:50 slib and scm_shell() conflicts William Xu
  2006-02-21  1:00 ` Kevin Ryde
  2006-02-21  3:34 ` William Xu
@ 2006-02-24 15:05 ` William Xu
  2 siblings, 0 replies; 6+ messages in thread
From: William Xu @ 2006-02-24 15:05 UTC (permalink / raw)


Seems it's some config problem or what, i'm not sure. But here's how i
made it at least work.

To load SLIB, use something like, 

(use-modules (ice-9 slib))
(require 'printf)

But don't load this directly: 

;; (load-from-path "/usr/share/slib/init/guile.init")

Instead, when it says something not found, like `user-vicinity', simply
cut them from guile.init and paste it to ice-9/slib.scm. Total changes
i've made are: 

williamxu:~/share/guile/1.9/ice-9$ diff -u slib.scm.orig slib.scm
--- slib.scm.orig	2006-02-24 22:53:59.936000000 +0800
+++ slib.scm	2006-02-24 22:55:07.760000000 +0800
@@ -6,12 +6,12 @@
 ;;;; modify it under the terms of the GNU Lesser General Public
 ;;;; License as published by the Free Software Foundation; either
 ;;;; version 2.1 of the License, or (at your option) any later version.
-;;;; 
+;;;;
 ;;;; This library is distributed in the hope that it will be useful,
 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;;;; Lesser General Public License for more details.
-;;;; 
+;;;;
 ;;;; You should have received a copy of the GNU Lesser General Public
 ;;;; License along with this library; if not, write to the Free Software
 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -233,6 +233,60 @@
 (define slib:load-source slib:load)
 (define defmacro:load slib:load)
 
+;; by xwl(cut from slib/guile.init)
+(define (user-vicinity)
+  (case (software-type)
+    ((vms)	"[.]")
+    (else	"")))
+
+(define with-load-pathname
+  (let ((exchange
+	 (lambda (new)
+	   (let ((old program-vicinity))
+	     (set! program-vicinity new)
+	     old))))
+    (lambda (path thunk)
+      (define old #f)
+      (define vic (pathname->vicinity path))
+      (dynamic-wind
+	  (lambda () (set! old (exchange (lambda () vic))))
+	  thunk
+	  (lambda () (exchange old))))))
+
+(define (pathname->vicinity pathname)
+  (let loop ((i (- (string-length pathname) 1)))
+    (cond ((negative? i) "")
+	  ((vicinity:suffix? (string-ref pathname i))
+	   (substring pathname 0 (+ i 1)))
+	  (else (loop (- i 1))))))
+
+(define (program-vicinity)
+  (define clp (current-load-port))
+  (if clp
+      (pathname->vicinity (port-filename clp))
+      (slib:error 'program-vicinity " called; use slib:load to load")))
+
+;;; (software-type) should be set to the generic operating system type.
+;;; UNIX, VMS, MACOS, AMIGA and MS-DOS are supported.
+(define software-type
+  (if (string<? (version) "1.6")
+      (lambda () 'UNIX)
+      (lambda () 'unix)))
+
+(define vicinity:suffix?
+  (let ((suffi
+	 (case (software-type)
+	   ((amiga)				'(#\: #\/))
+	   ((macos thinkc)			'(#\:))
+	   ((ms-dos windows atarist os/2)	'(#\\ #\/))
+	   ((nosve)				'(#\: #\.))
+	   ((unix coherent plan9)		'(#\/))
+	   ((vms)				'(#\: #\]))
+	   (else
+	    (warn "require.scm" 'unknown 'software-type (software-type))
+	    "/"))))
+    (lambda (chr) (and (memv chr suffi) #t))))
+
 (define slib-parent-dir
   (let* ((path (%search-load-path "slib/require.scm")))
     (if path

-- 
William


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


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

end of thread, other threads:[~2006-02-24 15:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20  9:50 slib and scm_shell() conflicts William Xu
2006-02-21  1:00 ` Kevin Ryde
2006-02-21  3:34 ` William Xu
2006-02-21  9:28   ` Ken Raeburn
2006-02-24  8:45     ` Ludovic Courtès
2006-02-24 15:05 ` William Xu

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).