You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Arch Linux] Compile error: undefined reference to `dwarf_loclist' #58
it looks like dtrace is detecting an incorrect libdw.a shlib on your system
which doesnt have all the API entry points. for now you can just do a "make
-i" and ignore the ctfdump/ctfconvert tools which wont get built.
libdwarf was installed from Arch User Repository.
I tried make -i all, but when I try to load modules: sudo make load
I'm getting: /tmp/dtrace$ sudo make load tools/load.pl 19:12:51 Syncing... 19:12:51 Loading: build-3.9.9-1-ARCH/driver/dtracedrv.ko insmod: ERROR: could not load module build-3.9.9-1-ARCH/driver/dtracedrv.ko: No such file or directory /proc/dtrace does not exist. Maybe the driver didnt load properly. make: *** [load] Error 1
It looks like libdw is included by default on Arch but doesn't include the dwarf_loclist symbol. If you install libdwarf through AUR tools/mkport.pl still finds libdw (around line 335). I just deleted some lines to force libdwarf over libdw.
I didn't hit the compile issue until I installed libdwarf through AUR. If you don't install libdwarf, does the build disable some features or something? I'm not too familiar with the build process.
Without libdwarf, it appears that the ctfdump/convert stuff is disabled. libdw is installed by default with elfutils.
With libdwarf (from AUR), mkctf.sh fails:
tools/mkctf.sh
ERROR: ctfconvert: die 901: failed to get mem offset location list
ls: cannot access build/linux-3.9.9-1-ARCH.ctf: No such file or directory
There's some discussion on the AUR page about upstream issues, but I'm not sure it's relevant.
Strange - i took the latest arch download, loaded the deps from the
tools/get-deps-arch script and it built without problem. I need to look at
the libdw vs libdwarf issue - I made changes a while back to be
accomodating of either but it was a dead end - and its annoying. I want to
reexamine ctfdump to see what I could do to omit the dependency. Its
annoying that there are two standard interfaces and not easily
interchangeable.
for now - it mostly doesnt matter - it just means the linux.ctf file is
useless - most people wont care. its only needed for struct member
references in D scripts.
Without libdwarf, it appears that the ctfdump/convert stuff is disabled.
libdw is installed by default with elftools.
With libdwarf (from AUR), mkctf.sh fails:
tools/mkctf.sh
ERROR: ctfconvert: die 901: failed to get mem offset location list
ls: cannot access build/linux-3.9.9-1-ARCH.ctf: No such file or directory
There's some discussion on the AUR page about upstream issues, but I'm not
sure it's relevant.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-20915553
.
I just tried get-deps-arch but I already had all the dependencies and "make all" still didn't build the ctf utils.
To be perfectly honest I've never used dtrace before but it sounded exciting so I wanted to try it. I don't do any D but if you want to get it working and there's any tests/information you need I'd be glad to help.
It seems like with a little work libdw and libdwarf are both available on arch. Are the other distros similar? If it's easier to just support one I think people would be willing to put in a little effort to get whichever dependency is needed.
libdwarf is the better - but there are lots of versions of this and i was
trying to support all the older systems, so its not so clear cut. My code
is looking to see if libdw and libdwarf is installed and then (probably)
picking the wrong one. When I ran this last night - it was a clean build -
so you likely have both installed and I dont (or I even have neither!)
I just tried get-deps-arch but I already had all the dependencies and
"make all" still didn't build the ctf utils.
To be perfectly honest I've never used dtrace before but it sounded
exciting so I wanted to try it. I don't do any D but if you want to get it
working and there's any tests/information you need I'd be glad to help.
It seems like with a little work libdw and libdwarf are both available on
arch. Are the other distros similar? If it's easier to just support one I
think people would be willing to put in a little effort to get whichever
dependency is needed.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/58#issuecomment-20917773
.
I can reproduce this on Gentoo Linux with the following commands:
# Note that layman must be installed and setup first
layman -a ikelos
echo dev-libs/libdwarf ~amd64 >> /etc/portage/package.accept_keywords
wget 'https://launchpad.net/ubuntu/+archive/primary/+files/dwarfutils_20120410.orig.tar.gz' -O /usr/portage/distfiles/libdwarf-20120410.tar.gz
emerge dev-libs/libdwarf
git checkout git://github.com/dtrace4linux/linux.git
cd linux
make all
It seems that the problem is that the check for libdwarf in tools/mkport.pl is broken. The check will never select libdwarf. Modifying tools/mkport.pl to force libdwarf to be used allows things to work.
As for libelf, this appears to be the commit that broke compatibility:
Thanks for attempting to locate the broken commit. The state of ELF is forever broken on all kernels because of the horrible history of the two
dwarf libraries. I have given up trying to salvage the horrible nature of
the mess. Its a shame because the owner of libdwarf has done a good job,
but the horrible state of all distros and trying to cater for both ELF
libraries - you can have either or both installed, is really painful.
My next attempt to fix and remove this is to avoid libdwarf and use the
readelf tool instead.
The situation is so bad, because I am always confused whether libdwarf or
libdw is the latest conformant implementation. I have looked at the
implementation of dwarf_loclist but it doesnt help - I tried to create a
portable layer between the two libs but abandoned it due to the "just one
more API needs to be grafted" onboard.
I may take another look (using readelf - or any other tool which works)
since I am now going to look at another kernel bug/issue on ubuntu 12.04.
Sorry, the comment was cut off. Continue last comment:
dtrace: failed to initialize dtrace: DTrace device not available on system
I have the lastest libdwarf installed (from git://libdwarf.git.sourceforge.net/gitroot/libdwarf/libdwarf).
What is natural of this error? I am willing to take a look at the code if you can give me some guideline. We have an important issue that needs dtrace to help out, so significant effort can be devoted to make this work. Any help will be highly appreciated.
You need to read my blog where I have repeatedly discussed this. There are
two incompatible libdwarf libraries out there. dtrace uses one and some
distros deploy the other. I have looked at the dwarf_loclist issue before -
getting ones mind around libdwarf and two competing libraries is harmful to
the brain :-) Since this issue keeps coming up, I need to look again.
(libdwarf vs libdw). One option is to package libdw/dwarf with dtrace but
am loathe to do that. Let me take a look.
Sorry, the comment was cut off. Continue last comment:
dtrace: failed to initialize dtrace: DTrace device not available on system
I have the lastest libdwarf installed (from git://
libdwarf.git.sourceforge.net/gitroot/libdwarf/libdwarf).
What is natural of this error? I am willing to take a look at the code if
you can give me some guideline. We have an important issue that needs
dtrace to help out, so significant effort can be devoted to make this work.
Any help will be highly appreciated.
—
Reply to this email directly or view it on GitHub #58 (comment).
Thanks for the reply, from which I downloaded and installed the other libdwarf (from github, my first one comes from soureforge). Lo and behold, it builds successfully. make install and make load also runs without issue. Good progress.
However, make test crashes the kernel:
20141020 10:40:07 Test: fbt-a
build/dtrace -n ' BEGIN {
tstart = timestamp;
}
fbt::a*:
{
cnt++;
}
tick-1ms /timestamp - tstart > 5 * 1000 * 1000 * 1000 / {exit(0);}
tick-1s { printf("count so far: %d", cnt); }
tick-5s { exit(0); }
' >/tmp/test-root.fbt-a.log 2>&1
20141020 10:40:07 === Test: fbt-a
-> the system freeze here.
One thing I noticed during the compile:
dtrace/linux/build-2.6.32-431.17.1.el6.x86_64/driver/x_call.c:96:3: warning: #warning "NCPU is large - your module may not load (x_call.c)"
I changed the code to print out the value of NCPU:
My linux machine has only 4 cores. In the Changes file:
691* x_call.c: Put in a warning if NCPU is too large - can cause
problems at driver load time (Centos 6.2 has NCPU==4096 which
equates to more than 40MB of memory for the xcall array).
Great you got it working. No the ncpu issue isn't the cause of your crash.
It's one of the matching kernel routines...maybe reentrancy. Will need to
look.
On 20 Oct 2014 16:00, "gaojx" notifications@github.com wrote:
Thanks for the reply, from which I downloaded and installed the other
libdwarf (from github, my first one comes from soureforge). Lo and behold,
it builds successfully. make install and make load also runs without issue.
Good progress.
However, make test crashes the kernel:
20141020 10:40:07 Test: fbt-a
build/dtrace -n ' BEGIN {
tstart = timestamp;
}
fbt::a*:
{
cnt++;
}
tick-1ms /timestamp - tstart > 5 * 1000 * 1000 * 1000 / {exit(0);}
tick-1s { printf("count so far: %d", cnt); }
tick-5s { exit(0); }
' >/tmp/test-root.fbt-a.log 2>&1
20141020 10:40:07 === Test: fbt-a
-> the system freeze here.
One thing I noticed during the compile:
dtrace/linux/build-2.6.32-431.17.1.el6.x86_64/driver/x_call.c:96:3:
warning: #warning "NCPU is large - your module may not load (x_call.c)"
I changed the code to print out the value of NCPU:
My linux machine has only 4 cores. In the Changes file:
691* x_call.c: Put in a warning if NCPU is too large - can cause
problems at driver load time (Centos 6.2 has NCPU==4096 which
equates to more than 40MB of memory for the xcall array).
Would this be issue that causes the crash?
—
Reply to this email directly or view it on GitHub #58 (comment).
Activity
dtrace4linux commentedon Jul 7, 2013
Hello Wojciech
it looks like dtrace is detecting an incorrect libdw.a shlib on your system
which doesnt have all the API entry points. for now you can just do a "make
-i" and ignore the ctfdump/ctfconvert tools which wont get built.
On 7 July 2013 18:58, Wojciech Kwolek notifications@github.com wrote:
irth commentedon Jul 8, 2013
libdwarf was installed from Arch User Repository.
I tried
make -i all, but when I try to load modules:sudo make loadI'm getting:
/tmp/dtrace$ sudo make load tools/load.pl 19:12:51 Syncing... 19:12:51 Loading: build-3.9.9-1-ARCH/driver/dtracedrv.ko insmod: ERROR: could not load module build-3.9.9-1-ARCH/driver/dtracedrv.ko: No such file or directory /proc/dtrace does not exist. Maybe the driver didnt load properly. make: *** [load] Error 1rendaw commentedon Jul 11, 2013
It looks like libdw is included by default on Arch but doesn't include the dwarf_loclist symbol. If you install libdwarf through AUR tools/mkport.pl still finds libdw (around line 335). I just deleted some lines to force libdwarf over libdw.
I didn't hit the compile issue until I installed libdwarf through AUR. If you don't install libdwarf, does the build disable some features or something? I'm not too familiar with the build process.
rendaw commentedon Jul 13, 2013
Without libdwarf, it appears that the ctfdump/convert stuff is disabled. libdw is installed by default with elfutils.
With libdwarf (from AUR), mkctf.sh fails:
There's some discussion on the AUR page about upstream issues, but I'm not sure it's relevant.
dtrace4linux commentedon Jul 13, 2013
Strange - i took the latest arch download, loaded the deps from the
tools/get-deps-arch script and it built without problem. I need to look at
the libdw vs libdwarf issue - I made changes a while back to be
accomodating of either but it was a dead end - and its annoying. I want to
reexamine ctfdump to see what I could do to omit the dependency. Its
annoying that there are two standard interfaces and not easily
interchangeable.
for now - it mostly doesnt matter - it just means the linux.ctf file is
useless - most people wont care. its only needed for struct member
references in D scripts.
On 13 July 2013 07:26, Rendaw notifications@github.com wrote:
rendaw commentedon Jul 13, 2013
I just tried get-deps-arch but I already had all the dependencies and "make all" still didn't build the ctf utils.
To be perfectly honest I've never used dtrace before but it sounded exciting so I wanted to try it. I don't do any D but if you want to get it working and there's any tests/information you need I'd be glad to help.
It seems like with a little work libdw and libdwarf are both available on arch. Are the other distros similar? If it's easier to just support one I think people would be willing to put in a little effort to get whichever dependency is needed.
dtrace4linux commentedon Jul 13, 2013
If you do "make -i all" then you are good to go - next do:
$ make load
$ sudo build/dtrace -n syscall:::
and you can see all the syscalls on the system (a lot!) You can fine tune,
e.g.
$ sudo build/dtrace -n syscall::open*:'{printf("%s", execname);}'
to see the executables opening files.
libdwarf is the better - but there are lots of versions of this and i was
trying to support all the older systems, so its not so clear cut. My code
is looking to see if libdw and libdwarf is installed and then (probably)
picking the wrong one. When I ran this last night - it was a clean build -
so you likely have both installed and I dont (or I even have neither!)
On 13 July 2013 11:11, Rendaw notifications@github.com wrote:
rendaw commentedon Jul 13, 2013
Ok, thanks for the intro! I'll try that out.
ryao commentedon Mar 6, 2014
I can reproduce this on Gentoo Linux with the following commands:
It seems that the problem is that the check for libdwarf in tools/mkport.pl is broken. The check will never select libdwarf. Modifying tools/mkport.pl to force libdwarf to be used allows things to work.
As for libelf, this appears to be the commit that broke compatibility:
https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=0cf762c2d960cd64e72d8637db0c38102bd6a4ee
dtrace4linux commentedon Mar 6, 2014
Thanks for attempting to locate the broken commit. The state of ELF is
forever broken on all kernels because of the horrible history of the two
dwarf libraries. I have given up trying to salvage the horrible nature of
the mess. Its a shame because the owner of libdwarf has done a good job,
but the horrible state of all distros and trying to cater for both ELF
libraries - you can have either or both installed, is really painful.
My next attempt to fix and remove this is to avoid libdwarf and use the
readelf tool instead.
The situation is so bad, because I am always confused whether libdwarf or
libdw is the latest conformant implementation. I have looked at the
implementation of dwarf_loclist but it doesnt help - I tried to create a
portable layer between the two libs but abandoned it due to the "just one
more API needs to be grafted" onboard.
I may take another look (using readelf - or any other tool which works)
since I am now going to look at another kernel bug/issue on ubuntu 12.04.
On 6 March 2014 02:38, Richard Yao notifications@github.com wrote:
gaojx commentedon Oct 17, 2014
I got the same comiple error on centos:
/mnt/disk1/home/gaojx/dtrace/linux/cmd/ctfconvert/dwarf.c:581: undefined reference to `dwarf_loclist'
After command: make -i all, command: dtrace load gives:
gaojx commentedon Oct 17, 2014
Sorry, the comment was cut off. Continue last comment:
dtrace: failed to initialize dtrace: DTrace device not available on system
I have the lastest libdwarf installed (from git://libdwarf.git.sourceforge.net/gitroot/libdwarf/libdwarf).
What is natural of this error? I am willing to take a look at the code if you can give me some guideline. We have an important issue that needs dtrace to help out, so significant effort can be devoted to make this work. Any help will be highly appreciated.
dtrace4linux commentedon Oct 17, 2014
You need to read my blog where I have repeatedly discussed this. There are
two incompatible libdwarf libraries out there. dtrace uses one and some
distros deploy the other. I have looked at the dwarf_loclist issue before -
getting ones mind around libdwarf and two competing libraries is harmful to
the brain :-) Since this issue keeps coming up, I need to look again.
(libdwarf vs libdw). One option is to package libdw/dwarf with dtrace but
am loathe to do that. Let me take a look.
On 17 October 2014 22:24, gaojx notifications@github.com wrote:
gaojx commentedon Oct 20, 2014
Thanks for the reply, from which I downloaded and installed the other libdwarf (from github, my first one comes from soureforge). Lo and behold, it builds successfully. make install and make load also runs without issue. Good progress.
However, make test crashes the kernel:
20141020 10:40:07 Test: fbt-a
build/dtrace -n ' BEGIN {
tstart = timestamp;
}
fbt::a*:
{
cnt++;
}
tick-1ms /timestamp - tstart > 5 * 1000 * 1000 * 1000 / {exit(0);}
tick-1s { printf("count so far: %d", cnt); }
tick-5s { exit(0); }
' >/tmp/test-root.fbt-a.log 2>&1
20141020 10:40:07 === Test: fbt-a
-> the system freeze here.
One thing I noticed during the compile:
dtrace/linux/build-2.6.32-431.17.1.el6.x86_64/driver/x_call.c:96:3: warning: #warning "NCPU is large - your module may not load (x_call.c)"
I changed the code to print out the value of NCPU:
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#pragam message "NCPU = " STRING(NCPU)
It prints out: NCPU=496
My linux machine has only 4 cores. In the Changes file:
691* x_call.c: Put in a warning if NCPU is too large - can cause
problems at driver load time (Centos 6.2 has NCPU==4096 which
equates to more than 40MB of memory for the xcall array).
Would this be issue that causes the crash?
gaojx commentedon Oct 20, 2014
A typo correction: the print out for NCPU is: NCPU = 4096.
My centos version: 6.5, linux kernel: 2.6.32-431, x86_64
What does NCPU mean? If it is # of cores on the system, should it be 4 in my case?
dtrace4linux commentedon Oct 20, 2014
Great you got it working. No the ncpu issue isn't the cause of your crash.
It's one of the matching kernel routines...maybe reentrancy. Will need to
look.
On 20 Oct 2014 16:00, "gaojx" notifications@github.com wrote: