- client: fix crashing bug when there's a cycle in the process graph.

I had fixed this in one place but not another.
- client: don't memset(0,) a PROCINFO; use clear() instead


svn path=/trunk/boinc/; revision=24431
This commit is contained in:
David Anderson 2011-10-19 07:49:23 +00:00
parent 4d7d415b6d
commit 68b3fe6b19
5 changed files with 28 additions and 13 deletions

View File

@ -7300,9 +7300,9 @@ David 14 Oct 2011
work_fetch.cpp
David 14 Oct 2011
- client: bug fix for the above
client/
work_fetch.cpp
- client: bug fix for the above
client/
work_fetch.cpp
David 14 Oct 2011
- scheduler: in cuda_check(), ati_check() and opencl_check()
@ -7468,9 +7468,20 @@ David 18 Oct 2011
cpu_sched.cpp
David 18 Oct 2011
- client: fix bug that caused extra "<" to get written at
end of global_prefs_override.xml and cc_config.xml
when they are modified via GUI RPCs
- client: fix bug that caused extra "<" to get written at
end of global_prefs_override.xml and cc_config.xml
when they are modified via GUI RPCs
client/
gui_rpc_server_ops.cpp
client/
gui_rpc_server_ops.cpp
David 19 Oct 2011
- client: fix crashing bug when there's a cycle in the process graph.
I had fixed this in one place but not another.
- client: don't memset(0,) a PROCINFO; use clear() instead
lib/
proc_control.cpp
procinfo_mac.cpp
procinfo_unix.cpp
procinfo_win.cpp

View File

@ -48,8 +48,11 @@ using std::vector;
static void get_descendants_aux(PROC_MAP& pm, int pid, vector<int>& pids) {
PROC_MAP::iterator i = pm.find(pid);
if (i == pm.end()) return;
for (unsigned int j=0; j<i->second.children.size(); j++) {
int child_pid = i->second.children[j];
PROCINFO& p = i->second;
if (p.scanned) return; // avoid infinite recursion
p.scanned = true;
for (unsigned int j=0; j<p.children.size(); j++) {
int child_pid = p.children[j];
pids.push_back(child_pid);
get_descendants_aux(pm, child_pid, pids);
}

View File

@ -113,7 +113,7 @@ int procinfo_setup(PROC_MAP& pm) {
} while (c != '\n');
while (1) {
memset(&p, 0, sizeof(p));
p.clear();
c = fscanf(fd, "%d%d%d%d%ld%d%d:%lf ",
&p.id,
&p.parentid,

View File

@ -188,7 +188,7 @@ int procinfo_setup(PROC_MAP& pm) {
sprintf(pidpath, "/proc/%s/psinfo", piddir->d_name);
fd = fopen(pidpath, "r");
if (fd) {
memset(&p, 0, sizeof(p));
p.clear();
if (fread(&psinfo, sizeof(psinfo_t), 1, fd) == 1) {
p.id = psinfo.pr_pid;
p.parentid = psinfo.pr_ppid;
@ -225,7 +225,7 @@ int procinfo_setup(PROC_MAP& pm) {
if (retval) {
final_retval = retval;
} else {
memset(&p, 0, sizeof(p));
p.clear();
p.id = ps.pid;
p.parentid = ps.ppid;
p.swap_size = ps.vsize;

View File

@ -87,6 +87,7 @@ int get_procinfo_XP(PROC_MAP& pm) {
pProcesses = (PSYSTEM_PROCESSES)pBuffer;
while (pProcesses) {
PROCINFO p;
p.clear();
p.id = pProcesses->ProcessId;
p.parentid = pProcesses->InheritedFromProcessId;
p.swap_size = pProcesses->VmCounters.PagefileUsage;