public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "ross at burtonini dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/28778] New: printf() generated code causes GCC errors
Date: Thu, 13 Jan 2022 21:24:29 +0000	[thread overview]
Message-ID: <bug-28778-6586@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 28778
           Summary: printf() generated code causes GCC errors
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: ross at burtonini dot com
  Target Milestone: ---

With a trivial probe using printf:

probe oneshot { printf("Hello, %s\n", "world!") }

I get GCC errors:

In file included from /usr/share/systemtap/runtime/linux/print.c:18,
                 from /usr/share/systemtap/runtime/print.c:17,
                 from /usr/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stapGu6dBo/stap_3672_src.c:54:
/usr/share/systemtap/runtime/vsprintf.c: In function
'_stp_vsprint_memory_size.constprop':
/usr/share/systemtap/runtime/vsprintf.c:413:23: error: 'strnlen' specified
bound 4294967295 may exceed maximum object size 2147483647
[-Werror=stringop-overread]
  413 |                 len = strnlen(ptr, precision);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/vsprintf.c: In function
'_stp_vsprint_memory.constprop':
/usr/share/systemtap/runtime/vsprintf.c:341:23: error: 'strnlen' specified
bound 4294967295 may exceed maximum object size 2147483647
[-Werror=stringop-overread]
  341 |                 len = strnlen(ptr, precision);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Kernel 5.10.97, SystemTap 4.6, GCC 11.2 on qemu-system-arm (32-bit).

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

             reply	other threads:[~2022-01-13 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 21:24 ross at burtonini dot com [this message]
2022-01-13 23:35 ` [Bug translator/28778] " fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28778-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).