Hello again, I have now tried to link my Mercury library with the libgc that Guile uses instead of the Mercury one, and I asked about it on the Mercury mailing list, where I got this reply:
"The version of libgc that Mercury uses contains Mercury specific modifications; I would be surprised if linking against the system wide one worked." The final parts of both strace outputs are included below. The version of Guile I am using is 1.8.7 -- is it worth trying 1.9 instead? Is it generally possible to use two different libgc at the same time? Grateful for any help with this. /Tomas ---------- begin Mercury GC --------------------------------------- open("/usr/local/mercury-rotd-2009-12-28/lib/mercury/lib/libgc.so", O_RDONLY) = 9 read(9, "\177elf\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\...@y\0\0004\0\0\0"..., 512) = 512 fstat64(9, {st_mode=S_IFREG|0755, st_size=121223, ...}) = 0 mmap2(NULL, 464944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x9a4000 mmap2(0x9bb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x17) = 0x9bb000 mmap2(0x9bd000, 362544, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x9bd000 close(9) = 0 mprotect(0x9bb000, 4096, PROT_READ) = 0 mprotect(0x298000, 4096, PROT_READ) = 0 mprotect(0x11b2000, 126976, PROT_READ) = 0 mprotect(0x422000, 20480, PROT_READ|PROT_WRITE) = 0 munmap(0x422000, 24684) = 0 munmap(0xdec000, 6385312) = 0 munmap(0x255000, 287840) = 0 munmap(0x9a4000, 464944) = 0 ---------------------------------------------------------------- ---------- begin Guile GC ----------------------------------------- open("/usr/lib/libgc.so", O_RDONLY) = 9 read(9, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \200\0\0004\0\0\0"..., 512) = 512 fstat64(9, {st_mode=S_IFREG|0644, st_size=137280, ...}) = 0 mmap2(NULL, 206620, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x49b000 mmap2(0x4bc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x20) = 0x4bc000 mmap2(0x4be000, 63260, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4be000 close(9) = 0 open("/usr/local/mercury-rotd-2009-12-28/lib/mercury/lib/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/mercury-rotd-2009-12-28/lib/mercury/lib/asm_fast.gc/libgcc_s.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libgcc_s.so.1", O_RDONLY) = 9 read(9, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p#\0\0004\0\0\0"..., 512) = 512 fstat64(9, {st_mode=S_IFREG|0644, st_size=116272, ...}) = 0 mmap2(NULL, 119336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0xe5b000 mmap2(0xe77000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x1b) = 0xe77000 close(9) = 0 mprotect(0xe77000, 4096, PROT_READ) = 0 mprotect(0x4bc000, 4096, PROT_READ) = 0 munmap(0xb782b000, 91754) = 0 munmap(0xab8000, 24684) = 0 munmap(0xf83000, 6385312) = 0 munmap(0x304000, 287840) = 0 munmap(0x49b000, 206620) = 0 munmap(0xe5b000, 119336) = 0 ------------------------------------------------------------------ On Fri, February 5, 2010 14:57, Ludovic Courtès wrote: > Hi, > > "Tomas By" <to...@basun.net> writes: > >> open("/usr/local/mercury-rotd-2009-12-28/lib/mercury/lib/libgc.so", >> O_RDONLY) = 9 > > [...] > >> I guess that "libgc.so" is the Mercury garbage collector. Is there some >> problem with having another GC in a Guile module? > > The problem is that Guile 1.9 is linked against another libgc (this one: > http://www.hpl.hp.com/personal/Hans_Boehm/gc/). So, presumably, when > dlopening the Guile module, the dynamic linker tries top open libgc.so > but picks up the wrong one, hence the failure. > > Thanks, > Ludoâ. > > > >