stap fails with "error: ‘cpu_possible_map’ undeclared" in function ‘_stp_stat_get’

Bug #1054274 reported by Chris J Arges
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemtap (Ubuntu)
Fix Released
High
Chris J Arges
Quantal
Fix Released
High
Chris J Arges

Bug Description

[Test Case]
Install systemtap
Install linux-image-`uname -r`-dbgsym.
Download example stp: http://sourceware.org/systemtap/examples/general/helloworld.stp
Execute 'sudo stap hellowold.stp'

[What Is Expected]
'hello world' should be printed.

[What Happens]
In file included from /tmp/stapZsREjM/stap_94d698e878ba939284aed4cd44a7dc2a_738_src.c:21:0:
/usr/share/systemtap/runtime/stat.c: In function ‘_stp_stat_get’:
/usr/share/systemtap/runtime/stat.c:214:2: error: ‘cpu_possible_map’ undeclared (first use in this function)
/usr/share/systemtap/runtime/stat.c:214:2: note: each undeclared identifier is reported only once for each function it appears in
/usr/share/systemtap/runtime/stat.c: In function ‘_stp_stat_clear’:
/usr/share/systemtap/runtime/stat.c:249:2: error: ‘cpu_possible_map’ undeclared (first use in this function)
make[1]: *** [/tmp/stapZsREjM/stap_94d698e878ba939284aed4cd44a7dc2a_738_src.o] Error 1
make: *** [_module_/tmp/stapZsREjM] Error 2
WARNING: make exited with status: 2
Pass 4: compilation failed. Try again with another '--vp 0001' option.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: systemtap 1.7-1
ProcVersionSignature: Ubuntu 3.5.0-15.22-generic 3.5.4
Uname: Linux 3.5.0-15-generic x86_64
ApportVersion: 2.5.2-0ubuntu4
Architecture: amd64
Date: Fri Sep 21 13:35:43 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120807.2)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: systemtap
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Chris J Arges (arges) wrote :
Revision history for this message
Chris J Arges (arges) wrote :

Note, this only affects Quantal, this works fine on Precise.

This is directly related to this bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=14220

Revision history for this message
Chris J Arges (arges) wrote :

This fixes the first issue, but then we run into another problem.

$ sudo stap -vvv helloworld.stp
Systemtap translator/driver (version 1.7/0.153 Debian version 1.7-1ubuntu1 (quantal))
Copyright (C) 2005-2012 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBSQLITE3 NSS BOOST_SHARED_PTR TR1_UNORDERED_MAP NLS
Created temporary directory "/tmp/stapgWNqNn"
Session arch: x86_64 release: 3.5.0-15-generic
Parsed kernel "/lib/modules/3.5.0-15-generic/build/.config", containing 5064 tuples
Parsed kernel /lib/modules/3.5.0-15-generic/build/Module.symvers, which contained 6635 vmlinux exports
Searched: " /usr/share/systemtap/tapset/x86_64/*.stp ", found: 4, processed: 4
Searched: " /usr/share/systemtap/tapset/*.stp ", found: 77, processed: 77
Pass 1: parsed user script and 81 library script(s) using 84348virt/22792res/2536shr kb, in 80usr/10sys/89real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) using 84876virt/23584res/2768shr kb, in 0usr/0sys/3real ms.
Pass 3: using cached /home/arges/.systemtap/cache/45/stap_45506aa113333ebdb243bba608a94ae7_738.c
Pass 4: using cached /home/arges/.systemtap/cache/45/stap_45506aa113333ebdb243bba608a94ae7_738.ko
Pass 5: starting run.
Running /usr/bin/staprun -v -v -R /tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko
staprun:main:385 modpath="/tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko", modname="stap_45506aa113333ebdb243bba608a94ae7_738"
staprun:init_staprun:303 init_staprun
staprun:insert_module:72 inserting module /tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko
staprun:insert_module:98 module options: _stp_bufsize=0
staprun:insert_module:106 module path canonicalized to '/tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko'
staprun:check_signature:428 checking signature for /tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko
Signature file /tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko.sgn not found
staprun:check_signature:441 verify_module returns 0
staprun:insert_module:169 Renaming module 'stap_45506aa113333ebdb243bba608a94ae7_738'
staprun:insert_module:177 Renamed module to 'stap_45506aa113333ebdb243bba608a94ae_3547'
Error inserting module '/tmp/stapgWNqNn/stap_45506aa113333ebdb243bba608a94ae7_738.ko': Operation not permitted
Spawn waitpid result (0x100): 1
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run completed in 0usr/0sys/10real ms.
Pass 5: run failed. Try again with another '--vp 00001' option.
Running rm -rf /tmp/stapgWNqNn
Spawn waitpid result (0x0): 0

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "systemtap_lp1054274_fix.debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Chris J Arges (arges) wrote :

I have figured out the issue, because we have a newer kernel there was a patch to handle the new interface and that needed to be added as well.

I have applied this patch and tested it and it does indeed fix the issue.
Thanks,

Changed in systemtap (Ubuntu Quantal):
milestone: none → ubuntu-12.10-beta-2
milestone: ubuntu-12.10-beta-2 → none
Revision history for this message
Timo Juhani Lindfors (timo-lindfors) wrote :

It would be nice if the changelog entry would identify the exact kernel version that is affected by the bug.

Revision history for this message
Chris J Arges (arges) wrote :

It affects Quantal 3.5.x series that have changed register_uprobe to uprobe_register. This patch from upstream systemtap also checks for this symbol and does the right thing.
http://sources.redhat.com/git/?p=systemtap.git;a=commit;h=1312868434fee61eb14d6e3e4aff12a5f1f2647f

So one would have to track down the commit in the Linux kernel that made these name changes to get an exact version.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Would that be commit:

commit 7b2d81d48a2d8e37efb6ce7b4d5ef58822b30d89
Author: Ingo Molnar <email address hidden>
Date: Fri Feb 17 09:27:41 2012 +0100

    uprobes/core: Clean up, refactor and improve the code
...

-extern int register_uprobe(struct inode *inode, loff_t offset,
- struct uprobe_consumer *consumer);
-extern void unregister_uprobe(struct inode *inode, loff_t offset,
- struct uprobe_consumer *consumer);
-extern int mmap_uprobe(struct vm_area_struct *vma);
+extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer);
+extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *consumer);
+extern int uprobe_mmap(struct vm_area_struct *vma);

?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Confirmed that this patch fixes the bug in today's quantal image.

Revision history for this message
Kees Cook (kees) wrote :

Building now, and will upload shortly. Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemtap - 1.7-1ubuntu1

---------------
systemtap (1.7-1ubuntu1) quantal; urgency=low

  * Add fix-stap-compile.diff and uprobes-name-change.diff to address
    usability issues with systemtap and the newer kernel. This fixes
    issues when trying to compile with stap and adjusts for name changes
    in the kernel (7b2d81d48a2d8e37efb6ce7b4d5ef58822b30d89). These are
    both pulled from upstream commits (LP: #1054274).
 -- Chris J Arges <email address hidden> Fri, 21 Sep 2012 15:08:11 -0500

Changed in systemtap (Ubuntu Quantal):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.