Ticket #442 (closed defect: wontfix)

Opened 4 years ago

Last modified 3 years ago

Reloading .so files

Reported by: mario Owned by:
Priority: major Milestone:
Component: unknown Version: 4.6.x
Keywords: Cc:

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

Change History

Changed 4 years ago by sjamaan

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.

Changed 4 years ago by ckeen

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

Changed 3 years ago by sjamaan

  • milestone 4.7.0 deleted

Changed 3 years ago by felix

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

Changed 3 years ago by felix

  • status changed from new to closed
  • resolution set to wontfix

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

Note: See TracTickets for help on using tickets.