Bug 22551 - on rawhide, we're getting a compile error that init_timer() doesn't exist
Summary: on rawhide, we're getting a compile error that init_timer() doesn't exist
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-05 22:30 UTC by David Smith
Modified: 2017-12-08 01:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2017-12-05 22:30:58 UTC
On 4.15.0-0.rc1.git3.1.fc28.x86_64, I'm seeing the following:

====
stap -p4 -e 'probe begin { exit() }'
In file included from /usr/local/share/systemtap/runtime/transport/transport.c:65:0,
                 from /usr/local/share/systemtap/runtime/linux/print.c:17,
                 from /usr/local/share/systemtap/runtime/print.c:17,
                 from /usr/local/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stapn0pvvU/stap_a64b174160f580702e3079239f11b6ac_1080_src.c:53:
/usr/local/share/systemtap/runtime/transport/relay_v2.c: In function ‘__stp_relay_timer_init’:
/usr/local/share/systemtap/runtime/transport/relay_v2.c:154:2: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
  init_timer(&_stp_relay_data.timer);
  ^~~~~~~~~~
  init_timers
/usr/local/share/systemtap/runtime/transport/relay_v2.c:156:33: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  _stp_relay_data.timer.function = __stp_relay_wakeup_timer;
                                 ^
/usr/local/share/systemtap/runtime/transport/relay_v2.c:157:23: error: ‘struct timer_list’ has no member named ‘data’
  _stp_relay_data.timer.data = 0;
                       ^
In file included from /usr/local/share/systemtap/runtime/linux/print.c:17:0,
                 from /usr/local/share/systemtap/runtime/print.c:17,
                 from /usr/local/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stapn0pvvU/stap_a64b174160f580702e3079239f11b6ac_1080_src.c:53:
/usr/local/share/systemtap/runtime/transport/transport.c: In function ‘_stp_attach’:
/usr/local/share/systemtap/runtime/transport/transport.c:328:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
  _stp_ctl_work_timer.function = _stp_ctl_work_callback;
                               ^
/usr/local/share/systemtap/runtime/transport/transport.c:329:21: error: ‘struct timer_list’ has no member named ‘data’
  _stp_ctl_work_timer.data= 0;
                     ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:310: /tmp/stapn0pvvU/stap_a64b174160f580702e3079239f11b6ac_1080_src.o] Error 1
make: *** [Makefile:1506: _module_/tmp/stapn0pvvU] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
====

The first error, "implicit declaration of function ‘init_timer’" seems to be caused by the following upstream kernel commit:

====
commit 7eeb6b893bd28c68b6d664de1d3120e49b855cdb
Author: Kees Cook <keescook@chromium.org>
Date:   Wed Oct 11 23:13:49 2017 -0700

    timer: Remove init_timer() interface
    
    All users of init_timer() have been updated. Remove the ancient interface.
====
Comment 1 David Smith 2017-12-06 20:38:21 UTC
Fixed in commit fbb26e17a.
Comment 2 Lu Fengqi 2017-12-07 04:47:19 UTC
(In reply to David Smith from comment #1)
> Fixed in commit fbb26e17a.

Hi, I am new to systemtap.

Of course, your patch is better than mine. However, I have also posted a patch to fix this case three days ago.

https://sourceware.org/ml/systemtap/2017-q4/msg00164.html

Although I've read HACKING to understand the contribution procedures to systemtap, I'm still not sure whether it is enough to send the patch to the mailing list (when I want to contribute to systemtap next time). For example, do I need to report a bug on Bugzilla first?

If possible could you please tell me about how to contribute to systemtap.

Thanks,
Lu
Comment 3 Frank Ch. Eigler 2017-12-07 10:44:09 UTC
(In reply to Lu Fengqi from comment #2)
> Of course, your patch is better than mine. However, I have also posted a
> patch to fix this case three days ago.
> https://sourceware.org/ml/systemtap/2017-q4/msg00164.html

That is great, sorry that your patch was just accidentally overlooked.


> If possible could you please tell me about how to contribute to systemtap.

You did the right thing.  I don't think this overlooking will happen again.  To make it even more unlikely, please consider also opening a bugzilla report about such problems.  That way the chances of "crossed wires" is smaller.

Thanks again!
Comment 4 Lu Fengqi 2017-12-07 12:00:28 UTC
(In reply to Frank Ch. Eigler from comment #3)
> (In reply to Lu Fengqi from comment #2)
> > Of course, your patch is better than mine. However, I have also posted a
> > patch to fix this case three days ago.
> > https://sourceware.org/ml/systemtap/2017-q4/msg00164.html
> 
> That is great, sorry that your patch was just accidentally overlooked.
> 

It does not matter, I know how to do it later more importantly. 

> 
> > If possible could you please tell me about how to contribute to systemtap.
> 
> You did the right thing.  I don't think this overlooking will happen again. 
> To make it even more unlikely, please consider also opening a bugzilla
> report about such problems.  That way the chances of "crossed wires" is
> smaller.
> 
> Thanks again!


Thank you for taking the time to reply me.
Comment 5 David Smith 2017-12-07 16:01:34 UTC
(In reply to Lu Fengqi from comment #2)
> (In reply to David Smith from comment #1)
> > Fixed in commit fbb26e17a.
> 
> Hi, I am new to systemtap.
> 
> Of course, your patch is better than mine. However, I have also posted a
> patch to fix this case three days ago.
> 
> https://sourceware.org/ml/systemtap/2017-q4/msg00164.html

I'm so sorry about that. I've been out, and in the crush to catch up I missed your patch. Thanks so much for trying to help out.
Comment 6 Lu Fengqi 2017-12-08 01:32:00 UTC
(In reply to David Smith from comment #5)
> (In reply to Lu Fengqi from comment #2)
> > (In reply to David Smith from comment #1)
> > > Fixed in commit fbb26e17a.
> > 
> > Hi, I am new to systemtap.
> > 
> > Of course, your patch is better than mine. However, I have also posted a
> > patch to fix this case three days ago.
> > 
> > https://sourceware.org/ml/systemtap/2017-q4/msg00164.html
> 
> I'm so sorry about that. I've been out, and in the crush to catch up I
> missed your patch. Thanks so much for trying to help out.

It doesn't matter. Thank you for your contribution to systemtap. It is very helpful for my job.