rzel / termite

Automatically exported from code.google.com/p/termite
Other
0 stars 0 forks source link

on does not work when termite is compiled #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. With termite interpreted, I get the following:
> (current-node)
#<node #2 host: "127.0.0.1" port: 3000>
> (on node0 (lambda () 1))
1
> (on node1 (lambda () 1))
1
>
as expected. However, with termite compiled 
(cd /usr/local/Gambit-C/current/lib/termite; gsc termite), I get:
> (current-node)
#<node #2 host: "127.0.0.1" port: 3000>
> (on node0 (lambda () 1))
1
> (on node1 (lambda () 1))
;; --- Thu Jul 24 16:04:05 MST 2008 ---
Event type: error
In process: #<thread #4>
On node: #<node #2 host: "127.0.0.1" port: 3000>
"#|\n*** ERROR IN ##object->u8vector -- can't serialize #<procedure 
#3>\n0  ##object->u8vector      \n1  ##object->u8vector      \n2  
##object->u8vector      \n3  ##object->u8vector      \n4  
##object->u8vector      \n5  termite#serialize       \n6  
termite#start-serializing-output-port \n7  termite#spawn           \n8  
##thread-start-action!  \n|#\n"

The error event leaves the terminal frozen.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Revision 14 on Linux x86_64 gcc 4.3.1

Please provide any additional information below.
remote-spawn works fine:
> (remote-spawn node0 (lambda () 1))
#<thread #2>
> (remote-spawn node1 (lambda () 1))
#<upid #3
       tag: 7BE6AB46-33D8-425C-BD28-29A3F7DEE33C
       node: #<node #4 host: "127.0.0.1" port: 3001>>
>
Moreover, if I define on in the REPL, it also works:
> (define (on node thunk)
  (let ((tag (make-tag))
                (from (self)))
        (remote-spawn node
                                  (lambda ()
                                        (! from (list tag (thunk)))))
        (recv
          ((,tag reply) reply))))
> (on node0 (lambda () 1))
1
> (on node1 (lambda () 1))
1
>

Original issue reported on code.google.com by alephzil...@gmail.com on 24 Jul 2008 at 11:08

GoogleCodeExporter commented 9 years ago
The error is now intermittent, and I have gotten it when running interpreted as 
well. Maybe it's my machine.

Original comment by alephzil...@gmail.com on 26 Jul 2008 at 9:42

GoogleCodeExporter commented 9 years ago
I consistently get this error when using 'on' with termite compiled.  When I 
defined
'on' (from comment 1) in the REPL I too had success.  I have not yet tested with
interpreted termite.

I am running termite rev. 14 with gambit-c v4_2_8 on Mac OS X 10.5.4 built with 
GCC
4.0.1 (Apple Inc. build 5465)

Original comment by ecoph...@gmail.com on 28 Jul 2008 at 12:56

GoogleCodeExporter commented 9 years ago
It seems that changes in Gambit might have caused the compiled version of 
Termite to
fail.  I'll try to do two things:
1- make the problem go away by figuring the serialization problem
2- improve error handling and reporting in the case where something can't be 
serialized

The problem might be pervasive with compiled code, though.  I'll investigate.

Original comment by guillaum...@gmail.com on 7 Aug 2008 at 4:26

GoogleCodeExporter commented 9 years ago
Guillame--
If I can help you with any further information or by trying anything, please 
let me 
know.

Original comment by alephzil...@gmail.com on 7 Aug 2008 at 7:50

GoogleCodeExporter commented 9 years ago
Problem is in base-exception-handler.
If lambda log-crash set to an empty lambda i.e. ... (log-crash (lambda (e) 
#t))...,
everything is ok. In this case compiled termit with Gambit-C 4.3.0 works fine 
on two
my systems: Linux x86_64 and Linux mipsel32 Au1250
I'am newbie to scheme and Gambit-C (only yesterday started to learn them), and 
cannot
determine problem more precisly yet.

Original comment by Vasil....@gmail.com on 26 Nov 2008 at 4:55

GoogleCodeExporter commented 9 years ago
Here is a patch which completely solves the problem.

There were two problems:
1. Error in arguments order in call to ##cmd-b, which led to core dumping on my 
systems
2. And issue of partially compiling of lambdas in last versions of gambit, which
makes impossible serialization of them. Solved by specifying some flags to 
compiler
in "declare" statement.

See attached patch.

Original comment by Vasil....@gmail.com on 26 Nov 2008 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
- the part about ##cmd-b is in the SVN for some time already (it was reported 
by me)
- I'm quite sure you don't want the (not safe) declaration, since that only 
asks for
new segfault problems

Original comment by christia...@jaeger.mine.nu on 30 Nov 2008 at 9:28

GoogleCodeExporter commented 9 years ago
Fixed in revision 18.

Thanks for report and patch.

Original comment by guillaum...@gmail.com on 8 May 2009 at 2:21