summaryrefslogtreecommitdiffstats
path: root/results/classifier/111/review/1299190
diff options
context:
space:
mode:
Diffstat (limited to 'results/classifier/111/review/1299190')
-rw-r--r--results/classifier/111/review/129919092
1 files changed, 92 insertions, 0 deletions
diff --git a/results/classifier/111/review/1299190 b/results/classifier/111/review/1299190
new file mode 100644
index 00000000..a4d9ad90
--- /dev/null
+++ b/results/classifier/111/review/1299190
@@ -0,0 +1,92 @@
+other: 0.210
+semantic: 0.189
+performance: 0.071
+device: 0.067
+permissions: 0.065
+files: 0.063
+PID: 0.054
+graphic: 0.048
+vnc: 0.046
+debug: 0.045
+socket: 0.043
+network: 0.041
+boot: 0.033
+KVM: 0.026
+debug: 0.223
+semantic: 0.136
+files: 0.114
+PID: 0.098
+other: 0.092
+performance: 0.058
+permissions: 0.044
+network: 0.042
+boot: 0.039
+graphic: 0.038
+device: 0.033
+vnc: 0.032
+socket: 0.027
+KVM: 0.025
+
+Access to /proc/self/exe in linux-user mode
+
+This is based on a recent bug in GCC Bugzilla: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60681
+
+It looks like libbacktrace (GCC runtime library used for obtaining stack traces) uses /proc/self/exe for error reporting. Currently this is mapped to qemu-arm which effectively disables libbacktrace on linux-user.
+
+It seems that QEMU already supports /proc/self/{maps,stat,auxv} so addition of /proc/self/exe may be trivial.
+
+This tiny patch seems to work.
+
+I think the problem is not in libbacktrace per se but rather libsanitizer initializing libbacktrace with contents of /proc/self/exe. Patch is still relevant though.
+
+Looks good, I'll get this to linux-user que once QEMU 2.0 is released.
+
+That patch will copy the whole of the target executable into a temporary file without changing any of it -- the fake_open mechanism is really intended for cases where we need to return modified results. Wouldn't it be easier to just have something in do_open() that said:
+ if (is_proc_myself(pathname, "exe")) {
+ return get_errno(open(exec_path), flags, mode);
+ }
+
+That will then give the right behaviour for read-only executables and other error-related corner cases.
+
+(See also the logic in the readlink/readlinkat handling which already specialcases /proc/self/exe using exec_path.)
+
+
+(I got the bracket placement wrong there so as you can tell the code is untested :-))
+
+
+Yes, it works. Here is updated patch.
+
+Some nits:
+ The "(CPUArchState *)" cast isn't necessary
+ We should use exec_path, not ts->bprm->argv[0] (the guest argv[0] isn't necessarily the executable path)
+ We don't want to call path() here -- exec_path is a host path, and only guest filename paths need to go through path().
+
+Looking a little more closely at the logic in main.c I wonder if we actually want:
+
+ if (is_proc_myself(pathname, "exe")) {
+ execfd = qemu_getauxval(AT_EXECFD);
+ if (execfd) {
+ return execfd;
+ }
+ return get_errno(open(exec_path, flags, mode));
+ }
+
+Also if you'd like us to apply your patches we'll need at least a "Signed-off-by: " line from you.
+
+
+Ok, fixed.
+
+Thanks. That version
+Reviewed-by: Peter Maydell <email address hidden>
+
+
+Hi,
+
+Is this patch deployed in new version of QEMU?
+
+Thanks,
+Maxim
+
+This bug was fixed by commit aa07f5ecf9828 in 2014 and has been released in QEMU.
+
+