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
Hello! I try a lot to use Dtrace for my project, but this time I found another error. Please give me some advice to solve these two problems. Thank you!
Below is the error message:
BUILD_DIR=build-3.16.0-38-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-3.16.0-38-generic uname -m
symlink ../../driver-kmem/Makefile build-3.16.0-38-generic/driver-kmem/Makefile
symlink ../../driver-kmem/dtrace_kmem.c build-3.16.0-38-generic/driver-kmem/dtrace_kmem.c
Executing: /home/tommy/dtrace-20150521/tools/make-me
make -C /lib/modules/3.16.0-38-generic/build M=/home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem
LD /home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/built-in.o
CC [M] /home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/dtrace_kmem.o
/home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/dtrace_kmem.c: In function 'kmem_read':
/home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/dtrace_kmem.c:44:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
n = copy_to_user(buf, (char ) off2, len);
^
Building modules, stage 2.
MODPOST 1 modules
CC /home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/dtrace_kmem.mod.o
LD [M] /home/tommy/dtrace-20150521/build-3.16.0-38-generic/driver-kmem/dtrace_kmem.ko
gcc -o build-3.16.0-38-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/usr/bin/ld: cannot find -ldw
collect2: error: ld returned 1 exit status
Failed to find stub_execve
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
make: ** [all] Error 25
getfree@LifeBookC:~/PycharmProjects/dtrace4linux/linux$ tools/get-deps.pl
[sudo] password for getfree:
Reading package lists... Done
Building dependency tree
Reading state information... Done
bison is already the newest version.
flex is already the newest version.
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libelf-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
binutils-dev is already the newest version.
elfutils is already the newest version.
libc6-dev is already the newest version.
libelf-dev is already the newest version.
libiberty-dev is already the newest version.
zlib1g-dev is already the newest version.
linux-headers-4.2.0-18-generic is already the newest version.
linux-libc-dev is already the newest version.
The following packages will be REMOVED:
libdw-dev
The following NEW packages will be installed:
libdwarf-dev
0 upgraded, 1 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/693 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 416943 files and directories currently installed.)
Removing libdw-dev:i386 (0.163-4ubuntu1) ...
Selecting previously unselected package libdwarf-dev.
(Reading database ... 416935 files and directories currently installed.)
Preparing to unpack .../libdwarf-dev_20120410-2_i386.deb ...
Unpacking libdwarf-dev (20120410-2) ...
Setting up libdwarf-dev (20120410-2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++-multilib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
make all
BUILD_DIR=build-4.2.0-18-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.2.0-18-generic uname -m
Executing: /home/getfree/PycharmProjects/dtrace4linux/linux/tools/make-me
make -C /lib/modules/4.2.0-18-generic/build M=/home/getfree/PycharmProjects/dtrace4linux/linux/build-4.2.0-18-generic/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.2.0-18-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/usr/bin/ld: cannot find -ldw
collect2: error: ld returned 1 exit status
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
makefile:67: recipe for target 'all' failed
make: *** [all] Error 25
Looks to me like libdw is missing in the output - so "stuff" isnt going to
work. The get-deps.pl script is a good start for deps, but maybe I missed
one. Can you install that?
getfree@LifeBookC:~/PycharmProjects/dtrace4linux/linux$ tools/get-deps.pl
[sudo] password for getfree:
Reading package lists... Done
Building dependency tree
Reading state information... Done
bison is already the newest version.
flex is already the newest version.
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libelf-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
binutils-dev is already the newest version.
elfutils is already the newest version.
libc6-dev is already the newest version.
libelf-dev is already the newest version.
libiberty-dev is already the newest version.
zlib1g-dev is already the newest version.
linux-headers-4.2.0-18-generic is already the newest version.
linux-libc-dev is already the newest version.
The following packages will be REMOVED:
libdw-dev
The following NEW packages will be installed:
libdwarf-dev
0 upgraded, 1 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/693 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 416943 files and directories currently installed.)
Removing libdw-dev:i386 (0.163-4ubuntu1) ...
Selecting previously unselected package libdwarf-dev.
(Reading database ... 416935 files and directories currently installed.)
Preparing to unpack .../libdwarf-dev_20120410-2_i386.deb ...
Unpacking libdwarf-dev (20120410-2) ...
Setting up libdwarf-dev (20120410-2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++-multilib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
make all
BUILD_DIR=build-4.2.0-18-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.2.0-18-generic uname -m
Executing: /home/getfree/PycharmProjects/dtrace4linux/linux/tools/make-me
make -C /lib/modules/4.2.0-18-generic/build
M=/home/getfree/PycharmProjects/dtrace4linux/linux/build-4.2.0-18-generic/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.2.0-18-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/usr/bin/ld: cannot find -ldw
collect2: error: ld returned 1 exit status
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at
tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
makefile:67: recipe for target 'all' failed
make: *** [all] Error 25
—
Reply to this email directly or view it on GitHub #113 (comment).
getfree@LifeBookC:~/down/dtrace4linux$ sudo apt-get install libdw-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libdwarf-dev
The following NEW packages will be installed:
libdw-dev
0 upgraded, 1 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/176 kB of archives.
After this operation, 361 kB disk space will be freed.
Do you want to continue? [Y/n]y
getfree@LifeBookC:~/down/dtrace4linux$ make all
BUILD_DIR=build-4.2.0-18-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.2.0-18-generic uname -m
Executing: /home/getfree/Downloads/dtrace4linux/tools/make-me
make -C /lib/modules/4.2.0-18-generic/build M=/home/getfree/Downloads/dtrace4linux/build-4.2.0-18-generic/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.2.0-18-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
makefile:67: recipe for target 'all' failed
make: *** [all] Error 25
Well, they renamed old_rsp into rsp_scratch at kernel version 4.2. But then removed rsp_scratch at version 4.20 (this patch). So, as for kernels 4.20+ it fails to get rsp. We need to get rsp value somehow according to this patch.
Well, they renamed old_rsp into rsp_scratch at kernel version 4.2. But then removed rsp_scratch at version 4.20 (this patch). So, as for kernels 4.20+ it fails to get rsp. We need to get rsp value somehow according to this patch.
I can get the symbol cpu_tss_rw by get_symbol("cpu_tss_rw").
TSS_sp2 is the offset to sp2 member of struct x86_hw_tss of cpu_tss_rw from my understanding.
So, I guess that adding some lines like the following will work, but I dont' know how to get the offset to sp2 in perl.
tools/mkport.pl
if (!$old_rsp) {
$old_rsp = get_symbol("rsp_scratch");
}
+ if (!$old_rsp) {
+ my $cpu_tss_rw = get_symbol("cpu_tss_rw");
+ my $TSS_sp2 = <CODE TO GET THE OFFSET TO `sp2`>;
+ if ($cpu_tss_rw && $TSS_sp2) {
+ $old_rsp = ($cpu_tss_rw + $TSS_sp2);
+ } else {
+ print STDERR <<EOF;
+cpu_tss_rw= $cpu_tss_rw
+EOF
+ print STDERR <<EOF;
+TSS_sp2= $TSS_sp2
+EOF
+ }
+ }
print "old_rsp=$old_rsp\n";
if ($old_rsp) {
$inc .= "# define OLD_RSP_VAL 0x$old_rsp\n";
I have the same problem on Linux version 5.15.0-105-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024
Activity
raygush commentedon Aug 11, 2015
same issue, any update for this?....
dtrace4linux commentedon Aug 11, 2015
Noupdate. Can u send me a copy of /proc/kallsyms?
Thanks
On 11 Aug 2015 07:05, "raygush" notifications@github.com wrote:
aniliitbee commentedon Sep 10, 2015
Facing same issue in ubuntu 13.04(kernel version: 3.8.0.19-generic)
DylanGraham commentedon Oct 17, 2015
Same here with kernel-4.1.10-200.fc22.x86_64
I'll send over the /proc/kallsyms
v0lkan commentedon Nov 15, 2015
Same here.
Might that be related to me trying to install
dtracein a Docker container on a Mac OS X host?dtrace4linux commentedon Nov 16, 2015
did you pick up the latest release of dtrace?
On 15 November 2015 at 17:12, Volkan Özçelik notifications@github.com
wrote:
DylanGraham commentedon Nov 16, 2015
Thanks, the new version compiles fine for me now on 4.2.5-300.fc23.x86_64
douglascodes commentedon Nov 21, 2015
Similar issue with Archlinux 4.2.5-1 and 4.3.1. Using commit fbd8847
bitfree commentedon Dec 2, 2015
same issue: Ubuntu 4.2.0-18-generic
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily
getfree@LifeBookC:~/PycharmProjects/dtrace4linux/linux$ tools/get-deps.pl
[sudo] password for getfree:
Reading package lists... Done
Building dependency tree
Reading state information... Done
bison is already the newest version.
flex is already the newest version.
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libelf-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libc6-dev' instead of 'libc-dev'
binutils-dev is already the newest version.
elfutils is already the newest version.
libc6-dev is already the newest version.
libelf-dev is already the newest version.
libiberty-dev is already the newest version.
zlib1g-dev is already the newest version.
linux-headers-4.2.0-18-generic is already the newest version.
linux-libc-dev is already the newest version.
The following packages will be REMOVED:
libdw-dev
The following NEW packages will be installed:
libdwarf-dev
0 upgraded, 1 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/693 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 416943 files and directories currently installed.)
Removing libdw-dev:i386 (0.163-4ubuntu1) ...
Selecting previously unselected package libdwarf-dev.
(Reading database ... 416935 files and directories currently installed.)
Preparing to unpack .../libdwarf-dev_20120410-2_i386.deb ...
Unpacking libdwarf-dev (20120410-2) ...
Setting up libdwarf-dev (20120410-2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++-multilib is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
make all
BUILD_DIR=build-4.2.0-18-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.2.0-18-generic
uname -mExecuting: /home/getfree/PycharmProjects/dtrace4linux/linux/tools/make-me
make -C /lib/modules/4.2.0-18-generic/build M=/home/getfree/PycharmProjects/dtrace4linux/linux/build-4.2.0-18-generic/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.2.0-18-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
/usr/bin/ld: cannot find -ldw
collect2: error: ld returned 1 exit status
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
makefile:67: recipe for target 'all' failed
make: *** [all] Error 25
dtrace4linux commentedon Dec 2, 2015
Looks to me like libdw is missing in the output - so "stuff" isnt going to
work. The get-deps.pl script is a good start for deps, but maybe I missed
one. Can you install that?
On 2 December 2015 at 00:59, bitfree notifications@github.com wrote:
bitfree commentedon Dec 3, 2015
getfree@LifeBookC:~/down/dtrace4linux$ sudo apt-get install libdw-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libdwarf-dev
The following NEW packages will be installed:
libdw-dev
0 upgraded, 1 newly installed, 1 to remove and 3 not upgraded.
Need to get 0 B/176 kB of archives.
After this operation, 361 kB disk space will be freed.
Do you want to continue? [Y/n]y
getfree@LifeBookC:~/down/dtrace4linux$ make all
BUILD_DIR=build-4.2.0-18-generic
tools/mkdriver.pl driver-kmem ;
tools/build.pl build-4.2.0-18-generic
uname -mExecuting: /home/getfree/Downloads/dtrace4linux/tools/make-me
make -C /lib/modules/4.2.0-18-generic/build M=/home/getfree/Downloads/dtrace4linux/build-4.2.0-18-generic/driver-kmem
Building modules, stage 2.
MODPOST 1 modules
gcc -o build-4.2.0-18-generic/kcore tools/kcore.c
tools/check_dep.pl
tools/mkport.pl
Failed to find stub_execve
Use of uninitialized value $old_rsp in concatenation (.) or string at tools/mkport.pl line 144.
old_rsp=
We cannot find old_rsp or per_cpu__old_rsp in your kernel.
Additionally, it looks like /proc/kcore is broken on your kernel,
meaning we cannot poke to find this variable, which helps identify
kernel thread offsets.
FATAL ERROR: cannot find old_rsp
FATAL ERROR: build.pl aborting
makefile:67: recipe for target 'all' failed
make: *** [all] Error 25
same issue ?
getfree@LifeBookC:
/down/dtrace4linux$ sudo grep old_rsp /proc/kallsyms/down/dtrace4linux$getfree@LifeBookC:
lester289 commentedon Dec 10, 2015
any news here?
dtrace4linux commentedon Dec 10, 2015
Did you download the latest dtrace release?
On 10 Dec 2015 08:56, "Marcus Alvares" notifications@github.com wrote:
lester289 commentedon Dec 10, 2015
yes.
here I am running 3.16.0-38-generic 14.04.1-Ubuntu SMP
bitfree commentedon Dec 11, 2015
of course. I downloaded latest..
2015-12-10 21:07 GMT+09:00 dtrace4linux notifications@github.com:
mailto : bitfree@gmail.com
mobile : 82-10-6449-2031
bitfree commentedon Dec 11, 2015
there are no problems in 3.x kernel
there is no problem old_rsp in 64bit linux machine only in 32bit machines
2015-12-10 21:51 GMT+09:00 Marcus Alvares notifications@github.com:
mailto : bitfree@gmail.com
mobile : 82-10-6449-2031
StingerXIII commentedon Jun 26, 2020
Well, they renamed old_rsp into rsp_scratch at kernel version 4.2. But then removed rsp_scratch at version 4.20 (this patch). So, as for kernels 4.20+ it fails to get rsp. We need to get rsp value somehow according to this patch.
66Ton99 commentedon Nov 6, 2020
I have the same problem on Kernel 5.8.16_1
KZYSAKYM commentedon Nov 22, 2020
I can get the symbol
cpu_tss_rwbyget_symbol("cpu_tss_rw").TSS_sp2 is the offset to
sp2member ofstruct x86_hw_tssofcpu_tss_rwfrom my understanding.So, I guess that adding some lines like the following will work, but I dont' know how to get the offset to
sp2in perl.adililhan commentedon Feb 6, 2021
I have the same problem on Kernel 5.4.0, Ubuntu 20.04.1
sbstrkt commentedon Jan 4, 2022
gfzhai commentedon Jan 28, 2023
Same problem on Kernel 5.10.0, Debian 11
wwlwxg commentedon Apr 29, 2024
I have the same problem on Linux version 5.15.0-105-generic (buildd@lcy02-amd64-007) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #115-Ubuntu SMP Mon Apr 15 09:52:04 UTC 2024