public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: sergiodj+buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] fix "stale cleanup" internal-warning when using "catch assert" command
Date: Tue, 22 May 2018 15:04:00 -0000	[thread overview]
Message-ID: <241db429d5735ae8875e38991c82204b310c2ff5@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 241db429d5735ae8875e38991c82204b310c2ff5 ***

Author: Joel Brobecker <brobecker@adacore.com>
Branch: master
Commit: 241db429d5735ae8875e38991c82204b310c2ff5

fix "stale cleanup" internal-warning when using "catch assert" command

Trying to insert a catchpoint on all Ada assertions now triggers
the following internal warning regardless of the situation. For
instance, not even debugging any program:

    (gdb) catch assert
    /[...]/gdb/common/cleanups.c:264: internal-warning:
    restore_my_cleanups has found a stale cleanup

This is due to a small bug in the following C++-ification commit:

    commit bc18fbb575437dd10089ef4619e46c0b9a93097d
    Author: Tom Tromey <tom@tromey.com>
    Date:   Fri May 18 15:58:50 2018 -0600
    Subject: Change ada_catchpoint::excep_string to be a std::string

The stale cleanup in question is the following one in top.c:execute_command:

    cleanup_if_error = make_bpstat_clear_actions_cleanup ();

This cleanup is expected to be discarded if there are no exception.
There were no GDB exception; however, a C++ exception was triggered,
because we passed NULL as the excep_string argument when calling
create_ada_exception_catchpoint, which is a reference to a const
string. So we get a C++ exception during the std::string constructor,
which propagates up, causing the cleanup to unexpectedly remain
in the cleanup chain.

This patch fixes the immediate issue of the incorrect call to
create_ada_exception_catchpoint.

gdb/ChangeLog:

        * ada-lang.c (catch_assert_command): Pass empty string instead
        of NULL for excep_string argument.

Tested on x86_64-linux, fixes the following failures:

  * catch_assert_if.exp: insert catchpoint on failed assertions with condition
  * catch_ex.exp: insert catchpoint on failed assertions

This also fixes about a dozen UNRESOLVED tests that are a consequence
of the two tests above failing and crashing GDB.


             reply	other threads:[~2018-05-22 14:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 15:04 sergiodj+buildbot [this message]
2018-05-22 15:42 ` Failures on RHEL-s390x-m64, branch master sergiodj+buildbot
2018-05-22 15:42 ` Failures on Fedora-s390x-m64, " sergiodj+buildbot
2018-06-01  2:56 ` Failures on Fedora-x86_64-m64, " sergiodj+buildbot
2018-06-01  3:07 ` *** COMPILATION FAILED *** Failures on Fedora-x86_64-w64-mingw32, branch master *** BREAKAGE *** sergiodj+buildbot
2018-06-01  3:28 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master sergiodj+buildbot
2018-08-05 22:50 ` Failures on Ubuntu-AArch32-native-extended-gdbserver-m32, " sergiodj+buildbot

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=241db429d5735ae8875e38991c82204b310c2ff5@gdb-build \
    --to=sergiodj+buildbot@sergiodj.net \
    --cc=gdb-testers@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).