systemtap does not work on xenial, struct module changes

Bug #1557673 reported by Dan Streetman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemtap (Ubuntu)
Fix Released
High
Dan Streetman
Xenial
Fix Released
High
Dan Streetman

Bug Description

[Impact]

Attempting to use systemtap on xenial with the 4.4 kernel results in:

ubuntu@xenial:~$ sudo stap test.stap
In file included from /usr/share/systemtap/runtime/print.c:17:0,
                 from /usr/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stapxvNfgC/stap_2e27f5927a5796b18cb7b3c2abd24ec4_812_src.c:50:
/usr/share/systemtap/runtime/linux/print.c: In function ‘_stp_print_kernel_info’:
/usr/share/systemtap/runtime/linux/print.c:242:20: error: ‘struct module’ has no member named ‘module_core’
         THIS_MODULE->module_core,
                    ^
/usr/share/systemtap/runtime/linux/print.c:243:37: error: ‘struct module’ has no member named ‘core_size’
         (unsigned long) (THIS_MODULE->core_size - THIS_MODULE->core_text_size)/1024,
                                     ^
/usr/share/systemtap/runtime/linux/print.c:243:62: error: ‘struct module’ has no member named ‘core_text_size’
         (unsigned long) (THIS_MODULE->core_size - THIS_MODULE->core_text_size)/1024,
                                                              ^
/usr/share/systemtap/runtime/linux/print.c:244:44: error: ‘struct module’ has no member named ‘core_text_size’
                (unsigned long) (THIS_MODULE->core_text_size)/1024,
                                            ^
scripts/Makefile.build:258: recipe for target '/tmp/stapxvNfgC/stap_2e27f5927a5796b18cb7b3c2abd24ec4_812_src.o' failed
make[1]: *** [/tmp/stapxvNfgC/stap_2e27f5927a5796b18cb7b3c2abd24ec4_812_src.o] Error 1
Makefile:1396: recipe for target '_module_/tmp/stapxvNfgC' failed
make: *** [_module_/tmp/stapxvNfgC] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed. [man error::pass4]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.

[Test Case]

on a xenial system with the 4.4 kernel installed, and systemtap and kernel dbgsyms installed, simply create a dummy stap script and try to run it, e.g.:

$ cat test.stap
#!/usr/bin/stap

probe begin {
  println("hello")
}
$ sudo stap test.stap

the above compilation failure will result.

[Regression Potential]

The commit updates stap to use the kernel module header correctly based on a small test program, so there should be no regression, but possible regression is breaking stap on the xenial 4.3 kernel.

[Other Info]

this requires upstream stap commit
3f040971e7efb4d323fcb63d83b4337f355c60db

Tags: patch sts xenial
Dan Streetman (ddstreet)
tags: added: bot-stop-nagging
Dan Streetman (ddstreet)
Changed in systemtap (Ubuntu):
assignee: nobody → Dan Streetman (ddstreet)
status: New → In Progress
Revision history for this message
Frank Ch. Eigler (fche) wrote :

Upstream commit 3f040971e7e should fix this.
(Also, we plan to have a systemtap 3.0 release shortly, with this and other fixes.)

Revision history for this message
Dan Streetman (ddstreet) wrote :

> Upstream commit 3f040971e7e should fix this.

yep

> (Also, we plan to have a systemtap 3.0 release shortly, with this and other fixes.)

great; does that cover wily also? because this is broken there also with wily/lts-xenial kernel. (As well as lp bug 1547644.)

Revision history for this message
Frank Ch. Eigler (fche) wrote :

> does that cover wily also?

Pre-release systemtap is also being tested with pre-release 4.6 linux, so should work fine on wily etc.
I can only speak as upstream, not for ubuntu packaging though.

Dan Streetman (ddstreet)
description: updated
tags: added: sts-sru
removed: bot-stop-nagging
Revision history for this message
Dan Streetman (ddstreet) wrote :

debdiff with backported systemtap upstream commit 3f040971e7efb4d323fcb63d83b4337f355c60db.

Note the upstream commit also changes tapset/linux/context.stp, but the current xenial systemtap source does not include other commits that require this patch to update context.stp, so I removed the context.stp section of the patch.

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

The attachment "lp1557673.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Mathew Hodson (mhodson)
Changed in systemtap (Ubuntu):
importance: Undecided → High
tags: added: xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemtap - 2.9-2ubuntu2

---------------
systemtap (2.9-2ubuntu2) xenial; urgency=medium

  * d/p/0001-Fix-PR9497-by-updating-the-runtime-to-handle-linux-4.patch:
    Fix stap compilation after kernel 4.4 commit 7523e4dc50. (LP: #1557673)

 -- Dan Streetman <email address hidden> Wed, 16 Mar 2016 18:46:37 +0000

Changed in systemtap (Ubuntu Xenial):
status: In Progress → Fix Released
Revision history for this message
Yang Wei (wyang8) wrote :

 sudo dpkg -l | grep systemtap
ii systemtap 2.3-1ubuntu1.4 amd64 instrumentation system for Linux
ii systemtap-common 2.3-1ubuntu1.4 all instrumentation system for Linux (common component)
ii systemtap-runtime 2.3-1ubuntu1.4 amd64 instrumentation system for Linux (runtime component)
ii systemtap-sdt-dev 2.3-1ubuntu1 amd64 statically defined probes development files

➜ cv uname -r
4.4.0-21-generic

The latest systemtap package is still not fixed until now.

Revision history for this message
Yang Wei (wyang8) wrote :

I am using Trusty, so when is it fixed on Trusty?

Louis Bouchard (louis)
tags: removed: sts-sru
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.