diff --git a/checkin_notes b/checkin_notes index f5c5a47e9a..e45ec7dc0a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -616,3 +616,26 @@ Rom 15 Jan 2007 curl/ + +David 15 Jan 2007 + - core client: fix a bug that could cause computation to stop. + The problem: if we suspended a task by sending it a message, + we were changing its scheduler state to CPU_SCHED_PREEMPTED + but not changing its task state (PROCESS_EXECUTING). + If, for some reason, the process didn't exit right away, + the scheduler would treat it as still running, + since it builds its "currently running" list based on task_state. + Solution: the scheduler shouldn't be looking at task_state. + Use scheduler_state instead. + It's still a mystery why the app wasn't quitting. + + - db_dump: don't write team.nusers; it's meaningless + + client/ + app.C,h + app_control.C + cpu_sched.C + html/user/ + create_account.php + sched/ + db_dump.C diff --git a/client/app.C b/client/app.C index 7d063087a4..abd8036126 100644 --- a/client/app.C +++ b/client/app.C @@ -212,7 +212,7 @@ void ACTIVE_TASK_SET::get_memory_usage() { } for (i=0; itask_state == PROCESS_EXECUTING) { + if (atp->scheduler_state == CPU_SCHED_SCHEDULED) { PROCINFO& pi = atp->procinfo; unsigned long last_page_fault_count = pi.page_fault_count; memset(&pi, 0, sizeof(pi)); diff --git a/client/app.h b/client/app.h index 98d5a48bd4..2a4df8385f 100644 --- a/client/app.h +++ b/client/app.h @@ -40,8 +40,7 @@ typedef int PROCESS_ID; // values of ACTIVE_TASK::task_state // #define PROCESS_UNINITIALIZED 0 - -// states in which the process exists + // process doesn't exist yet #define PROCESS_EXECUTING 1 // process is running, as far as we know #define PROCESS_SUSPENDED 9 diff --git a/client/app_control.C b/client/app_control.C index f062fd3c4f..49fef0d59f 100644 --- a/client/app_control.C +++ b/client/app_control.C @@ -159,6 +159,7 @@ int ACTIVE_TASK::preempt(bool quit_task) { ); } pending_suspend_via_quit = true; + task_state = PROCESS_UNINITIALIZED; retval = request_exit(); } else { if (log_flags.cpu_sched) { @@ -224,7 +225,6 @@ void ACTIVE_TASK::handle_exited_app(int stat) { } else { if (pending_suspend_via_quit) { pending_suspend_via_quit = false; - task_state = PROCESS_UNINITIALIZED; close_process_handles(); return; } @@ -255,7 +255,6 @@ void ACTIVE_TASK::handle_exited_app(int stat) { // if (pending_suspend_via_quit) { pending_suspend_via_quit = false; - task_state = PROCESS_UNINITIALIZED; // destroy shm, since restarting app will re-create it // diff --git a/client/cpu_sched.C b/client/cpu_sched.C index bb05ec37eb..0760bce1f3 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -537,7 +537,7 @@ void CLIENT_STATE::make_running_task_heap( atp = active_tasks.active_tasks[i]; if (atp->result->project->non_cpu_intensive) continue; if (!atp->result->runnable()) continue; - if (atp->task_state != PROCESS_EXECUTING) continue; + if (atp->scheduler_state != CPU_SCHED_SCHEDULED) continue; running_tasks.push_back(atp); } diff --git a/doc/help_vol.php b/doc/help_vol.php index fcc4265eea..04d5bd5e84 100644 --- a/doc/help_vol.php +++ b/doc/help_vol.php @@ -8,6 +8,12 @@ $volid = $_GET['volid']; $vol = vol_lookup($volid); +function is_valid_email_addr($addr) { + $pattern = '/^([^@]+)@([^@\.]+)\.([^@]{2,})$/'; + $match = preg_match($pattern, $addr); + return (bool) $match; +} + function show_info($vol) { $x = " Country: $vol->country\n"; if ($vol->availability) { @@ -121,8 +127,8 @@ if ($send_email) { } $body = "The following message was sent by a BOINC Help user.\n"; $email_addr = $_GET['email_addr']; - if (!$email_addr) { - error_page("You need to specify your email address"); + if (!is_valid_email_addr($email_addr)) { + error_page("You must specify a valid email address"); } $reply = "\r\nreply-to: $email_addr"; $body .= "\n\n"; diff --git a/html/user/create_account.php b/html/user/create_account.php index 21969ede50..1e065f6947 100644 --- a/html/user/create_account.php +++ b/html/user/create_account.php @@ -40,7 +40,7 @@ if (strlen($passwd_hash) != 32) { $user = lookup_user_email_addr($email_addr); if ($user) { if ($user->passwd_hash != $passwd_hash) { - xml_error(-206); + xml_error(-137); } else { $authenticator = $user->authenticator; } diff --git a/sched/db_dump.C b/sched/db_dump.C index edae082eab..06cb92f9a3 100644 --- a/sched/db_dump.C +++ b/sched/db_dump.C @@ -487,16 +487,14 @@ void write_team(TEAM& team, FILE* f, bool detail) { " %d\n" " %f\n" " %f\n" - " %f\n" - " %d\n", + " %f\n", team.id, team.type, name, team.userid, team.total_credit, team.expavg_credit, - team.expavg_time, - team.nusers + team.expavg_time ); // show founder name since that user might not be active