Skip to content

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

Open

Description

@s914211

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

Activity

  1. raygush commented on Aug 11, 2015

    @raygush

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

  2. dtrace4linux commented on Aug 11, 2015

    @dtrace4linux
    Owner

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

    Thanks
    On 11 Aug 2015 07:05, "raygush" notifications@github.com wrote:

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

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

  3. aniliitbee commented on Sep 10, 2015

    @aniliitbee

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

  4. DylanGraham commented on Oct 17, 2015

    @DylanGraham

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

  5. v0lkan commented on Nov 15, 2015

    @v0lkan

    Same here.

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

  6. dtrace4linux commented on Nov 16, 2015

    @dtrace4linux
    Owner

    did you pick up the latest release of dtrace?

    On 15 November 2015 at 17:12, Volkan Özçelik notifications@github.com
    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).

  7. DylanGraham commented on Nov 16, 2015

    @DylanGraham

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

  8. douglascodes commented on Nov 21, 2015

    @douglascodes

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

  9. bitfree commented on Dec 2, 2015

    @bitfree

    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

  10. dtrace4linux commented on Dec 2, 2015

    @dtrace4linux
    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 notifications@github.com 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).

  11. bitfree commented on Dec 3, 2015

    @bitfree

    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$

  12. lester289 commented on Dec 10, 2015

    @lester289

    any news here?

  13. dtrace4linux commented on Dec 10, 2015

    @dtrace4linux
    Owner

    Did you download the latest dtrace release?
    On 10 Dec 2015 08:56, "Marcus Alvares" notifications@github.com wrote:

    any news here?

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

  14. lester289 commented on Dec 10, 2015

    @lester289

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

  15. bitfree commented on Dec 11, 2015

    @bitfree

    of course. I downloaded latest..

    2015-12-10 21:07 GMT+09:00 dtrace4linux notifications@github.com:

    Did you download the latest dtrace release?
    On 10 Dec 2015 08:56, "Marcus Alvares" notifications@github.com 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 : bitfree@gmail.com
    mobile : 82-10-6449-2031

  16. bitfree commented on Dec 11, 2015

    @bitfree

    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 notifications@github.com:

    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 : bitfree@gmail.com
    mobile : 82-10-6449-2031

  17. StingerXIII commented on Jun 26, 2020

    @StingerXIII

    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.

  18. 66Ton99 commented on Nov 6, 2020

    @66Ton99

    I have the same problem on Kernel 5.8.16_1

  19. KZYSAKYM commented on Nov 22, 2020

    @KZYSAKYM

    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";
    
  20. adililhan commented on Feb 6, 2021

    @adililhan

    I have the same problem on Kernel 5.4.0, Ubuntu 20.04.1

  21. sbstrkt commented on Jan 4, 2022

    @sbstrkt
  22. gfzhai commented on Jan 28, 2023

    @gfzhai

    Same problem on Kernel 5.10.0, Debian 11

  23. wwlwxg commented on Apr 29, 2024

    @wwlwxg

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions