[Frederic Bonnard] Bug#803363: [PATCH] notmuch: workaround for FTBFS

Subject: [Frederic Bonnard] Bug#803363: [PATCH] notmuch: workaround for FTBFS

Date: Thu, 29 Oct 2015 07:31:14 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


opinions? Shall I apply this in 0.21?



Source: notmuch
Source-Version: 0.21~rc3-3
Tags: patch
User: debian-powerpc@lists.debian.org
Usertags: ppc64el 

--

Hi,
on ppc64el, there is a FTBFS on this version since 0.20.2-2 due a test
failing (070).
This is due to the fact that the test is using a breakpoint on the function
notmuch_database_add_message so that it can force a return code and check
the exit code of the binary is the one injected, but for some reason, gdb
fails to trap that function : the breakpoint does not interrupt the program.
In the early days, this was known because of the ABIv2 that makes a function
have a Local Entry Point and a Global Entry Point.
And gdb placed a breakpoint on notmuch_database_add_message, on the address
off the GEP, and in some case you only get through the LEP, and then
the breakpoint is not called.
For reference : https://sourceware.org/ml/gdb-patches/2014-01/msg01013.html
This should be fixed in gdb now, but it seems there's an issue on that.
So the workaround for the moment is to place a 2nd breakpoint on the LEP,
which is at the address of notmuch_database_add_message + 8.
On other architectures, this won't cause trouble as the first one will be
activated and return with the forced exit code will be done.
So notmuch is not broken, but there is something wrong with gdb, and
in the meantime, I need to check with gdb what's going on.
F.

---
Index: sources-notmuch/0.21~rc3-3/test/T070-insert.sh
===================================================================
--- sources-notmuch/0.21~rc3-3/test/T070-insert.sh
+++ sources-notmuch/0.21~rc3-3/test/T070-insert.sh
@@ -192,8 +192,9 @@
 gen_insert_msg
 cat <<EOF > index-file-$code.gdb
 set breakpoint pending on
 break notmuch_database_add_message
+break *notmuch_database_add_message+8
 commands
 return NOTMUCH_STATUS_$code
 continue
 end


Thread: