scsh-users
[Top] [All Lists]

Re: Problem using sockets

To: Emilio Lopes <eclig@gmx.net>
Subject: Re: Problem using sockets
From: Michael Sperber <sperber@informatik.uni-tuebingen.de>
Date: Tue, 21 Aug 2007 18:05:12 +0200
Cc: scsh-users@scsh.net
List-id: <scsh-users.list-id.scsh.net>
Resent-to: scsh-users@scsh.net
Emilio Lopes <eclig@gmx.net> writes:

I know it's late ...    Sorry.

The gc-protection-mismatch problem is obvious enough.  After that, I
don't get any exceptions with your example.  Could you try again with
the patch?

> I hope the transcript bellow is enough to describe the problem.
> Basically I get an exception when trying to write to a socket.  I'm
> pretty sure this used to work, but it doesn't anymore...
>
> I also tried to enable some debugging, but it failed:
>
>    > (socket-option *server-socket* level/socket socket/debug)
>    #f
>    > (set-socket-option *server-socket* level/socket socket/debug #t)
>    Error: 13
>           "Permission denied"
>           #{Procedure 11768 (%setsockopt in scsh-level-0)}
>           9
>           1
>           1
>           1
>
> In case it matters:
>
>    ~% uname -a
>    Linux jumeirah 2.6.18-4-k7 #1 SMP Mon Mar 26 17:57:15 UTC 2007 i686 
> GNU/Linux
>
> Any hint?
>
>    Welcome to scsh 0.6.7 (R6RS)
>    Type ,? for help.
>    > ,open threads
>    > (define (server-start socket socket-addr)
>        (format #t "Hello, ~a!\n" (host-info:name (host-info socket-addr)))
>        (let ((inport (socket:inport socket))
>              (outport (socket:outport socket)))
>          (let loop ()
>            (let ((input (read-line inport 'trim)))
>              (cond
>               ((eof-object? input)
>                (display "Goodbye.\n" outport)
>                (shutdown-socket socket shutdown/sends+receives))
>               (else
>                (format outport "You said: \"~A\".\n" input)
>                (loop)))))))
>    > (spawn
>       (lambda ()
>         (bind-listen-accept-loop protocol-family/internet server-start 6666)))
>    > (define *server-socket*
>        (socket-connect protocol-family/internet socket-type/stream 
> "localhost" 6666))
>    Hello, jumeirah!
>    > (connect-socket-successful? *server-socket*)
>    #t
>    > (send-message *server-socket* "hi!")
>
>    Error: exception
>           gc-protection-mismatch
>           (call-external-value "send_substring")
>    1> ,debug
>    '#{Exception-continuation (pc 3) (call-external-value in scheme-level-0)}
>
>    inspect: d
>    '#{Continuation (pc 62) (with-dynamic-env in fluids)}
>
>     [0] '#{Procedure 1109 (unnamed in with-dynamic-env in fluids)}
>     [1] '((# . #f) (# # # # # ---) (# . #) (# # # # # ---) (# # # # #) ---)
>     [2] #f
>     [3] #f
>    inspect: q
>    '#{Continuation (pc 62) (with-dynamic-env in fluids)}
>    1> 
>


-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: scsh/network1.c
===================================================================
RCS file: /cvsroot/scsh/scsh/scsh/network1.c,v
retrieving revision 1.33.2.2
diff -u -r1.33.2.2 network1.c
--- scsh/network1.c     28 Jan 2007 15:13:52 -0000      1.33.2.2
+++ scsh/network1.c     21 Aug 2007 16:02:59 -0000
@@ -380,13 +380,14 @@
                   buf_part, end-start, 
                   flags,
                   (struct sockaddr *)&name, sizeof(name));
-      break;
+       S48_GC_UNPROTECT();
+       
+       break;
       }
     default:
       s48_raise_argument_type_error (s48_extract_fixnum (scm_family)); 
       /* error unknown address family */
     }
-  S48_GC_UNPROTECT();
   if (n >= 0)
     return s48_enter_fixnum (n);
 
<Prev in Thread] Current Thread [Next in Thread>