Summary

Reloading .so files

Metadata

Description

It seems that .so files cannot be properly reloaded when the loader is compiled.

Below you can see the steps to reproduce the problem.

Christian said he cannot reproduce the problem with 4.6.3 on macos.

I tried it on Linux with 4.4.0, 4.6.3 (dev-snapshot tarball) and c157ff502829c6f2856df4a963d81a88ee241ebf (experimental).

 $ ls -l
 total 12
 -rw-r--r-- 1 mario mario 13 Dez  7 08:46 bar.scm
 -rw-r--r-- 1 mario mario 13 Dez  7 08:46 foo.scm
 -rw-r--r-- 1 mario mario 77 Dez  7 08:47 loader.scm
 
 $ cat foo.scm 
 (print 'foo)
 
 $ cat bar.scm 
 (print 'bar)
 
 $ cat loader.scm 
 (use posix)
 
 (let loop ()
   (load "foo")
   (load "bar")
   (sleep 1)
   (loop))
 
 $ csi -s loader.scm 
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 ...
 
 
 $ csc -s foo.scm 
 $ csc -s bar.scm 
 
 $ ls -l foo.so bar.so
 -rwxr-xr-x 1 mario mario 8257 Dez  7 08:52 bar.so
 -rwxr-xr-x 1 mario mario 8257 Dez  7 08:52 foo.so
 
 $ csi -s loader.scm 
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 ...
 
 $ csc loader.scm
 
 $ ls -l loader
 -rwxr-xr-x 1 mario mario 11459 Dez  7 08:50 loader
 
 $ ./loader 
 foo
 bar
 bar
 bar
 bar
 bar
 bar
 bar
 bar
 ...
 
 
 $ rm *.so
 
 $ ./loader 
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 foo
 bar
 ...

Changes and comments

[2010-12-07 19:35:42 UTC] sjamaan wrote:

I tested on NetBSD (macppc & amd64), but there the compiled behaviour matches the interpreted behaviour!

So far it looks like a Linux-specific problem.

I tried it with 926a29d044cbad484a3acd093eda8f32150228e8 experimental, as well as the 4.6.0 release.

[2010-12-07 20:43:59 UTC] ckeen wrote:

For what its worth this also works on OpenBSD (386 / sparc64) with 4.6.3 and 4.6.0

[2011-02-05 15:33:34 UTC] sjamaan removed milestone 4.7.0

[2011-06-18 19:50:58 UTC] felix wrote:

Reloading can not be reliably implemented on all platforms. I suggest we just disallow it. What do you tnk?

[2011-07-18 00:27:03 UTC] felix changed status from new to closed

[2011-07-18 00:27:03 UTC] felix set resolution to wontfix

[2011-07-18 00:27:03 UTC] felix wrote:

I have removed reloading support altogether. Regardless of platform, it can not be made completely sufficient without adding a lot of overhead.