summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-04-01 22:50:47 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-04-01 22:52:33 -0400
commitdcfd7fed7088871f46d9da7183e485877fb2d81f (patch)
tree57a560603d3b095a9f3f2bc01500becdacf785d9
parent65ffc3f32328473cb74aa5c7eca7e46bb82bd7fb (diff)
downloadsystemtap-steved-dcfd7fed7088871f46d9da7183e485877fb2d81f.tar.gz
systemtap-steved-dcfd7fed7088871f46d9da7183e485877fb2d81f.tar.xz
systemtap-steved-dcfd7fed7088871f46d9da7183e485877fb2d81f.zip
PR10019: --skip-badvars to suppress run-time memory errors too
* NEWS: Note this change. * hash.cxx (find_script_hash): Add s.skip_badvars into hash. * translate.cxx (translate_pass): Emit STP_SKIP_BADVARS. * runtime/loc2c-runtime.h (DEREF_FAULT, STORE_DEREF_FAULT): Provide dummy implementation if STP_SKIP_BADVARS.
-rw-r--r--NEWS7
-rw-r--r--hash.cxx1
-rw-r--r--runtime/loc2c-runtime.h6
-rw-r--r--translate.cxx2
4 files changed, 15 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index ec204442..96e14b70 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+* What's new
+
+- The --skip-badvars option now also suppresses run-time error
+ messages that would otherwise result from erroneous memory accesses.
+ Such accesses can originate from $context expressions fueled by
+ erroneous debug data, or by kernel_{long,string,...}() tapset calls.
+
* What's new in version 0.9.5
- New probes process().insn and process().insn.block that allows
diff --git a/hash.cxx b/hash.cxx
index 3ff6848d..01013c43 100644
--- a/hash.cxx
+++ b/hash.cxx
@@ -174,6 +174,7 @@ find_script_hash (systemtap_session& s, const string& script, const hash &base)
h.add(s.ignore_vmlinux); // --ignore-vmlinux
h.add(s.ignore_dwarf); // --ignore-dwarf
h.add(s.consult_symtab); // --kelf, --kmap
+ h.add(s.skip_badvars); // --skip-badvars
if (!s.kernel_symtab_path.empty()) // --kmap
{
h.add(s.kernel_symtab_path);
diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h
index 16ddb950..eaf47cad 100644
--- a/runtime/loc2c-runtime.h
+++ b/runtime/loc2c-runtime.h
@@ -62,6 +62,10 @@
must work right for kernel addresses, and can use whatever existing
machine-specific kernel macros are convenient. */
+#if STP_SKIP_BADVARS
+#define DEREF_FAULT(addr) ({0; })
+#define STORE_DEREF_FAULT(addr) ({0; })
+#else
#define DEREF_FAULT(addr) ({ \
snprintf(c->error_buffer, sizeof(c->error_buffer), \
"kernel read fault at 0x%p (%s)", (void *)(intptr_t)(addr), #addr); \
@@ -75,7 +79,7 @@
c->last_error = c->error_buffer; \
goto deref_fault; \
})
-
+#endif
#if defined (STAPCONF_X86_UNIREGS) && defined (__i386__)
diff --git a/translate.cxx b/translate.cxx
index 47fffd1e..9085349e 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4955,6 +4955,8 @@ translate_pass (systemtap_session& s)
s.op->newline() << "#define STP_OVERLOAD";
s.op->newline() << "#endif";
+ s.op->newline() << "#define STP_SKIP_BADVARS " << (s.skip_badvars ? 1 : 0);
+
if (s.bulk_mode)
s.op->newline() << "#define STP_BULKMODE";