Backport `info os processes' crash fix - for Eclipse (Pedro Alves, BZ 746294).

This commit is contained in:
Jan Kratochvil 2011-10-14 22:13:26 +02:00
parent 7218d159e3
commit 52bb570800
2 changed files with 69 additions and 1 deletions

View File

@ -1336,3 +1336,68 @@ http://sourceware.org/ml/gdb-cvs/2011-08/msg00047.html
DisablePrettyPrinter()
+
+register_pretty_printer_commands()
http://sourceware.org/ml/gdb-patches/2011-08/msg00505.html
Subject: fix "info os processes" race -> crash (ext-run.exp racy FAIL)
http://sourceware.org/ml/gdb-cvs/2011-08/msg00116.html
### src/gdb/ChangeLog 2011/08/26 17:58:57 1.13281
### src/gdb/ChangeLog 2011/08/26 18:58:02 1.13282
## -1,3 +1,8 @@
+2011-08-26 Pedro Alves <pedro@codesourcery.com>
+
+ * common/linux-osdata.c (get_cores_used_by_process): Don't assume
+ opening /proc/PID/task always succeeds.
+
2011-08-26 Aleksandar Ristovski <aristovski@qnx.com>
* linespec.c (symtab_from_filename): Check for the end of string.
--- src/gdb/common/linux-osdata.c 2011/07/21 23:46:09 1.1
+++ src/gdb/common/linux-osdata.c 2011/08/26 18:58:04 1.2
@@ -259,27 +259,29 @@
sprintf (taskdir, "/proc/%d/task", pid);
dir = opendir (taskdir);
-
- while ((dp = readdir (dir)) != NULL)
+ if (dir)
{
- pid_t tid;
- int core;
+ while ((dp = readdir (dir)) != NULL)
+ {
+ pid_t tid;
+ int core;
- if (!isdigit (dp->d_name[0])
- || NAMELEN (dp) > sizeof ("4294967295") - 1)
- continue;
+ if (!isdigit (dp->d_name[0])
+ || NAMELEN (dp) > sizeof ("4294967295") - 1)
+ continue;
- tid = atoi (dp->d_name);
- core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
+ tid = atoi (dp->d_name);
+ core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
- if (core >= 0)
- {
- ++cores[core];
- ++task_count;
+ if (core >= 0)
+ {
+ ++cores[core];
+ ++task_count;
+ }
}
- }
- closedir (dir);
+ closedir (dir);
+ }
return task_count;
}

View File

@ -27,7 +27,7 @@ Version: 7.3.50.20110722
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 8%{?_with_upstream:.upstream}%{?dist}
Release: 9%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers
@ -1252,6 +1252,9 @@ fi
%{_infodir}/gdb.info*
%changelog
* Fri Oct 14 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3.50.20110722-9.fc16
- Backport `info os processes' crash fix - for Eclipse (Pedro Alves, BZ 746294).
* Tue Oct 11 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3.50.20110722-8.fc16
- Fix PIE testsuite run; new lib/future.exp hack and use -fPIC instead of -fPIE.