Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Ubuntu 14.04LTS)Make all error - FATAL ERROR: cannot find old_rsp FATAL ERROR: build.pl aborting #113

Open
s914211 opened this issue Jun 5, 2015 · 23 comments

Comments

@s914211
Copy link

s914211 commented Jun 5, 2015

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

@raygush
Copy link

raygush commented Aug 11, 2015

same issue, any update for this?....

@dtrace4linux
Copy link
Owner

Noupdate. Can u send me a copy of /proc/kallsyms?

Thanks
On 11 Aug 2015 07:05, "raygush" [email protected] wrote:

same issue, any update for this?....


Reply to this email directly or view it on GitHub
#113 (comment).

@aniliitbee
Copy link

Facing same issue in ubuntu 13.04(kernel version: 3.8.0.19-generic)

@DylanGraham
Copy link

Same here with kernel-4.1.10-200.fc22.x86_64
I'll send over the /proc/kallsyms

@v0lkan
Copy link

v0lkan commented Nov 15, 2015

Same here.

Might that be related to me trying to install dtrace in a Docker container on a Mac OS X host?

@dtrace4linux
Copy link
Owner

did you pick up the latest release of dtrace?

On 15 November 2015 at 17:12, Volkan Özçelik [email protected]
wrote:

Same here.

Might that be related to me trying to install dtrace in a Docker
container on a Mac OS X host?


Reply to this email directly or view it on GitHub
#113 (comment).

@DylanGraham
Copy link

Thanks, the new version compiles fine for me now on 4.2.5-300.fc23.x86_64

@douglascodes
Copy link

Similar issue with Archlinux 4.2.5-1 and 4.3.1. Using commit fbd8847

@bitfree
Copy link

bitfree commented 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 -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

@dtrace4linux
Copy link
Owner

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 [email protected] wrote:

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 -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).

@bitfree
Copy link

bitfree commented 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 -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

same issue ?

getfree@LifeBookC:/down/dtrace4linux$ sudo grep old_rsp /proc/kallsyms
getfree@LifeBookC:
/down/dtrace4linux$

@lester289
Copy link

any news here?

@dtrace4linux
Copy link
Owner

Did you download the latest dtrace release?
On 10 Dec 2015 08:56, "Marcus Alvares" [email protected] wrote:

any news here?


Reply to this email directly or view it on GitHub
#113 (comment).

@lester289
Copy link

yes.
here I am running 3.16.0-38-generic 14.04.1-Ubuntu SMP

@bitfree
Copy link

bitfree commented Dec 11, 2015

of course. I downloaded latest..

2015-12-10 21:07 GMT+09:00 dtrace4linux [email protected]:

Did you download the latest dtrace release?
On 10 Dec 2015 08:56, "Marcus Alvares" [email protected] wrote:

any news here?


Reply to this email directly or view it on GitHub
<#113 (comment)
.


Reply to this email directly or view it on GitHub
#113 (comment).

mailto : [email protected]
mobile : 82-10-6449-2031

@bitfree
Copy link

bitfree commented 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

same issue: Ubuntu 4.2.0-18-generic
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

2015-12-10 21:51 GMT+09:00 Marcus Alvares [email protected]:

yes.
here I am running 3.16.0-38-generic #52
#52 SMP


Reply to this email directly or view it on GitHub
#113 (comment).

mailto : [email protected]
mobile : 82-10-6449-2031

@StingerXIII
Copy link

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
Copy link

66Ton99 commented Nov 6, 2020

I have the same problem on Kernel 5.8.16_1

@KZYSAKYM
Copy link

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";

@adililhan
Copy link

I have the same problem on Kernel 5.4.0, Ubuntu 20.04.1

@sbstrkt

This comment has been minimized.

@gfzhai
Copy link

gfzhai commented Jan 28, 2023

Same problem on Kernel 5.10.0, Debian 11

@wwlwxg
Copy link

wwlwxg commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests