* [PATCH] abg-corpus.cc: report architecture discrepancies
@ 2020-09-18 10:00 Giuliano Procida
2020-09-18 11:23 ` Matthias Maennich
2020-09-22 16:15 ` Dodji Seketeli
0 siblings, 2 replies; 3+ messages in thread
From: Giuliano Procida @ 2020-09-18 10:00 UTC (permalink / raw)
To: libabigail; +Cc: dodji, kernel-team, gprocida
If there ever is a discrepancy between the architectures of the
corpuses of a corpus group, libabigail will just abort with an
assertion, if enabled. However, this is a case of invalid input and
the cause should be reported to the user.
* src/abg-corpus.cc (corpus_group::add_corpus): Report
architecture discrepancies.
Signed-off-by: Giuliano Procida <gprocida@google.com>
---
src/abg-corpus.cc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc
index 1f72904d1..67f878dd6 100644
--- a/src/abg-corpus.cc
+++ b/src/abg-corpus.cc
@@ -1647,8 +1647,13 @@ corpus_group::add_corpus(const corpus_sptr& corp)
corp_arch = corp->get_architecture_name();
if (cur_arch.empty())
set_architecture_name(corp_arch);
- else
- ABG_ASSERT(cur_arch == corp_arch);
+ else if (cur_arch != corp_arch)
+ {
+ std::cerr << "corpus '" << corp->get_path() << "'"
+ << " has architecture '" << corp_arch << "'"
+ << " but expected '" << cur_arch << "'\n";
+ ABG_ASSERT_NOT_REACHED;
+ }
priv_->corpora.push_back(corp);
corp->set_group(this);
--
2.28.0.681.g6f77f65b4e-goog
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] abg-corpus.cc: report architecture discrepancies
2020-09-18 10:00 [PATCH] abg-corpus.cc: report architecture discrepancies Giuliano Procida
@ 2020-09-18 11:23 ` Matthias Maennich
2020-09-22 16:15 ` Dodji Seketeli
1 sibling, 0 replies; 3+ messages in thread
From: Matthias Maennich @ 2020-09-18 11:23 UTC (permalink / raw)
To: Giuliano Procida; +Cc: libabigail, dodji, kernel-team
On Fri, Sep 18, 2020 at 11:00:54AM +0100, Android Kernel Team wrote:
>If there ever is a discrepancy between the architectures of the
>corpuses of a corpus group, libabigail will just abort with an
>assertion, if enabled. However, this is a case of invalid input and
>the cause should be reported to the user.
>
> * src/abg-corpus.cc (corpus_group::add_corpus): Report
> architecture discrepancies.
>
>Signed-off-by: Giuliano Procida <gprocida@google.com>
Run into that occasionally as well. So, thanks for addressing this!
Reviewed-by: Matthias Maennich <maennich@google.com>
Cheers,
Matthias
>---
> src/abg-corpus.cc | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
>diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc
>index 1f72904d1..67f878dd6 100644
>--- a/src/abg-corpus.cc
>+++ b/src/abg-corpus.cc
>@@ -1647,8 +1647,13 @@ corpus_group::add_corpus(const corpus_sptr& corp)
> corp_arch = corp->get_architecture_name();
> if (cur_arch.empty())
> set_architecture_name(corp_arch);
>- else
>- ABG_ASSERT(cur_arch == corp_arch);
>+ else if (cur_arch != corp_arch)
>+ {
>+ std::cerr << "corpus '" << corp->get_path() << "'"
>+ << " has architecture '" << corp_arch << "'"
>+ << " but expected '" << cur_arch << "'\n";
>+ ABG_ASSERT_NOT_REACHED;
>+ }
>
> priv_->corpora.push_back(corp);
> corp->set_group(this);
>--
>2.28.0.681.g6f77f65b4e-goog
>
>--
>To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] abg-corpus.cc: report architecture discrepancies
2020-09-18 10:00 [PATCH] abg-corpus.cc: report architecture discrepancies Giuliano Procida
2020-09-18 11:23 ` Matthias Maennich
@ 2020-09-22 16:15 ` Dodji Seketeli
1 sibling, 0 replies; 3+ messages in thread
From: Dodji Seketeli @ 2020-09-22 16:15 UTC (permalink / raw)
To: Giuliano Procida; +Cc: libabigail, kernel-team
Hello,
Giuliano Procida <gprocida@google.com> a écrit:
> If there ever is a discrepancy between the architectures of the
> corpuses of a corpus group, libabigail will just abort with an
> assertion, if enabled. However, this is a case of invalid input and
> the cause should be reported to the user.
>
> * src/abg-corpus.cc (corpus_group::add_corpus): Report
> architecture discrepancies.
>
> Signed-off-by: Giuliano Procida <gprocida@google.com>
Applied to master, thanks!
[...]
Cheers,
--
Dodji
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-22 16:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 10:00 [PATCH] abg-corpus.cc: report architecture discrepancies Giuliano Procida
2020-09-18 11:23 ` Matthias Maennich
2020-09-22 16:15 ` Dodji Seketeli
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).