parent
41edb241c0
commit
3abd181245
@ -1 +1 @@
|
||||
SOURCES/systemtap-4.9.tar.gz
|
||||
SOURCES/systemtap-5.1.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
7ba2ad579a5ba66ccfd36ad6df0896c9e136f9e9 SOURCES/systemtap-4.9.tar.gz
|
||||
5a2a16c61e815ead31e655665e6ee9cf7772f1de SOURCES/systemtap-5.1.tar.gz
|
||||
|
@ -0,0 +1,29 @@
|
||||
commit b87891f5aff91b8ebbda8d9218009495848f7747
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Date: Thu May 16 16:51:08 2024 +0200
|
||||
|
||||
PR31495: teach stap-prep to work with other RT kernels
|
||||
|
||||
diff --git a/stap-prep b/stap-prep
|
||||
index 8b429f880..2bbb6bc2f 100755
|
||||
--- a/stap-prep
|
||||
+++ b/stap-prep
|
||||
@@ -103,13 +103,16 @@ done
|
||||
# 5.14.0-200.rt14.201.el9 ->
|
||||
# "kernel-rt-debug-5.14.0-200.rt14.201.el9"
|
||||
# OR?! "kernel-rt-5.14.0-200.rt14.201.el9"
|
||||
-if expr "$UNAME" : ".*\.rt.*" >/dev/null;
|
||||
+# OR??!"kernel-rt-5.14.0-447.el9.x86_64+rt"
|
||||
+if expr "$UNAME" : ".*\.rt.*" || expr "$UNAME" : ".*\+rt.*" >/dev/null;
|
||||
then
|
||||
KERNEL=`echo $KERNEL | sed -e s,kernel,kernel-rt,`
|
||||
fi
|
||||
|
||||
KERN_ARCH=`uname -m`
|
||||
-KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
|
||||
+# strip arch from uname, for kernels like 5.14.0-447.el9.x86_64+rt or
|
||||
+# 6.9.0-0.rc2.1.el10.x86_64+rt strip the +rt suffix too
|
||||
+KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH// | sed s/\+rt$//`
|
||||
if [ -x /usr/bin/dnf4 ]; then
|
||||
DI="dnf4 debuginfo-install"
|
||||
DI_DEPS=""
|
@ -0,0 +1,116 @@
|
||||
commit b8d4274d1e7697801c12c512b6724dd3f59f2c72
|
||||
Author: William Cohen <wcohen@redhat.com>
|
||||
Date: Mon May 6 11:36:42 2024 -0400
|
||||
|
||||
Support kernels that backported kallsym functions from newer linux kernels
|
||||
|
||||
Some Linux distributions may have backported
|
||||
module_kallsyms_on_each_symbol and kallsyms_on_each_symbol functions
|
||||
from newer linux kernels. In these situations checking the kernel
|
||||
version would not detect the proper arguments for these functions.
|
||||
Systemtap now has a couple of autoconf tests to determine what
|
||||
arguments should be used for these functions.
|
||||
|
||||
diff --git a/buildrun.cxx b/buildrun.cxx
|
||||
index bb7bdcc9d..8ee8c391f 100644
|
||||
--- a/buildrun.cxx
|
||||
+++ b/buildrun.cxx
|
||||
@@ -506,6 +506,8 @@ compile_pass (systemtap_session& s)
|
||||
|
||||
output_autoconf(s, o, cs, "autoconf-pagefault_disable.c", "STAPCONF_PAGEFAULT_DISABLE", NULL);
|
||||
output_exportconf(s, o2, "kallsyms_lookup_name", "STAPCONF_KALLSYMS_LOOKUP_NAME_EXPORTED");
|
||||
+ output_autoconf(s, o, cs, "autoconf-kallsyms_6_3.c", "STAPCONF_KALLSYMS_6_3", NULL);
|
||||
+ output_autoconf(s, o, cs, "autoconf-kallsyms_6_4.c", "STAPCONF_KALLSYMS_6_4", NULL);
|
||||
output_autoconf(s, o, cs, "autoconf-uidgid.c", "STAPCONF_LINUX_UIDGID_H", NULL);
|
||||
output_exportconf(s, o2, "sigset_from_compat", "STAPCONF_SIGSET_FROM_COMPAT_EXPORTED");
|
||||
output_exportconf(s, o2, "vzalloc", "STAPCONF_VZALLOC");
|
||||
diff --git a/runtime/linux/autoconf-kallsyms_6_3.c b/runtime/linux/autoconf-kallsyms_6_3.c
|
||||
new file mode 100644
|
||||
index 000000000..0af1a5c35
|
||||
--- /dev/null
|
||||
+++ b/runtime/linux/autoconf-kallsyms_6_3.c
|
||||
@@ -0,0 +1,6 @@
|
||||
+#include <linux/module.h>
|
||||
+
|
||||
+int module_kallsyms_on_each_symbol(const char *modname,
|
||||
+ int (*fn)(void *, const char *, struct module*,
|
||||
+ unsigned long),
|
||||
+ void *data);
|
||||
diff --git a/runtime/linux/autoconf-kallsyms_6_4.c b/runtime/linux/autoconf-kallsyms_6_4.c
|
||||
new file mode 100644
|
||||
index 000000000..3b3680c53
|
||||
--- /dev/null
|
||||
+++ b/runtime/linux/autoconf-kallsyms_6_4.c
|
||||
@@ -0,0 +1,3 @@
|
||||
+#include <linux/kallsyms.h>
|
||||
+int kallsyms_on_each_symbol(int (*fn)(void *, const char *, unsigned long),
|
||||
+ void *data);
|
||||
diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c
|
||||
index 6b30f2c52..2fba61cbb 100644
|
||||
--- a/runtime/linux/kprobes.c
|
||||
+++ b/runtime/linux/kprobes.c
|
||||
@@ -737,7 +737,7 @@ __stapkp_symbol_callback(void *data, const char *name,
|
||||
}
|
||||
|
||||
static int
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_4)
|
||||
stapkp_symbol_callback(void *data, const char *name,
|
||||
unsigned long addr)
|
||||
{
|
||||
@@ -780,7 +780,7 @@ stapkp_init(struct stap_kprobe_probe *probes,
|
||||
mutex_lock(&module_mutex);
|
||||
#endif
|
||||
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
|
||||
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
|
||||
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
||||
@@ -855,7 +855,7 @@ stapkp_refresh(const char *modname,
|
||||
mutex_lock(&module_mutex);
|
||||
#endif
|
||||
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_3)
|
||||
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
|
||||
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
||||
diff --git a/runtime/sym.c b/runtime/sym.c
|
||||
index 3947d42f7..23dd3be30 100644
|
||||
--- a/runtime/sym.c
|
||||
+++ b/runtime/sym.c
|
||||
@@ -1187,7 +1187,7 @@ unsigned long kallsyms_lookup_name (const char *name)
|
||||
typedef typeof(&kallsyms_on_each_symbol) kallsyms_on_each_symbol_fn;
|
||||
|
||||
// XXX Will be linked in place of the kernel's kallsyms_on_each_symbol:
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_4)
|
||||
int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
|
||||
unsigned long),
|
||||
void *data)
|
||||
@@ -1214,13 +1214,13 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
|
||||
typedef typeof(&module_kallsyms_on_each_symbol) module_kallsyms_on_each_symbol_fn;
|
||||
|
||||
// XXX Will be linked in place of the kernel's module_kallsyms_on_each_symbol:
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_4)
|
||||
int module_kallsyms_on_each_symbol(const char *modname,
|
||||
int (*fn)(void *, const char *,
|
||||
unsigned long),
|
||||
void *data)
|
||||
#else
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_3)
|
||||
int module_kallsyms_on_each_symbol(const char *modname,
|
||||
int (*fn)(void *, const char *, struct module *,
|
||||
unsigned long),
|
||||
@@ -1235,7 +1235,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module
|
||||
/* First, try to use a kallsyms_lookup_name address passed to us
|
||||
through the relocation mechanism. */
|
||||
if (_stp_module_kallsyms_on_each_symbol != NULL)
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
|
||||
return ibt_wrapper(int,
|
||||
(* (module_kallsyms_on_each_symbol_fn)_stp_module_kallsyms_on_each_symbol)(modname, fn, data));
|
||||
#else
|
@ -0,0 +1,22 @@
|
||||
commit ed5649f64a3f8c2e8269f9c4435e9174c4e8c775
|
||||
Author: William Cohen <wcohen@redhat.com>
|
||||
Date: Thu May 9 12:23:54 2024 -0400
|
||||
|
||||
Support kernels that backported kallsym functions (part 2)
|
||||
|
||||
Git commit b8d4274d1e769780 omitted a test for the Linux 6.4 version
|
||||
of kallsyms function in runtime/linux/kprobes.c.
|
||||
|
||||
diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c
|
||||
index 2fba61cbb..9ae5565e3 100644
|
||||
--- a/runtime/linux/kprobes.c
|
||||
+++ b/runtime/linux/kprobes.c
|
||||
@@ -855,7 +855,7 @@ stapkp_refresh(const char *modname,
|
||||
mutex_lock(&module_mutex);
|
||||
#endif
|
||||
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
||||
-#if defined(STAPCONF_KALLSYMS_6_3)
|
||||
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
|
||||
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
|
||||
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
|
@ -0,0 +1,79 @@
|
||||
diff --git a/buildrun.cxx b/buildrun.cxx
|
||||
index a7fcd6297..e3f2f83d1 100644
|
||||
--- a/buildrun.cxx
|
||||
+++ b/buildrun.cxx
|
||||
@@ -400,6 +400,7 @@ compile_pass (systemtap_session& s)
|
||||
output_exportconf(s, o2, "__module_text_address", "STAPCONF_MODULE_TEXT_ADDRESS");
|
||||
output_exportconf(s, o2, "add_timer_on", "STAPCONF_ADD_TIMER_ON");
|
||||
output_autoconf(s, o, cs, "autoconf-514-panic.c", "STAPCONF_514_PANIC", NULL);
|
||||
+ output_autoconf(s, o, cs, "autoconf-task_work_cancel_func.c", "STAPCONF_TASK_WORK_CANCEL_FUNC", NULL);
|
||||
|
||||
output_dual_exportconf(s, o2, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL");
|
||||
output_autoconf(s, o, cs, "autoconf-hw_breakpoint_context.c",
|
||||
diff --git a/runtime/linux/autoconf-task_work_cancel_func.c b/runtime/linux/autoconf-task_work_cancel_func.c
|
||||
new file mode 100644
|
||||
index 000000000..0d460de6c
|
||||
--- /dev/null
|
||||
+++ b/runtime/linux/autoconf-task_work_cancel_func.c
|
||||
@@ -0,0 +1,3 @@
|
||||
+#include <linux/task_work.h>
|
||||
+
|
||||
+void* c = & task_work_cancel_func;
|
||||
diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h
|
||||
index 0e9fe3fea..bd9307385 100644
|
||||
--- a/runtime/linux/runtime.h
|
||||
+++ b/runtime/linux/runtime.h
|
||||
@@ -265,7 +265,7 @@ static void *kallsyms_uprobe_get_swbp_addr;
|
||||
static void *kallsyms_task_work_add;
|
||||
#endif
|
||||
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
|
||||
-static void *kallsyms_task_work_cancel;
|
||||
+static void *kallsyms_task_work_cancel_fn;
|
||||
#endif
|
||||
|
||||
#if !defined(STAPCONF_TRY_TO_WAKE_UP_EXPORTED) && !defined(STAPCONF_WAKE_UP_STATE_EXPORTED)
|
||||
diff --git a/runtime/stp_task_work.c b/runtime/stp_task_work.c
|
||||
index 0dd3095b6..4818fecbf 100644
|
||||
--- a/runtime/stp_task_work.c
|
||||
+++ b/runtime/stp_task_work.c
|
||||
@@ -3,14 +3,25 @@
|
||||
|
||||
#include "linux/task_work_compatibility.h"
|
||||
|
||||
+// Handle kernel commit 68cbd415dd4b9c5b9df69f0f091879e56bf5907a
|
||||
+// task_work: s/task_work_cancel()/task_work_cancel_func()/
|
||||
+#if defined(STAPCONF_TASK_WORK_CANCEL_FUNC)
|
||||
+#define TASK_WORK_CANCEL_FN task_work_cancel_func
|
||||
+#else
|
||||
+#define TASK_WORK_CANCEL_FN task_work_cancel
|
||||
+#endif
|
||||
+
|
||||
+#define STRINGIFY(x) #x
|
||||
+#define TOSTRING(x) STRINGIFY(x)
|
||||
+
|
||||
#if !defined(STAPCONF_TASK_WORK_ADD_EXPORTED)
|
||||
// First typedef from the original decls, then #define as typecasted calls.
|
||||
typedef typeof(&task_work_add) task_work_add_fn;
|
||||
#define task_work_add(a,b,c) ibt_wrapper(int, (* (task_work_add_fn)kallsyms_task_work_add)((a), (b), (c)))
|
||||
#endif
|
||||
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
|
||||
-typedef typeof(&task_work_cancel) task_work_cancel_fn;
|
||||
-#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b)))
|
||||
+typedef typeof(&TASK_WORK_CANCEL_FN) task_work_cancel_fn;
|
||||
+#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel_fn)((a), (b)))
|
||||
#endif
|
||||
|
||||
/* To avoid a crash when a task_work callback gets called after the
|
||||
@@ -35,9 +46,9 @@ stp_task_work_init(void)
|
||||
}
|
||||
#endif
|
||||
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
|
||||
- kallsyms_task_work_cancel = (void *)kallsyms_lookup_name("task_work_cancel");
|
||||
- if (kallsyms_task_work_cancel == NULL) {
|
||||
- _stp_error("Can't resolve task_work_cancel!");
|
||||
+ kallsyms_task_work_cancel_fn = (void *)kallsyms_lookup_name(TOSTRING(TASK_WORK_CANCEL_FN));
|
||||
+ if (kallsyms_task_work_cancel_fn == NULL) {
|
||||
+ _stp_error("Can't resolve %s!", TOSTRING(TASK_WORK_CANCEL_FN));
|
||||
return -ENOENT;
|
||||
}
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,99 +0,0 @@
|
||||
commit 9839db5514a29cf4f58b3de8cc6155088be6d061
|
||||
gpg: Signature made Sat 12 Aug 2023 02:49:26 PM EDT
|
||||
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
|
||||
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
|
||||
Author: Frank Ch. Eigler <fche@redhat.com>
|
||||
Date: Sat Aug 12 14:28:44 2023 -0400
|
||||
|
||||
PR30749: correct stap --sign-module timing
|
||||
|
||||
Previous code signed the temp directory copy, after it had already
|
||||
been copied into the cache -- so the signature never made it to a
|
||||
permanent artifact.
|
||||
|
||||
If the module was being fetched from the cache from a previous build
|
||||
run, a sign (re)attempt will still be done. This may not be
|
||||
necessary, but shouldn't be harmful.
|
||||
|
||||
Reported-By: Renaud Métrich <rmetrich@redhat.com>
|
||||
|
||||
diff --git a/main.cxx b/main.cxx
|
||||
index 06adb66ad..9f695cbd8 100644
|
||||
--- a/main.cxx
|
||||
+++ b/main.cxx
|
||||
@@ -1190,8 +1190,10 @@ passes_0_4 (systemtap_session &s)
|
||||
s.mok_fingerprints.clear();
|
||||
s.mok_fingerprints.push_back(mok_fingerprint);
|
||||
}
|
||||
- rc =
|
||||
- sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
|
||||
+ if (s.verbose)
|
||||
+ clog << _F("Signing %s with mok key %s", s.module_filename().c_str(), mok_path.c_str())
|
||||
+ << endl;
|
||||
+ rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1310,8 +1312,30 @@ passes_0_4 (systemtap_session &s)
|
||||
if (! s.use_script_cache && s.last_pass <= 4)
|
||||
s.save_module = true;
|
||||
|
||||
+#if HAVE_NSS
|
||||
+ // PR30749
|
||||
+ if (!rc && s.module_sign_given)
|
||||
+ {
|
||||
+ // when run on client as --sign-module, mok fingerprints are result of mokutil -l
|
||||
+ // when run from server as --sign-module=PATH, mok fingerprint is given by PATH
|
||||
+ string mok_path;
|
||||
+ if (!s.module_sign_mok_path.empty())
|
||||
+ {
|
||||
+ string mok_fingerprint;
|
||||
+ split_path (s.module_sign_mok_path, mok_path, mok_fingerprint);
|
||||
+ s.mok_fingerprints.clear();
|
||||
+ s.mok_fingerprints.push_back(mok_fingerprint);
|
||||
+ }
|
||||
+
|
||||
+ if (s.verbose)
|
||||
+ clog << _F("Signing %s with mok key %s", s.module_filename().c_str(), mok_path.c_str())
|
||||
+ << endl;
|
||||
+ rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// Copy module to the current directory.
|
||||
- if (s.save_module && !pending_interrupts)
|
||||
+ if (!rc && s.save_module && !pending_interrupts)
|
||||
{
|
||||
string module_src_path = s.tmpdir + "/" + s.module_filename();
|
||||
string module_dest_path = s.module_filename();
|
||||
@@ -1327,29 +1351,11 @@ passes_0_4 (systemtap_session &s)
|
||||
}
|
||||
}
|
||||
|
||||
-#if HAVE_NSS
|
||||
- if (s.module_sign_given)
|
||||
- {
|
||||
- // when run on client as --sign-module, mok fingerprints are result of mokutil -l
|
||||
- // when run from server as --sign-module=PATH, mok fingerprint is given by PATH
|
||||
- string mok_path;
|
||||
- if (!s.module_sign_mok_path.empty())
|
||||
- {
|
||||
- string mok_fingerprint;
|
||||
- split_path (s.module_sign_mok_path, mok_path, mok_fingerprint);
|
||||
- s.mok_fingerprints.clear();
|
||||
- s.mok_fingerprints.push_back(mok_fingerprint);
|
||||
- }
|
||||
-
|
||||
- rc = sign_module (s.tmpdir, s.module_filename(), s.mok_fingerprints, mok_path, s.kernel_build_tree);
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
PROBE1(stap, pass4__end, &s);
|
||||
|
||||
return rc;
|
||||
}
|
||||
-
|
||||
+
|
||||
int
|
||||
pass_5 (systemtap_session &s, vector<remote*> targets)
|
||||
{
|
@ -1,24 +0,0 @@
|
||||
commit ead30c04c7157fec194c0f6d81e5c51c99bf25cf
|
||||
gpg: Signature made Wed 24 May 2023 10:23:54 AM EDT
|
||||
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
|
||||
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
|
||||
Author: Frank Ch. Eigler <fche@redhat.com>
|
||||
Date: Wed May 24 10:22:08 2023 -0400
|
||||
|
||||
PR30484: stap-report: scrape less of /sys /proc
|
||||
|
||||
Mainly: avoid process/busy parts like /proc/$pid.
|
||||
|
||||
diff --git a/stap-report b/stap-report
|
||||
index 217ddf840..3b3a1a258 100755
|
||||
--- a/stap-report
|
||||
+++ b/stap-report
|
||||
@@ -105,7 +105,7 @@ elif [ -f /var/log/packages ]; then
|
||||
run "cat /var/log/packages | egrep 'systemtap|elfutils|kernel|gcc|dyninst|java|byteman|avahi|nss|nspr|dejagnu' | sort -k9"
|
||||
fi
|
||||
run "egrep 'PROBE|RANDOMIZE|RELOC|TRACE|MARKER|KALLSYM|_DEBUG_|LOCKDEP|LOCKING|MODULE|FENTRY|_SIG|BPF' /lib/modules/`uname -r`/build/.config | grep -v not.set | sort | fmt -w 80"
|
||||
-run "find /debugfs /proc /sys /dev /sys/kernel/debug -type f -path '*kprobe*' -o -path '*yama*' 2>/dev/null | xargs grep -H ."
|
||||
+run "find /debugfs /proc/sys /sys/kernel /dev -type f -path '*kprobe*' -o -path '*yama*' 2>/dev/null | xargs grep -H ."
|
||||
run "lsmod"
|
||||
run "avahi-browse -r -t _stap._tcp"
|
||||
run "ifconfig -a"
|
@ -1,64 +0,0 @@
|
||||
commit ab0c5c25509600b7c9cecc9e10baebc984082b50
|
||||
gpg: Signature made Fri 12 May 2023 11:18:18 AM EDT
|
||||
gpg: using RSA key 5D38116FA4D3A7CC77E378D37E83610126DCC2E8
|
||||
gpg: Good signature from "Frank Ch. Eigler <fche@elastic.org>" [full]
|
||||
Author: Frank Ch. Eigler <fche@redhat.com>
|
||||
Date: Fri May 12 11:13:45 2023 -0400
|
||||
|
||||
PR30442: failing optional statement probes should not trigger pass2 exceptions
|
||||
|
||||
In tapsets.cxx, query_cu() and query_module() aggressively caught &
|
||||
sess-print_error'd semantic_errors from subsidiary call sites. They
|
||||
are unaware of whether the probe in question is being resolved within
|
||||
an optional (? or !) context. Instead of this, they now simply let
|
||||
the exceptions propagate out to derive_probes() or similar, which does
|
||||
know whether exceptions are errors in that context. That means
|
||||
exceptions can propagate through elfutils iteration machinery too,
|
||||
perhaps risking C level memory leaks, but so be it.
|
||||
|
||||
This fix goes well beyond statement probes per se, but hand-testing
|
||||
and the testsuite appear not to show regressions related to this.
|
||||
|
||||
Added semok/badstmt.exp to test.
|
||||
|
||||
diff --git a/tapsets.cxx b/tapsets.cxx
|
||||
index 859160bc5..7b7107371 100644
|
||||
--- a/tapsets.cxx
|
||||
+++ b/tapsets.cxx
|
||||
@@ -2453,8 +2453,9 @@ query_cu (Dwarf_Die * cudie, dwarf_query * q)
|
||||
}
|
||||
catch (const semantic_error& e)
|
||||
{
|
||||
- q->sess.print_error (e);
|
||||
- return DWARF_CB_ABORT;
|
||||
+ // q->sess.print_error (e);
|
||||
+ throw;
|
||||
+ // return DWARF_CB_ABORT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2696,8 +2697,9 @@ query_module (Dwfl_Module *mod,
|
||||
}
|
||||
catch (const semantic_error& e)
|
||||
{
|
||||
- q->sess.print_error (e);
|
||||
- return DWARF_CB_ABORT;
|
||||
+ // q->sess.print_error (e);
|
||||
+ // return DWARF_CB_ABORT;
|
||||
+ throw;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/testsuite/semok/stmtbad.stp b/testsuite/semok/stmtbad.stp
|
||||
new file mode 100755
|
||||
index 000000000..06780790a
|
||||
--- /dev/null
|
||||
+++ b/testsuite/semok/stmtbad.stp
|
||||
@@ -0,0 +1,7 @@
|
||||
+#! /bin/sh
|
||||
+
|
||||
+exec stap -v -p2 -e 'probe oneshot {log("nothing") }
|
||||
+ probe process.statement("main@*:1")? { log("yo") }' -c stap
|
||||
+
|
||||
+# The optional misaddressed statement probe should let stap still
|
||||
+# succeed with the oneshot probe.
|
Loading…
Reference in new issue