IRC channel logs

2016-10-02.log

back to list of logs

<kori>what am I supposed to do when dynamic-link returns file not found?
<kori>even though the library is in /usr/lib and guile can see the other libraries?
<daviid>kori: run your script under strace, it could be because of another lib not being installed
<kori>anything I should be looking for?
<kori>and I doubt its that. ldd shows the libs are linked correctly
<daviid>kori: yes, it will list the exact missing file name
<daviid>kori: this is a very welknow and very common problem
<kori>ah... hmmm
<daviid>strace -o strace.out guile -s <yourscript>
<kori>found some stuffs, thanks daviid
<daviid>welcome
<kori>daviid: http://sprunge.us/TLIQ
<kori>the file seems to be read correctly
<kori>(libwm.so)
<kori>yet... file not found
<daviid>kori: don't know. I would try to strace just that call
<kori>ah this is out of my area of knowledge right now
<kori>I'll try ffi stuff later I guess
<daviid>kori: like this: strace -o strace.out guile -c "(use-modules (system foreign)) (dynamic-link \\"libglib-2.0\\")"
<daviid>kori: I used libglib-2.0 as an example which works for me here, replace with libvm
<kori>daviid: uh
<kori> http://sprunge.us/LbeJ libwm
<kori> http://sprunge.us/bHGF
<kori>libglib-2.0 for example
<daviid>kori: yes, this proves that it can not find libwm
<kori>when it should, since it is there
<kori>; ls -l /usr/lib/libwm.so
<kori>-rwxr-xr-x 1 root root 18688 Oct 1 19:34 /usr/lib/libwm.so*
<kori>I dont understand
<daviid>or oe of its dependencies, you have to look carefully the strace, I don't have that much time ...
<kori>thats fine then daviid
<kori>thanks for the help
<daviid>kori: what does 'ldd /usr/lib/libwm.so' returns
<kori> http://sprunge.us/MPfc
<daviid>kori: try ldd on each of them
<kori> http://sprunge.us/hEbY libxcb
<kori> http://sprunge.us/HWYa libxau
<kori> http://sprunge.us/bARX libxdmcp
<kori>everything seems to be in order
<daviid>kori: this is not my specialty, I hope some else cn jump in. but you have the proof in front of your yeys that it loads libglib for you too, so there is a problem with libwm or a deps on your machine... I would try to compare what packages are installed for libglib and libwm maybe?
<kori>daviid: well, I have other programs that depend on libwm to compile, and I just used them about 300 times in the last 5 minutes
<kori>however. this is an important note: libwm is usually compiled as an .a file
<kori>gcc -lxcb -std=c99 -pedantic -Wall -fPIC -Os -shared libwm.c -o libwm.so
<kori>that's what I used to generate libwm.so
<kori>libwm in question: https://github.com/wmutils/libwm
<kori>either way, daviid
<kori>thanks for the help once again
<daviid>oh, you manually compile install this? maybe you need a C option to generate symbol table or something ... don't know
<daviid>what distro are you using ?
<kori>Arch
<bobbejaantje>kori, from rice?
<kori>bobbejaantje: what?
<bobbejaantje>I guess not.
<bobbejaantje>I wondered if you were that kori.
<daviid>I would try to install the distro libwm and libwm-dev, even to drop them later, but to check ... you see, they did the right thing for libglib ...
<bobbejaantje>Arch doesn't split off -dev packages does it?
<kori>nope
<kori>this isnt even in the repos, just the AUR
<daviid>kori: ok, then install that and try again
<kori>daviid: I did, but I'll try again with strace I guess
<daviid>kori: try to compare what is/are the diff for libglib-2.0 and libwm, original packages from arch then, something is missing for libwm on your box, or in the LD_LIBRARY_PATH ... and prob it is reported in the strace you pasted, with patience ...
<daviid>kori: have to go afk, good luck
<kori>daviid: thanks
***random-nickname is now known as random-nick
<amz3`>kori: did you try to provide the full path to the so file?
<amz3`>kori: did you run `ldconfig' to update the cache
<jmd>I'm trying to create a module an export a procedure from it. I have put (define-modules (gxi) #:export (proc)) in file A - and in file B I have got (use-module (gxi))
<jmd>But I always get the error "no code for module" (gxi))
<jmd>And yes, I have read the f*888ng manual.
<random-nick>jmd: is file A loaded?
<random-nick>that's probably the issue
<jmd>I thought modules meant that was automatically taken care of.
<jmd>I have set GUILE_LOAD_PATH
<jmd>random-nick: I fixed it. Tnx
<kori>amz3`: 1. didnt, 2. I did
<amz3`>kori: are you on guix?
<amz3`>3. no
<kori>nope
<kori>haha
<kori>amz3`: does dynamic-link accept a full path?
<amz3`>kori: yes
<kori>ERROR: In procedure dynamic-link: file: "/usr/lib/libwm.so", message: "file not
<kori>found"
<kori>bahahaa
<kori>amz3`: I assume I should call it as (dynamic-link "/usr/lib/libwm.so")
<amz3`>strange
<amz3`>kori: try this in a terminal 'ldd /usr/lib/libwm.so' and paste the output
<kori>amz3`: http://sprunge.us/eeXf
<kori>same as yesterday, everything is in order.
<kori>ldd on each of those libs is also successful
<kori> http://sprunge.us/MCdI strace
<amz3`>kori: did you try with `LD_PRELOAD=/usr/lib/libwm.so guile libwm.scm'
<kori>amz3`: no, lets see
<amz3`>kori: I got it
<amz3`>kori: look the strace output says: open("/usr/local/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
<kori>; LD_PRELOAD=/usr/lib/libwm.so guile libwm.scm
<kori>rlwrap: symbol lookup error: /usr/lib/libwm.so: undefined symbol: conn
<kori>hm
<kori>amz3`: if you look at the next line
<kori>it says
<kori>open("/usr/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 5
<amz3`>ah right
<kori>yeah
<kori>the undefined symbol thing might be my best bet
<amz3`>where do you see that undefined symbol?
<kori>; LD_PRELOAD=/usr/lib/libwm.so /bin/guile libwm.scm
<kori>/bin/guile: symbol lookup error: /usr/lib/libwm.so: undefined symbol: conn
<amz3`>hmm
<amz3`>that's a clue
<amz3`>prolly objdump is the tool to use now, but now sure which option to use
<kori>amz3`: probably -T
<kori>I'll poke around a bit
<kori>that LD_PRELOAD suggestion was good. its possible that the bug happened when generating libwm.so
<kori>thanks!
<amz3`>:)
<kori>aha, found something ;)
<kori> https://github.com/kori/libwm/blob/master/libwm.c#L11
<kori>well
<kori>I guess I should link the master repo
<kori> https://github.com/wmutils/libwm/blob/master/libwm.c#L11
<kori>scoping!
<amz3`>I am not a C expert, but conn is declared as extern in the header
<kori>something is not right, though
<kori>I tried to compile without -shared
<kori>and got "
<kori>and got "undefined reference to conn, scrn" everywhere
<amz3`>kori: did solve your issue?
<kori>no, I've in fact given up
<kori>thanks for the help though
<amz3`>oh
<daviid>kori: this has nothing to do with guile, you could email the author of this lib with these bugs you mentioned earlier...
<daviid>kori: or fix these conn, scr undefined symbols yourself ...
<kori>daviid: probably
<kori>thanks
<MoronicAcid>Hi. Does anyone know how to forward guile error messages to a specific port from a C program?
<MoronicAcid>Hopefully, this isn't a development IRC. Sorry if these kind of questions don't belong here.
<MoronicAcid>P.S. I am not allowed to use standard I/O, if that helps any.