Bug 1240682 - Systemtap is broken on Rawhide
Summary: Systemtap is broken on Rawhide
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-07 14:02 UTC by Ruben Kerkhof
Modified: 2015-10-23 16:19 UTC (History)
11 users (show)

Fixed In Version: systemtap-2.9-1.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-23 16:19:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ruben Kerkhof 2015-07-07 14:02:52 UTC
Description of problem:

I was trying to run the following simple probe:

ruben@wodan: ~$ sudo stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
Pass 1: parsed user script and 122 library script(s) using 237480virt/49484res/7192shr/42152data kb, in 190usr/70sys/250real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 4 embed(s), 0 global(s) using 376932virt/183612res/8544shr/181604data kb, in 2170usr/1540sys/4358real ms.
Pass 3: translated to C into "/tmp/stapbdpxn3/stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693_src.c" using 376932virt/183860res/8792shr/181604data kb, in 10usr/390sys/417real ms.
In file included from include/linux/mutex.h:15:0,
                 from /tmp/stapbdpxn3/stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693_src.c:25:
include/linux/spinlock_types.h:55:14: error: ‘__ARCH_SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
  .raw_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
              ^
include/linux/spinlock_types.h:79:15: note: in expansion of macro ‘__RAW_SPIN_LOCK_INITIALIZER’
  { { .rlock = __RAW_SPIN_LOCK_INITIALIZER(lockname) } }
               ^
include/linux/spinlock_types.h:82:16: note: in expansion of macro ‘__SPIN_LOCK_INITIALIZER’
  (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
                ^
include/linux/mutex.h:111:18: note: in expansion of macro ‘__SPIN_LOCK_UNLOCKED’
   , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
                  ^
include/linux/mutex.h:117:27: note: in expansion of macro ‘__MUTEX_INITIALIZER’
  struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
                           ^
/tmp/stapbdpxn3/stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693_src.c:26:8: note: in expansion of macro ‘DEFINE_MUTEX’
 static DEFINE_MUTEX(module_refresh_mutex);
        ^
scripts/Makefile.build:258: recipe for target '/tmp/stapbdpxn3/stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693_src.o' failed
make[1]: *** [/tmp/stapbdpxn3/stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693_src.o] Error 1
Makefile:1386: recipe for target '_module_/tmp/stapbdpxn3' failed
make: *** [_module_/tmp/stapbdpxn3] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_a0ec17f995e8f89d672d8c2eb7fe7c24_1693.ko" in 8650usr/5580sys/15546real ms.
Pass 4: compilation failed.  [man error::pass4]


Version-Release number of selected component (if applicable):
systemtap-2.8-1.fc23.x86_64
ruben@wodan: ~$ uname -r
4.2.0-0.rc0.git4.1.fc23.x86_64

Comment 1 David Smith 2015-07-07 14:24:29 UTC
I'm seeing the same thing, looking into it now.

Comment 2 David Smith 2015-07-07 15:18:03 UTC
It looks like this was caused by the addition of qspinlocks in the following kernel commit:

====
commit a33fda35e3a7655fb7df756ed67822afb5ed5e8d
Author: Waiman Long <Waiman.Long>
Date:   Fri Apr 24 14:56:30 2015 -0400

    locking/qspinlock: Introduce a simple generic 4-byte queued spinlock
====

With this change we need to include linux/module.h before including linux/mutex.h.

To fix your immediate problem, add the following text to /usr/share/systemtap/runtime/linux/runtime_defines.h:

====
#ifndef _LINUX_RUNTIME_DEFINES_H_
#define _LINUX_RUNTIME_DEFINES_H_

#include <linux/module.h>
#include <linux/mutex.h>

#endif /* _LINUX_RUNTIME_DEFINES_H_ */
====

I'm not 100% sure if that's the final fix, but it will get you going again.

Comment 3 David Smith 2015-07-07 15:48:32 UTC
The final fix ended up being a small tweak to our code generation - commit 320e1ec.

<https://www.sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commitdiff;h=320e1ecb16427b5769f0f5a097d80823ee1fb765>

Comment 4 Ruben Kerkhof 2015-07-07 17:16:49 UTC
Thanks for the quick fix David!

Comment 5 Marcelo Ricardo Leitner 2015-09-14 21:55:12 UTC
Hi David, would it be possible to do a F21 update too? It's also broken by this bug. Thanks.

Comment 6 David Smith 2015-09-15 21:13:05 UTC
(In reply to Marcelo Ricardo Leitner from comment #5)
> Hi David, would it be possible to do a F21 update too? It's also broken by
> this bug. Thanks.

Thanks for letting us know. I'll see if we can't get an update out soon for f21 (and f22).

Comment 7 David Smith 2015-09-16 16:25:47 UTC
(In reply to Marcelo Ricardo Leitner from comment #5)
> Hi David, would it be possible to do a F21 update too? It's also broken by
> this bug. Thanks.

Marcelo,

Have you got a reproducer for this bug on f21? The one in comment #1 seems to work fine there.

Comment 8 Marcelo Ricardo Leitner 2015-09-16 17:22:50 UTC
Oops. Then it depends on kernel version. I'm running a custom one, 4.2.0-rc8+, and the one in comment #0 reproduces it in here (greped for brevity):

[root@localhost ~]# stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}' 2>&1 | grep error
include/linux/spinlock_types.h:55:14: error: ‘__ARCH_SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
Pass 4: compilation failed.  [man error::pass4]
[root@localhost ~]# uname -r
4.2.0-rc8+
[root@localhost ~]# cat /etc/fedora-release 
Fedora release 21 (Twenty One)
[root@localhost ~]# rpm -q systemtap
systemtap-2.8-1.fc21.x86_64

I also cannot reproduce it with 4.1.6-100.fc21.x86_64.
Now checking, the fix seems to be compatible with both, just yeah not strictly needed for f21.. I hope it's okay to include it anyway.

Comment 9 Fedora Update System 2015-09-17 13:52:55 UTC
systemtap-2.8-2.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16095

Comment 10 Fedora Update System 2015-09-18 05:20:38 UTC
systemtap-2.8-2.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update systemtap'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16095

Comment 11 Fedora Update System 2015-10-11 21:39:34 UTC
systemtap-2.9-1.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-9ef098b6d4

Comment 12 Fedora Update System 2015-10-13 18:21:16 UTC
systemtap-2.9-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update systemtap'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-9ef098b6d4

Comment 13 Fedora Update System 2015-10-23 16:19:49 UTC
systemtap-2.9-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.