public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/procdump] f44: Fix corrupted patch files 0005-0009
@ 2026-08-05 19:04 Julio Faracco
  0 siblings, 0 replies; only message in thread
From: Julio Faracco @ 2026-08-05 19:04 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/procdump
            Branch : f44
            Commit : 019d1da6d296b755a792560408abd17e8083dd51
            Author : Julio Faracco <jfaracco@redhat.com>
            Date   : 2026-08-05T16:04:27-03:00
            Stats  : +210/-20 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/procdump/c/019d1da6d296b755a792560408abd17e8083dd51?branch=f44

            Log:
            Fix corrupted patch files 0005-0009

Patch files 0005 through 0009 were incorrectly generated and contained
garbage content. Replace with correct patches from rawhide branch.

Signed-off-by: Julio Faracco <jfaracco@redhat.com>

---
diff --git a/0005-corex-Remove-unused-variable-num_mappings-from-elf_w.patch b/0005-corex-Remove-unused-variable-num_mappings-from-elf_w.patch
index ce787be..6ffa3eb 100644
--- a/0005-corex-Remove-unused-variable-num_mappings-from-elf_w.patch
+++ b/0005-corex-Remove-unused-variable-num_mappings-from-elf_w.patch
@@ -1,5 +1,31 @@
-commit afeb742b3ce6ad13bb7d65cc7305d1585612b0ba
-Author: Fedora Release Engineering <releng@fedoraproject.org>
-Date:   Sat Jan 17 05:46:10 2026 +0000
+From 8a70dc09839acea259ac2746b2413b5ce62b694a Mon Sep 17 00:00:00 2001
+From: Julio Faracco <jcfaracco@gmail.com>
+Date: Wed, 5 Aug 2026 12:58:49 -0300
+Subject: [PATCH 5/6] corex: Remove unused variable num_mappings from
+ elf_write_core
+
+The local variable num_mappings is assigned but never referenced.
+All usages access proc->num_mappings directly. Remove it to fix
+-Werror=unused-variable build failure.
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+---
+ src/corex/elf_writer.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/corex/elf_writer.c b/src/corex/elf_writer.c
+index 9cf14bd..4e816f1 100644
+--- a/src/corex/elf_writer.c
++++ b/src/corex/elf_writer.c
+@@ -122,8 +122,6 @@ int elf_write_core(const char *path,
+         return COREX_ERR_INVALID_ARG;
+     }
+ 
+-    size_t num_mappings = (size_t)proc->num_mappings;
+-    
+     /* Count only mappings that will be dumped */
+     int num_loads = 0;
+     for (int i = 0; i < proc->num_mappings; i++) {
+-- 
+2.55.0
 
-    Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

diff --git a/0006-corex-Replace-strncpy-with-memcpy-in-note_builder-to.patch b/0006-corex-Replace-strncpy-with-memcpy-in-note_builder-to.patch
index ce787be..79c10bb 100644
--- a/0006-corex-Replace-strncpy-with-memcpy-in-note_builder-to.patch
+++ b/0006-corex-Replace-strncpy-with-memcpy-in-note_builder-to.patch
@@ -1,5 +1,32 @@
-commit afeb742b3ce6ad13bb7d65cc7305d1585612b0ba
-Author: Fedora Release Engineering <releng@fedoraproject.org>
-Date:   Sat Jan 17 05:46:10 2026 +0000
+From bf148adeca1982b700d1b627f6e9e86359c7e7ff Mon Sep 17 00:00:00 2001
+From: Julio Faracco <jcfaracco@gmail.com>
+Date: Wed, 5 Aug 2026 12:58:49 -0300
+Subject: [PATCH 6/6] corex: Replace strncpy with memcpy in note_builder to fix
+ truncation warning
+
+GCC warns about strncpy potentially truncating when source and
+destination have matching sizes. Use memcpy with explicit null
+termination instead.
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+---
+ src/corex/note_builder.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/corex/note_builder.c b/src/corex/note_builder.c
+index 0dfff07..f4ed468 100644
+--- a/src/corex/note_builder.c
++++ b/src/corex/note_builder.c
+@@ -146,7 +146,8 @@ static int build_prpsinfo_note(corex_note_buf_t *buf,
+     psinfo.pr_uid = proc->uid;
+     psinfo.pr_gid = proc->gid;
+ 
+-    strncpy(psinfo.pr_fname, proc->comm, sizeof(psinfo.pr_fname) - 1);
++    memcpy(psinfo.pr_fname, proc->comm, sizeof(psinfo.pr_fname) - 1);
++    psinfo.pr_fname[sizeof(psinfo.pr_fname) - 1] = '\0';
+ 
+     /* Build a space-separated args string from the NUL-separated cmdline */
+     if (proc->cmdline_len > 0) {
+-- 
+2.55.0
 
-    Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

diff --git a/0007-EventPipeHelper-Remove-unused-variable-and-function.patch b/0007-EventPipeHelper-Remove-unused-variable-and-function.patch
index ce787be..6f7de10 100644
--- a/0007-EventPipeHelper-Remove-unused-variable-and-function.patch
+++ b/0007-EventPipeHelper-Remove-unused-variable-and-function.patch
@@ -1,5 +1,77 @@
-commit afeb742b3ce6ad13bb7d65cc7305d1585612b0ba
-Author: Fedora Release Engineering <releng@fedoraproject.org>
-Date:   Sat Jan 17 05:46:10 2026 +0000
+From a80d2858c4b1b50ca7f8fe15d7d4267e0bcd859f Mon Sep 17 00:00:00 2001
+From: Julio Faracco <jcfaracco@gmail.com>
+Date: Wed, 5 Aug 2026 13:45:41 -0300
+Subject: [PATCH] EventPipeHelper: Remove unused variable and function
+
+Remove FAST_SERIALIZATION_TAG constant and read_nettrace_string
+function which are declared but never referenced. Fixes
+-Werror,-Wunused-const-variable and -Werror,-Wunused-function
+build failures with clang.
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+---
+ src/EventPipeHelper.cpp | 41 +----------------------------------------
+ 1 file changed, 1 insertion(+), 40 deletions(-)
+
+diff --git a/src/EventPipeHelper.cpp b/src/EventPipeHelper.cpp
+index 5a3bffd..21ae320 100644
+--- a/src/EventPipeHelper.cpp
++++ b/src/EventPipeHelper.cpp
+@@ -25,7 +25,7 @@
+ // Nettrace format constants
+ //--------------------------------------------------------------------
+ static const char NETTRACE_MAGIC[] = "Nettrace";
+-static const char FAST_SERIALIZATION_TAG[] = "!FastSerialization.1";
++
+ 
+ // Block types (as null-terminated strings in the stream)
+ #define TRACE_OBJECT_TAG        "Trace"
+@@ -124,45 +124,6 @@ static int skip_bytes_tracked(int fd, size_t len, size_t* streamPos)
+     return 0;
+ }
+ 
+-//--------------------------------------------------------------------
+-// Helper: Read a length-prefixed nettrace string (serialized as
+-// int32 length in chars, followed by UTF-16LE chars).
+-// Converts to UTF-8 (ASCII subset) in outBuf.
+-//--------------------------------------------------------------------
+-static int read_nettrace_string(const uint8_t* data, size_t dataLen, size_t* offset, char* outBuf, size_t outBufSize)
+-{
+-    if (*offset + 4 > dataLen) return -1;
+-    int32_t charCount;
+-    memcpy(&charCount, data + *offset, 4);
+-    *offset += 4;
+-
+-    if (charCount <= 0)
+-    {
+-        if (outBufSize > 0) outBuf[0] = '\0';
+-        return 0;
+-    }
+-
+-    // Guard against overflow on 32-bit: cap charCount to half the max buffer
+-    if ((uint32_t)charCount > dataLen / 2)
+-        return -1;
+-
+-    size_t byteCount = (size_t)charCount * 2;
+-    if (*offset + byteCount > dataLen) return -1;
+-
+-    // Convert UTF-16LE to ASCII (sufficient for counter/provider names)
+-    size_t j = 0;
+-    for (int32_t i = 0; i < charCount && outBufSize > 1 && j < outBufSize - 1; i++)
+-    {
+-        uint16_t wc;
+-        memcpy(&wc, data + *offset + i * 2, 2);
+-        if (wc == 0) break; // null terminator
+-        outBuf[j++] = (wc < 128) ? (char)wc : '?';
+-    }
+-    if (outBufSize > 0) outBuf[j] = '\0';
+-    *offset += byteCount;
+-    return 0;
+-}
+-
+ //--------------------------------------------------------------------
+ // Helper: Read a null-terminated UTF-16LE string (used in event payloads).
+ //--------------------------------------------------------------------
+-- 
+2.55.0
 
-    Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

diff --git a/0008-Monitor-Remove-unused-variable-found-in-histogram-pa.patch b/0008-Monitor-Remove-unused-variable-found-in-histogram-pa.patch
index ce787be..fd339d0 100644
--- a/0008-Monitor-Remove-unused-variable-found-in-histogram-pa.patch
+++ b/0008-Monitor-Remove-unused-variable-found-in-histogram-pa.patch
@@ -1,5 +1,36 @@
-commit afeb742b3ce6ad13bb7d65cc7305d1585612b0ba
-Author: Fedora Release Engineering <releng@fedoraproject.org>
-Date:   Sat Jan 17 05:46:10 2026 +0000
+From db819d79539cc7cfa3319be833c581c2993d6745 Mon Sep 17 00:00:00 2001
+From: Julio Faracco <jcfaracco@gmail.com>
+Date: Wed, 5 Aug 2026 13:56:42 -0300
+Subject: [PATCH] Monitor: Remove unused variable found in histogram parsing
+
+The variable found is set but never read. Remove it to fix
+-Werror,-Wunused-but-set-variable build failure with clang.
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+---
+ src/Monitor.cpp | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/Monitor.cpp b/src/Monitor.cpp
+index fb6542f..cb09f69 100644
+--- a/src/Monitor.cpp
++++ b/src/Monitor.cpp
+@@ -2279,7 +2279,6 @@ static bool PerfCounterCallback(struct EventPipeCounterValue* counterValue, void
+             {
+                 double targetPct = trigger->percentile >= 0.0 ? trigger->percentile : 0.5; // default p50
+                 double bestVal = counterValue->value; // fallback to default (p50)
+-                bool found = false;
+ 
+                 char parseBuf[512];
+                 strncpy(parseBuf, counterValue->quantiles, sizeof(parseBuf) - 1);
+@@ -2303,7 +2302,6 @@ static bool PerfCounterCallback(struct EventPipeCounterValue* counterValue, void
+                             if (fabs(qKey - targetPct) < 0.001)
+                             {
+                                 bestVal = qVal;
+-                                found = true;
+                                 break;
+                             }
+                         }
+-- 
+2.55.0
 
-    Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

diff --git a/0009-Logging-Fix-buffer-size-in-LogFormatter-snprintf-vsnprintf.patch b/0009-Logging-Fix-buffer-size-in-LogFormatter-snprintf-vsnprintf.patch
index ce787be..047bec0 100644
--- a/0009-Logging-Fix-buffer-size-in-LogFormatter-snprintf-vsnprintf.patch
+++ b/0009-Logging-Fix-buffer-size-in-LogFormatter-snprintf-vsnprintf.patch
@@ -1,5 +1,39 @@
-commit afeb742b3ce6ad13bb7d65cc7305d1585612b0ba
-Author: Fedora Release Engineering <releng@fedoraproject.org>
-Date:   Sat Jan 17 05:46:10 2026 +0000
+From 64839a8650df42be107d5c7774bcab613db5d017 Mon Sep 17 00:00:00 2001
+From: Julio Faracco <jfaracco@redhat.com>
+Date: Wed, 5 Aug 2026 15:10:40 -0300
+Subject: [PATCH] Logging: Fix buffer size arguments in LogFormatter
+ snprintf/vsnprintf calls
+
+The second vsnprintf call passes traceLen+argsLen as buffer size, but
+writing at offset traceLen into a buffer of traceLen+argsLen+1 bytes
+leaves only argsLen+1 bytes remaining. With _FORTIFY_SOURCE=3, the
+runtime detects the size argument exceeds the actual remaining buffer
+and aborts with 'buffer overflow detected'.
+
+Fix both snprintf calls to pass correct remaining buffer sizes:
+- snprintf: traceLen+1 (prefix length + null terminator)
+- vsnprintf: argsLen+1 (message length + null terminator)
+
+Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
+---
+ src/Logging.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Logging.cpp b/src/Logging.cpp
+index b4ea374..29dd86f 100644
+--- a/src/Logging.cpp
++++ b/src/Logging.cpp
+@@ -37,8 +37,8 @@ void LogFormatter(enum LogLevel logLevel, enum DiagnosticsLogTarget target, cons
+         return;
+     }
+ 
+-    snprintf(trace, traceLen+argsLen, "[%s - %s]: ", timeBuff, LogLevelStrings[logLevel]);
+-    vsnprintf(trace+traceLen, traceLen+argsLen, message, args);
++    snprintf(trace, traceLen+1, "[%s - %s]: ", timeBuff, LogLevelStrings[logLevel]);
++    vsnprintf(trace+traceLen, argsLen+1, message, args);
+ 
+     // If a log entry is not 'debug' it simply goes to stdout.
+     // If you want an entry to only go to the syslog, use 'debug'
+-- 
+2.55.0
 
-    Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-05 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-05 19:04 [rpms/procdump] f44: Fix corrupted patch files 0005-0009 Julio Faracco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox