public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "craig.ringer at 2ndquadrant dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/27274] New: stap: staptree.h:1349: virtual update_visitor::~update_visitor(): Assertion `values.empty()' failed.
Date: Fri, 29 Jan 2021 09:20:40 +0000	[thread overview]
Message-ID: <bug-27274-6586@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 27274
           Summary: stap: staptree.h:1349: virtual
                    update_visitor::~update_visitor(): Assertion
                    `values.empty()' failed.
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: craig.ringer at 2ndquadrant dot com
  Target Milestone: ---

I've been seeing intermittent assertion failures
`update_visitor::~update_visitor(): Assertion `values.empty()' failed` in
script compilation and finally tracked down one of the ways it arises.

In a SDT marker based probe, if not enough arguments are passed to a function,
then in some cases this assertion seems to fire. I finally reduced this to a
minimal example, attached.

Run

    gcc -Wextra -Wall -Wno-unused-parameter -o test_sdt test_sdt.c

    stap -v sdt_assert.stp

Result:

    $ /usr/local/systemtap/bin/stap -v sdt_assert.stp 
    Pass 1: parsed user script and 497 library scripts using
357068virt/114944res/13316shr/101304data kb, in 210usr/20sys/232real ms.
    stap: staptree.h:1349: virtual update_visitor::~update_visitor(): Assertion
`values.empty()' failed.
    Aborted (core dumped)

Full backtrace attached, but here's the short one:

```
#0  __GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  __GI_abort () at abort.c:79
#2  __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion="values.empty()", file="staptree.h", line=1349, function=<optimized
out>) at assert.c:92
#3  __GI___assert_fail (assertion="values.empty()", file="staptree.h",
line=1349, function="virtual update_visitor::~update_visitor()") at
assert.c:101
#4  update_visitor::~update_visitor (this=<optimized out>, __in_chrg=<optimized
out>) at staptree.h:1349
#5  update_visitor::~update_visitor (this=<optimized out>, __in_chrg=<optimized
out>) at staptree.h:1349
#6  sdt_query::handle_probe_entry (this=) at
/usr/include/c++/10/ext/new_allocator.h:89
#7  sdt_query::setup_note_probe_entry (this=, scn_name=..., note_name=...,
type=<optimized out>, data="p\215\005M\377\177", len=<optimized out>) at
tapsets.cxx:7890
#8  dwflpp::iterate_over_notes<void> (this=this@entry=, object=object@entry=, 
   
callback=callback@entry=<sdt_query::setup_note_probe_entry_callback(sdt_query*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, int, char const*, unsigned long)>) at
dwflpp.cxx:1292
#9  dwflpp::iterate_over_notes<sdt_query> (
    callback=<sdt_query::setup_note_probe_entry_callback(sdt_query*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, int, char const*, unsigned long)>, object=,
this=<optimized out>) at dwflpp.h:310
#10 sdt_query::handle_query_module (this=) at tapsets.cxx:7748
#11 query_module (mod=, name="/home/craig/projects/2Q/systemtap/test_sdt",
addr=<optimized out>, q=<optimized out>) at tapsets.cxx:2664
#12 dwfl_getmodules () from /lib64/libdw.so.1
#13 dwflpp::iterate_over_modules<base_query> (data=,
callback=<query_module(Dwfl_Module*, void**, char const*, Dwarf_Addr,
base_query*)>, this=) at dwflpp.h:228
#14 dwarf_builder::build (this=, sess=..., base=, location=,
parameters=std::map with 2 elements = {...}, finished_results=std::vector of
length 0, capacity 0) at tapsets.cxx:8805
#15 match_node::find_and_build (this=, s=..., p=, loc=, pos=<optimized out>,
results=std::vector of length 0, capacity 0, builders=std::set with 0 elements)
at elaborate.cxx:479
#16 match_node::find_and_build (this=, s=..., p=, loc=, pos=1,
results=std::vector of length 0, capacity 0, builders=std::set with 0 elements)
at elaborate.cxx:653
#17 match_node::find_and_build (this=, s=..., p=, loc=, pos=0,
results=std::vector of length 0, capacity 0, builders=std::set with 0 elements)
at elaborate.cxx:653
#18 derive_probes (s=..., p=, dps=std::vector of length 0, capacity 0,
optional=<optimized out>, rethrow_errors=false) at elaborate.cxx:1020
#19 semantic_pass_symbols (s=...) at elaborate.cxx:1950
#20 semantic_pass (s=...) at elaborate.cxx:2540
#21 passes_0_4 (s=...) at main.cxx:1019
#22 main (argc=<optimized out>, argv=<optimized out>) at main.cxx:1504
```

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

             reply	other threads:[~2021-01-29  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29  9:20 craig.ringer at 2ndquadrant dot com [this message]
2021-01-29  9:22 ` [Bug translator/27274] " craig.ringer at 2ndquadrant dot com
2021-01-29  9:22 ` craig.ringer at 2ndquadrant dot com
2021-01-29  9:23 ` craig.ringer at 2ndquadrant dot com
2021-05-03 22:14 ` 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-27274-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).