This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 5/5] libctf: fix spurious error when rolling back to the first snapshot
- From: Nick Alcock <nick dot alcock at oracle dot com>
- To: binutils at sourceware dot org
- Cc: jose dot marchesi at oracle dot com, indu dot bhagat at oracle dot com, elena dot zannoni at oracle dot com
- Date: Sun, 30 Jun 2019 19:13:59 +0100
- Subject: [PATCH 5/5] libctf: fix spurious error when rolling back to the first snapshot
- References: <20190630181359.98029-1-nick.alcock@oracle.com>
The first ctf_snapshot called after CTF file creation yields a snapshot
handle that always yields a spurious ECTF_OVERROLLBACK error ("Attempt
to roll back past a ctf_update") on ctf_rollback(), even if ctf_update
has never been called.
The fix is to start with a ctf_snapshot value higher than the zero value
that ctf_snapshot_lu ("last update CTF snapshot value") is initialized
to.
libctf/
* ctf-create.c (ctf_create): Fix off-by-one error.
---
libctf/ctf-create.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index 6ab0cf3b88..24ea114f29 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -82,7 +82,7 @@ ctf_create (int *errp)
fp->ctf_dvhash = dvhash;
fp->ctf_dtnextid = 1;
fp->ctf_dtoldid = 0;
- fp->ctf_snapshots = 0;
+ fp->ctf_snapshots = 1;
fp->ctf_snapshot_lu = 0;
return fp;
--
2.22.0.238.g049a27acdc