Re: SIGSEGV & open-pipe

Ivan Shmakov <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
>>>>> "IS" == Ivan Shmakov <[email protected]> writes:

 IS> One more, probably similar, problem:

 > Welcome to Scheme 48 1.9T (made by ivan on Sun Oct 19 23:19:53 NOVST 2008)
 > Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
 > Please report bugs to [email protected].
 > Get more information at http://www.s48.org/.
 > Type ,? (comma question-mark) for help.
 > > ,new-package 
 > 263> ,structure foo (export) 
 > foo> ,open posix-processes posix-i/o i/o 
 > foo> (define i/o (call-with-values open-pipe list))
 > ; no values returned
 > foo> i/o
 
 > Process scheme segmentation fault

[...]

	The following change makes it better, but still not perfect:

Welcome to Scheme 48 1.9T (made by ivan on Mon Oct 20 00:00:09 NOVST 2008)
Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
Please report bugs to [email protected].
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
> ,open posix-i/o 
> (call-with-values open-pipe list)
(#{input-port #{input-channel 2473010 3}} #{output-port #{output-channel 2473010 4}})
> 

diff -r 311e075816f8 c/posix/io.c
--- a/c/posix/io.c	Sun Oct 19 17:49:12 2008 +0200
+++ b/c/posix/io.c	Sun Oct 19 23:59:36 2008 +0700
@@ -170,7 +170,8 @@ posix_pipe(s48_call_t call)
   int 		fildes[2],
     		status;
   s48_ref_t	in_channel, out_channel;
-  s48_ref_t 	id = s48_make_local_ref(call, s48_enter_string_latin_1("pipe"));
+  s48_ref_t 	id
+    = s48_make_local_ref (call, s48_enter_string_latin_1_2 (call, "pipe"));
 
   RETRY_OR_RAISE_NEG(status, pipe(fildes));
 

	I'm now considering to also check (thanks to -Wall):

../c/scheme48vm-64.c:3076: warning: implicit declaration of function 's48_trace_external_calls'
../c/scheme48vm-64.c:4343: warning: implicit declaration of function 's48_argument_type_violation'
../c/scheme48vm-64.c:4358: warning: implicit declaration of function 's48_range_violation'
../c/scheme48vm-64.c:10217: warning: implicit declaration of function 's48_gc_can_allocate_untraced_unmovableP'
../c/scheme48vm-64.c:11340: warning: implicit declaration of function 's48_jump_to_native_address'
../c/scheme48vm-64.c:11488: warning: implicit declaration of function 's48_gc_run_time'
../c/scheme48-twospace-heap-64.c:2574: warning: implicit declaration of function 's48_run_time'
../c/net/socket.c:112: warning: implicit declaration of function 's48_os_error'
../c/unix/socket.c:41: warning: implicit declaration of function 's48_os_error'
../c/unix/socket.c:94: warning: implicit declaration of function 'dup'
../c/posix/user.c:119: warning: implicit declaration of function 's48_os_error'
../c/posix/proc-env.c:76: warning: implicit declaration of function 's48_os_error'
../c/posix/proc.c:369: warning: implicit declaration of function 's48_out_of_memory_error'
../c/posix/proc.c:417: warning: implicit declaration of function 's48_os_error'
../c/posix/proc.c:696: warning: implicit declaration of function 's48_enter_fixnum'
../c/posix/io.c:82: warning: implicit declaration of function 's48_os_error'
../c/posix/dir.c:107: warning: implicit declaration of function 's48_os_error'
../c/ffi-test/ffi-test.c:262: warning: implicit declaration of function 's48_enter_integer'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.