public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/30987] New: Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation
@ 2023-10-20 14:42 wcohen at redhat dot com
  2023-10-24 18:15 ` [Bug runtime/30987] " wcohen at redhat dot com
  2023-10-25 16:00 ` wcohen at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: wcohen at redhat dot com @ 2023-10-20 14:42 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 30987
           Summary: Addition of strlcopy and strlcat to glibc prevents
                    compilation of dyninst based systemtap instrumentation
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: wcohen at redhat dot com
  Target Milestone: ---

On Fedora rawhide the systemtap "make installcheck" tests building
instrumentation using dyninst fail to compile because glibc has added strlcpy
and strlcat to the /usr/include/string.h file and those declarations conflict
with the static inlined functioned in runtime/dynsint/linux_defs.h.  This is
causing over 400 failures on rawhide for the "make installcheck".  Can
replicate with:

 sudo make installcheck RUNTESTFLAGS="systemtap.base/ret-uprobe-var.exp"


And see following in the output:

FAIL: ret-uprobe-var: TEST 1: @var in return probes should not be stale (4.1+)
(dyninst): stderr: string should be "", but got "In file included from
/home/wcohen/systemtap_write/install/share/systemtap/runtime/dyninst/runtime.h:92,
                 from
/home/wcohen/systemtap_write/install/share/systemtap/runtime/runtime.h:30,
                 from
/tmp/stapDni8D1/stap_e18df6414ee02f320dd0e235e95dc3d9_2203_src.c:21:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/dyninst/linux_defs.h:100:22:
error: static declaration of 'strlcpy' follows non-static declaration
  100 | static inline size_t strlcpy(char *__restrict dest, const char
*__restrict src, size_t size)
      |                      ^~~~~~~
In file included from
/home/wcohen/systemtap_write/install/share/systemtap/runtime/dyninst/runtime.h:22:
/usr/include/string.h:506:15: note: previous declaration of 'strlcpy' with type
'size_t(char * restrict,  const char * restrict,  size_t)' {aka 'long unsigned
int(char * restrict,  const char * restrict,  long unsigned int)'}
  506 | extern size_t strlcpy (char *__restrict __dest,
      |               ^~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/dyninst/linux_defs.h:112:22:
error: static declaration of 'strlcat' follows non-static declaration
  112 | static inline size_t strlcat(char *__restrict dest, const char
*__restrict src, size_t count)
      |                      ^~~~~~~
/usr/include/string.h:512:15: note: previous declaration of 'strlcat' with type
'size_t(char * restrict,  const char * restrict,  size_t)' {aka 'long unsigned
int(char * restrict,  const char * restrict,  long unsigned int)'}
  512 | extern size_t strlcat (char *__restrict __dest,
      |               ^~~~~~~
WARNING: gcc exited with status: 1
Pass 4: compilation failed.  [man error::pass4]
"

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

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

* [Bug runtime/30987] Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation
  2023-10-20 14:42 [Bug runtime/30987] New: Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation wcohen at redhat dot com
@ 2023-10-24 18:15 ` wcohen at redhat dot com
  2023-10-25 16:00 ` wcohen at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: wcohen at redhat dot com @ 2023-10-24 18:15 UTC (permalink / raw)
  To: systemtap

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

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
Was originally thinking that could do a STAPCONF* define as for various kernel
changes.  However, for the dyninst backend those autoconf tests are not run and
use the define to control whether the strlcat and strlcpy inline functions are
provided.

As strlcat and strlcpy are inlined functions can't really make the inline
function and the glibc string.h declarations line up.

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

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

* [Bug runtime/30987] Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation
  2023-10-20 14:42 [Bug runtime/30987] New: Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation wcohen at redhat dot com
  2023-10-24 18:15 ` [Bug runtime/30987] " wcohen at redhat dot com
@ 2023-10-25 16:00 ` wcohen at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: wcohen at redhat dot com @ 2023-10-25 16:00 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

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

--- Comment #2 from William Cohen <wcohen at redhat dot com> ---
This is fixed by commit b94816005cf7bb78b14f916d3ba246a623b9560c 
Author: William Cohen <wcohen@redhat.com>
Date:   Wed Oct 25 11:51:17 2023 -0400

    PR30987: Exclude strlcpy and strlcat for glibc 2.38 and newer

    The glibc library added strlcpy and strlcat.  The inlined functions in
    runtime/dyninst/linux_defs.h conflicted with the glibc declarations of
    those functions in /usr/include/string.h.  Now linux_defs.h only
    defines those functions for older version of glibc that do not include
    them.

-- 
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:[~2023-10-25 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 14:42 [Bug runtime/30987] New: Addition of strlcopy and strlcat to glibc prevents compilation of dyninst based systemtap instrumentation wcohen at redhat dot com
2023-10-24 18:15 ` [Bug runtime/30987] " wcohen at redhat dot com
2023-10-25 16:00 ` wcohen at redhat 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).