Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1,2 +1,2 @@
|
|||||||
SOURCES/doc-v2.0.4.tar.xz
|
SOURCES/doc-v2.1.tar.xz
|
||||||
SOURCES/v2.0.4.tar.gz
|
SOURCES/v2.1.tar.gz
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
77fe11a5169b820b549718c4094a7f46498f449a SOURCES/doc-v2.0.4.tar.xz
|
bd8a58203ca345d433598a8c0cd339e1a5011357 SOURCES/doc-v2.1.tar.xz
|
||||||
89b3dd85676090dd4a923425f7668446d729f5f3 SOURCES/v2.0.4.tar.gz
|
f8b79bb1b5bcf1d319541b22f6270b4ae38599ea SOURCES/v2.1.tar.gz
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
diff --git a/libipt/test/src/ptunit-msec_cache.c b/libipt/test/src/ptunit-msec_cache.c
|
|
||||||
index 68d9daf..cfb059b 100644
|
|
||||||
--- a/libipt/test/src/ptunit-msec_cache.c
|
|
||||||
+++ b/libipt/test/src/ptunit-msec_cache.c
|
|
||||||
@@ -296,7 +296,7 @@ static struct ptunit_result read(struct test_fixture *tfix)
|
|
||||||
static struct ptunit_result fill_nomap(struct test_fixture *tfix)
|
|
||||||
{
|
|
||||||
const struct pt_mapped_section *msec;
|
|
||||||
- struct pt_asid asid;
|
|
||||||
+ struct pt_asid asid = { 0 };
|
|
||||||
struct pt_section *section;
|
|
||||||
int status;
|
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ static struct ptunit_result fill(struct test_fixture *tfix)
|
|
||||||
{
|
|
||||||
const struct pt_mapped_section *msec;
|
|
||||||
struct pt_section *section;
|
|
||||||
- struct pt_asid asid;
|
|
||||||
+ struct pt_asid asid = { 0 };
|
|
||||||
int status;
|
|
||||||
|
|
||||||
status = pt_msec_cache_fill(&tfix->mcache, &msec, &tfix->image, &asid,
|
|
@ -0,0 +1,122 @@
|
|||||||
|
From b79e10fce4dfceddbc9adb706d7a3300df5fabe6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Markus Metzger <markus.t.metzger@intel.com>
|
||||||
|
Date: Mon, 16 Oct 2023 07:25:19 +0000
|
||||||
|
Subject: [PATCH 2/2] libipt, ptunit: avoid lto maybe-uninitialized warning
|
||||||
|
|
||||||
|
Building with GCC 13 and -flto produces
|
||||||
|
|
||||||
|
In function 'pt_qry_get_offset',
|
||||||
|
inlined from 'get_offset_null' at .../libipt/test/src/ptunit-block_decoder.c:164:12,
|
||||||
|
inlined from 'main' at .../libipt/test/src/ptunit-block_decoder.c:336:2:
|
||||||
|
.../libipt/src/pt_query_decoder.c:380:16: error: 'decoder' may be used uninitialized [-Werror=maybe-uninitialized]
|
||||||
|
380 | return pt_evt_get_offset(&decoder->evdec, offset);
|
||||||
|
| ^
|
||||||
|
.../libipt/src/pt_event_decoder.c: In function 'main':
|
||||||
|
.../libipt/src/pt_event_decoder.c:1541:5: note: by argument 1 of type 'const struct pt_event_decoder *' to 'pt_evt_get_offset' declared here
|
||||||
|
1541 | int pt_evt_get_offset(const struct pt_event_decoder *decoder, uint64_t *offset)
|
||||||
|
| ^
|
||||||
|
.../libipt/test/src/ptunit-block_decoder.c:157:33: note: 'decoder' declared here
|
||||||
|
157 | struct pt_block_decoder decoder;
|
||||||
|
| ^
|
||||||
|
|
||||||
|
Those are false positive since the decoder object isn't actually used. In
|
||||||
|
|
||||||
|
&decoder->evdec
|
||||||
|
|
||||||
|
we compute the address of the event decoder object within the block
|
||||||
|
decoder object. This adds an offset defined by the type. It does not
|
||||||
|
actually dereference the pointer to access an uninitialized decoder
|
||||||
|
object.
|
||||||
|
|
||||||
|
Initialize the test decoder to avoid those warnings. Fixes #101.
|
||||||
|
|
||||||
|
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
|
||||||
|
---
|
||||||
|
libipt/test/src/ptunit-block_decoder.c | 4 ++++
|
||||||
|
libipt/test/src/ptunit-encoder.c | 2 ++
|
||||||
|
libipt/test/src/ptunit-insn_decoder.c | 4 ++++
|
||||||
|
libipt/test/src/ptunit-packet_decoder.c | 4 ++++
|
||||||
|
4 files changed, 14 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/libipt/test/src/ptunit-block_decoder.c b/libipt/test/src/ptunit-block_decoder.c
|
||||||
|
index 44249d3..d1ff288 100644
|
||||||
|
--- a/libipt/test/src/ptunit-block_decoder.c
|
||||||
|
+++ b/libipt/test/src/ptunit-block_decoder.c
|
||||||
|
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_blk_get_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
@@ -184,6 +186,8 @@ static struct ptunit_result get_sync_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_blk_get_sync_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
diff --git a/libipt/test/src/ptunit-encoder.c b/libipt/test/src/ptunit-encoder.c
|
||||||
|
index 15d5eb4..edabe9e 100644
|
||||||
|
--- a/libipt/test/src/ptunit-encoder.c
|
||||||
|
+++ b/libipt/test/src/ptunit-encoder.c
|
||||||
|
@@ -138,6 +138,8 @@ static struct ptunit_result get_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&encoder, 0, sizeof(encoder));
|
||||||
|
+
|
||||||
|
errcode = pt_enc_get_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
diff --git a/libipt/test/src/ptunit-insn_decoder.c b/libipt/test/src/ptunit-insn_decoder.c
|
||||||
|
index c8447e7..c5a057c 100644
|
||||||
|
--- a/libipt/test/src/ptunit-insn_decoder.c
|
||||||
|
+++ b/libipt/test/src/ptunit-insn_decoder.c
|
||||||
|
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_insn_get_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
@@ -184,6 +186,8 @@ static struct ptunit_result get_sync_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_insn_get_sync_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
diff --git a/libipt/test/src/ptunit-packet_decoder.c b/libipt/test/src/ptunit-packet_decoder.c
|
||||||
|
index 39f1ede..4cb60ad 100644
|
||||||
|
--- a/libipt/test/src/ptunit-packet_decoder.c
|
||||||
|
+++ b/libipt/test/src/ptunit-packet_decoder.c
|
||||||
|
@@ -158,6 +158,8 @@ static struct ptunit_result get_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_pkt_get_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
@@ -199,6 +201,8 @@ static struct ptunit_result get_sync_offset_null(void)
|
||||||
|
uint64_t offset;
|
||||||
|
int errcode;
|
||||||
|
|
||||||
|
+ memset(&decoder, 0, sizeof(decoder));
|
||||||
|
+
|
||||||
|
errcode = pt_pkt_get_sync_offset(NULL, &offset);
|
||||||
|
ptu_int_eq(errcode, -pte_invalid);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
Loading…
Reference in new issue