summaryrefslogtreecommitdiffstats
path: root/base/linux_util.h
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 17:03:13 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 17:03:13 +0000
commit6d578c48ca8971533e0052516d62947b1ba08b91 (patch)
tree9c54648d9272777f2450708a667a6d803571da19 /base/linux_util.h
parentfb94473d9735a39714cf06f8f69fef4d8911e062 (diff)
downloadchromium_src-6d578c48ca8971533e0052516d62947b1ba08b91.zip
chromium_src-6d578c48ca8971533e0052516d62947b1ba08b91.tar.gz
chromium_src-6d578c48ca8971533e0052516d62947b1ba08b91.tar.bz2
Merge 89795 - Always search TIDs for the crashing processes.
Kernels newer than 2.6.32 support TID and PID namespacing where processes' view of their TIDs and PIDs are not globally unique or externally meaningful. We have workarounds to find the TID and PID of the crashing process from outside in the browser process. However, we were only assuming TID namespacing was happening if PID namespacing was enabled and the kernel had a bug that was fixed since 2.6.38. This change causes us to always treat the TID as subject to namespacing. Our trick to find the TID relies on a procfs feature added in 2008. We assume if that feature is not yet present that the TID translation is not necessary. This fixes the bug where all crashes of non-browser processes on Linux 2.6.38+ (Chrome OS r13+) are unusable (result in UnspecifiedStackSignature). BUG=chromium-os:15462 TEST=Do about:crash on 2.6.38 kernel and verify proper tid listed in MDException block Review URL: http://codereview.chromium.org/7190019 TBR=kmixter@chromium.org Review URL: http://codereview.chromium.org/7232018 git-svn-id: svn://svn.chromium.org/chrome/branches/782/src@90041 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/linux_util.h')
-rw-r--r--base/linux_util.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/linux_util.h b/base/linux_util.h
index de597db..d33cb88 100644
--- a/base/linux_util.h
+++ b/base/linux_util.h
@@ -37,9 +37,11 @@ BASE_API bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode);
// For a given process |pid|, look through all its threads and find the first
// thread with /proc/[pid]/task/[thread_id]/syscall whose first N bytes matches
// |expected_data|, where N is the length of |expected_data|.
-// Returns the thread id or -1 on error.
+// Returns the thread id or -1 on error. If |syscall_supported| is
+// set to false the kernel does not support syscall in procfs.
BASE_API pid_t FindThreadIDWithSyscall(pid_t pid,
- const std::string& expected_data);
+ const std::string& expected_data,
+ bool* syscall_supported);
} // namespace base