public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/23599] New: Use of usymname() with stap -u leads to kernel module compilation errors
@ 2018-08-30 23:23 agentzh at gmail dot com
  2018-08-30 23:47 ` [Bug tapsets/23599] " agentzh at gmail dot com
  2018-09-16  3:18 ` agentzh at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2018-08-30 23:23 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=23599

            Bug ID: 23599
           Summary: Use of usymname() with stap -u leads to kernel module
                    compilation errors
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

Consider the following minimal example:

```
$ stap -e 'probe oneshot { println(usymname(0xdeadbeef)) }' -u
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function
‘function___global_print_ubacktrace__overload_0’:
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:1103:5:
error: implicit declaration of function ‘_stp_stack_user_print’; did you mean
‘_stp_stat_per_cpu_ptr’? [-Werror=implicit-function-declaration]
     _stp_stack_user_print(CONTEXT, _STP_SYM_FULL);
     ^~~~~~~~~~~~~~~~~~~~~
     _stp_stat_per_cpu_ptr
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function
‘function___global_sprint_ubacktrace__overload_0’:
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:1365:5:
error: implicit declaration of function ‘_stp_stack_user_sprint’; did you mean
‘_stp_store_deref_string’? [-Werror=implicit-function-declaration]
     _stp_stack_user_sprint (STAP_RETVALUE, MAXSTRINGLEN, CONTEXT,
     ^~~~~~~~~~~~~~~~~~~~~~
     _stp_store_deref_string
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c: In function
‘function___private__opt_stap_old_share_systemtap_tapset_linux_ucontext_symbols_stp___ustack_raw__overload_0’:
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.c:2848:35:
error: implicit declaration of function ‘_stp_stack_user_get’; did you mean
‘_stp_stat_get’? [-Werror=implicit-function-declaration]
                   STAP_RETVALUE = _stp_stack_user_get (CONTEXT,
(unsigned)STAP_ARG_n);
                                   ^~~~~~~~~~~~~~~~~~~
                                   _stp_stat_get
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:324:
/tmp/stapcgQk9g/stap_ca4ae4c5dee3b96fa22873c547018f71_10015_src.o] Error 1
make: *** [Makefile:1565: _module_/tmp/stapcgQk9g] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
```

After removing the `-u` command-line option, this example works as expected
immediately:

```
$ stap -e 'probe oneshot { println(usymname(0xdeadbeef)) }'
0xdeadbeef
```

Seems like use of `usymname()` brings in other unused tapset functions like
`__ustack_raw` in the same tapset file (tapset/linux/ucontext-symbols.stp) but
for some reasons, their `/* unwind */` pragma fails to set the `need_unwind`
flag in the `systemtap_session` object.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/23599] Use of usymname() with stap -u leads to kernel module compilation errors
  2018-08-30 23:23 [Bug tapsets/23599] New: Use of usymname() with stap -u leads to kernel module compilation errors agentzh at gmail dot com
@ 2018-08-30 23:47 ` agentzh at gmail dot com
  2018-09-16  3:18 ` agentzh at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2018-08-30 23:47 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=23599

--- Comment #1 from agentzh <agentzh at gmail dot com> ---
OK, the following quick patch seems to fix this issue:

https://pastebin.com/K1hyYXjq

I'll prepare a formal patch to the mailing list for formal review :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tapsets/23599] Use of usymname() with stap -u leads to kernel module compilation errors
  2018-08-30 23:23 [Bug tapsets/23599] New: Use of usymname() with stap -u leads to kernel module compilation errors agentzh at gmail dot com
  2018-08-30 23:47 ` [Bug tapsets/23599] " agentzh at gmail dot com
@ 2018-09-16  3:18 ` agentzh at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2018-09-16  3:18 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=23599

agentzh <agentzh at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from agentzh <agentzh at gmail dot com> ---
Already committed a fix to master via commit 0ff547ede.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-16  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 23:23 [Bug tapsets/23599] New: Use of usymname() with stap -u leads to kernel module compilation errors agentzh at gmail dot com
2018-08-30 23:47 ` [Bug tapsets/23599] " agentzh at gmail dot com
2018-09-16  3:18 ` agentzh at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).