David Brown | 12 Oct 00:13

Elf symbols doesn't work on linuxx86-64.

Following the instructions from the manual for getting symbols with oprofile:

Welcome to Clozure Common Lisp Version 1.3-dev-r11053M-trunk  (LinuxX8664)!
? (require "ELF")
"ELF"
("ELF")
? (ccl::write-elf-symbols-to-file "home:elf-symbols")
> Error: Can't initialize libelf object for "home:elf-symbols": Request error: invalid ELF_C_* argument
> While executing: CCL::CREATE-ELF-OBJECT, in process listener(1).

$ ls -l /usr/lib64/libelf.so*
  0 lrwxrwxrwx 1 root root    15 2008-10-11 10:04 /usr/lib64/libelf.so -> libelf.so.0.8.4*
  0 lrwxrwxrwx 1 root root    15 2008-10-11 10:04 /usr/lib64/libelf.so.0 -> libelf.so.0.8.4*
88 -rwxr-xr-x 1 root root 89392 2008-10-11 10:04 /usr/lib64/libelf.so.0.8.4*

Thanks,
David
Gary Byers | 13 Oct 13:40

Re: Elf symbols doesn't work on linuxx86-64.

There seem to be a few different packages which provide incompatible
versions of libelf.  On a Fedora 9 system, I have

[src/ccl-dev] gb <at> rinpoche> ls -l /usr/lib64/libelf*
-rwxr-xr-x 1 root root 82680 2008-05-12 19:30 /usr/lib64/libelf-0.135.so
lrwxrwxrwx 1 root root    11 2008-09-15 20:06 /usr/lib64/libelf.so -> libelf.so.1
lrwxrwxrwx 1 root root    15 2008-09-15 20:02 /usr/lib64/libelf.so.1 -> libelf-0.135.so

e.g, the real underlying library has a version number of "0.135".

On an Ubuntu 8.0.4 system,

lrwxrwxrwx 1 root root    15 2008-08-14 17:25 /usr/lib64/libelf.so.0 -> libelf.so.0.8.6
lrwxrwxrwx 1 root root    15 2008-08-14 17:25 /usr/lib64/libelf.so.0.8 -> libelf.so.0.8.6
-rw-r--r-- 1 root root 91376 2007-10-02 13:52 /usr/lib64/libelf.so.0.8.6

the real library is apparently at version 0.8.6 (e.g., a totally different
libelf.)  Note that I did not have either "libelf-dev" or "libelfg0-dev"
installed and there ws no symbolic link named "libelf.so"

On Ubuntu (I assume that Debian is probably similar), a slightly older
version (0.131) of the same flavor of libelf that the lisp expects)
is available as part of the "libelf1" package, and the header files
and libraries are available as "libelf-dev".  After doing:

shell> sudo apt-get install libelf-dev

I had both the "0.8.6" flavor and the 0.13* flavor installed, with the
symbolic link pointing to the 0.131 version.  (I assume that "libelf-dev"
and "libelf-dev" can't coexist.)
(Continue reading)

David Brown | 14 Oct 05:04

Re: Elf symbols doesn't work on linuxx86-64.

On Mon, Oct 13, 2008 at 05:40:31AM -0600, Gary Byers wrote:

> There seem to be a few different packages which provide incompatible
> versions of libelf.  On a Fedora 9 system, I have

That does seem to be the problem.  On gentoo, it looks like I need
'elfutils', instead of 'libelf'.  Only one of the packages can be
compiled.

Of course, that brings me to my Dead Mac Pointer bug when I try using
saved images.  But, the elf thing seems to be working now.

David
Gary Byers | 14 Oct 06:32

Re: Elf symbols doesn't work on linuxx86-64.


On Mon, 13 Oct 2008, David Brown wrote:

> On Mon, Oct 13, 2008 at 05:40:31AM -0600, Gary Byers wrote:
>
>> There seem to be a few different packages which provide incompatible
>> versions of libelf.  On a Fedora 9 system, I have
>
> That does seem to be the problem.  On gentoo, it looks like I need
> 'elfutils', instead of 'libelf'.  Only one of the packages can be
> compiled.
>
> Of course, that brings me to my Dead Mac Pointer bug when I try using
> saved images.  But, the elf thing seems to be working now.
>
> David
>
>

If you've described this (dead pointer) problem, I haven't seen the
message.  I don't think that this is documented (well) anywhere; sorry
if I'm repeating something that's in the manual.  (Actually, the manual
seems to mention the issue but doesn't say what to do about it.)

In general, a pointer (to some foreign address) is only meaningful
within a session; SAVE-APPLICATION walks memory, changing the type of
any non-NULL pointers it finds to DEAD-MACPTR.  Most operations on
pointers do typechecking, so attempting to access something leftover
from the previous session gets a type error (rather than acessing a foreign
address that's leftover from the previous session.)  The exception for
(Continue reading)

David Brown | 14 Oct 06:58

Re: Elf symbols doesn't work on linuxx86-64.

On Mon, Oct 13, 2008 at 10:32:44PM -0600, Gary Byers wrote:

> If you've described this (dead pointer) problem, I haven't seen the
> message.  I don't think that this is documented (well) anywhere; sorry
> if I'm repeating something that's in the manual.  (Actually, the manual
> seems to mention the issue but doesn't say what to do about it.)

Sorry, I should have been clearer, this is my bug, I just haven't
taken the time to track it down, since it only keeps me from saving
images.  I've just got a foreign pointer somewhere, but I don't know
where.

In any case, I managed to run the oprofile enough to figure out that
my program was doing fine.  I just needed to add ":nodelay t" to the
socket connections so that it didn't spend most of it time waiting for
Nagle and TCP delayed ack to fight with each other.

David
Andrew Shalit | 14 Oct 21:08

Re: Elf symbols doesn't work on linuxx86-64.

I've captured this useful description of macptrs in a blog posting:

http://ccl.clozure.com/blog/?p=15

Speaking of which, ccl now has a blog!  There isn't much in there yet,  
but we'll be remedying that in the coming weeks.

Andrew

On Oct 14, 2008, at 12:32 AM, Gary Byers wrote:

>
>
> On Mon, 13 Oct 2008, David Brown wrote:
>
>> On Mon, Oct 13, 2008 at 05:40:31AM -0600, Gary Byers wrote:
>>
>>> There seem to be a few different packages which provide incompatible
>>> versions of libelf.  On a Fedora 9 system, I have
>>
>> That does seem to be the problem.  On gentoo, it looks like I need
>> 'elfutils', instead of 'libelf'.  Only one of the packages can be
>> compiled.
>>
>> Of course, that brings me to my Dead Mac Pointer bug when I try using
>> saved images.  But, the elf thing seems to be working now.
>>
>> David
>>
>>
(Continue reading)


Gmane