integrity check function

svn path=/trunk/boinc/; revision=1752
This commit is contained in:
David Anderson 2003-07-21 12:42:41 +00:00
parent 5295cbdd30
commit c70b7b9fd1
8 changed files with 191 additions and 61 deletions

View File

@ -705,9 +705,10 @@ bool ACTIVE_TASK::read_stderr_file() {
sprintf(path, "%s%s%s", slot_dir, PATH_SEPARATOR, STDERR_FILE);
FILE* f = fopen(path, "r");
if (f) {
n = fread(stderr_file, 1, sizeof(stderr_file), f);
n = fread(stderr_file, 1, sizeof(stderr_file)-1, f);
fclose(f);
stderr_file[n-1] = '\0';
if (n < 0) return false;
stderr_file[n] = '\0';
result->stderr_out += "<stderr_txt>\n";
result->stderr_out += stderr_file;
result->stderr_out += "\n</stderr_txt>\n";

View File

@ -1674,3 +1674,147 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
return 0;
}
void CLIENT_STATE::check_project_pointer(PROJECT* p) {
unsigned int i;
for (i=0; i<projects.size(); i++) {
if (p == projects[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_app_pointer(APP* p) {
unsigned int i;
for (i=0; i<apps.size(); i++) {
if (p == apps[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_file_info_pointer(FILE_INFO* p) {
unsigned int i;
for (i=0; i<file_infos.size(); i++) {
if (p == file_infos[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_app_version_pointer(APP_VERSION* p) {
unsigned int i;
for (i=0; i<app_versions.size(); i++) {
if (p == app_versions[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_workunit_pointer(WORKUNIT* p) {
unsigned int i;
for (i=0; i<workunits.size(); i++) {
if (p == workunits[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_result_pointer(RESULT* p) {
unsigned int i;
for (i=0; i<results.size(); i++) {
if (p == results[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_pers_file_xfer_pointer(PERS_FILE_XFER* p) {
unsigned int i;
for (i=0; i<pers_xfers->pers_file_xfers.size(); i++) {
if (p == pers_xfers->pers_file_xfers[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_file_xfer_pointer(FILE_XFER* p) {
unsigned int i;
for (i=0; i<file_xfers->file_xfers.size(); i++) {
if (p == file_xfers->file_xfers[i]) return;
}
assert(0);
}
void CLIENT_STATE::check_app(APP& p) {
check_project_pointer(p.project);
}
void CLIENT_STATE::check_file_info(FILE_INFO& p) {
if (p.pers_file_xfer) check_pers_file_xfer_pointer(p.pers_file_xfer);
if (p.result) check_result_pointer(p.result);
check_project_pointer(p.project);
}
void CLIENT_STATE::check_file_ref(FILE_REF& p) {
check_file_info_pointer(p.file_info);
}
void CLIENT_STATE::check_app_version(APP_VERSION& p) {
unsigned int i;
check_app_pointer(p.app);
check_project_pointer(p.project);
for (i=0; i<p.app_files.size(); i++) {
check_file_ref(p.app_files[i]);
}
}
void CLIENT_STATE::check_workunit(WORKUNIT& p) {
unsigned int i;
for (i=0; i<p.input_files.size(); i++) {
check_file_ref(p.input_files[i]);
}
check_project_pointer(p.project);
check_app_pointer(p.app);
check_app_version_pointer(p.avp);
}
void CLIENT_STATE::check_result(RESULT& p) {
unsigned int i;
for (i=0; i<p.output_files.size(); i++) {
check_file_ref(p.output_files[i]);
}
check_app_pointer(p.app);
check_workunit_pointer(p.wup);
check_project_pointer(p.project);
}
void CLIENT_STATE::check_active_task(ACTIVE_TASK& p) {
check_result_pointer(p.result);
check_workunit_pointer(p.wup);
check_app_version_pointer(p.app_version);
}
void CLIENT_STATE::check_pers_file_xfer(PERS_FILE_XFER& p) {
check_file_xfer_pointer(p.fxp);
check_file_info_pointer(p.fip);
}
void CLIENT_STATE::check_file_xfer(FILE_XFER& p) {
check_file_info_pointer(p.fip);
}
void CLIENT_STATE::check_all() {
unsigned int i;
for (i=0; i<apps.size(); i++) {
check_app(*apps[i]);
}
for (i=0; i<file_infos.size(); i++) {
check_file_info(*file_infos[i]);
}
for (i=0; i<app_versions.size(); i++) {
check_app_version(*app_versions[i]);
}
for (i=0; i<workunits.size(); i++) {
check_workunit(*workunits[i]);
}
for (i=0; i<results.size(); i++) {
check_result(*results[i]);
}
for (i=0; i<active_tasks.active_tasks.size(); i++) {
check_active_task(*active_tasks.active_tasks[i]);
}
for (i=0; i<pers_xfers->pers_file_xfers.size(); i++) {
check_pers_file_xfer(*pers_xfers->pers_file_xfers[i]);
}
for (i=0; i<file_xfers->file_xfers.size(); i++) {
check_file_xfer(*file_xfers->file_xfers[i]);
}
}

View File

@ -207,6 +207,27 @@ public:
WORKUNIT* lookup_workunit(PROJECT*, char*);
APP_VERSION* lookup_app_version(APP*, int);
ACTIVE_TASK* lookup_active_task_by_result(RESULT*);
void check_project_pointer(PROJECT*);
void check_app_pointer(APP*);
void check_file_info_pointer(FILE_INFO*);
void check_app_version_pointer(APP_VERSION*);
void check_workunit_pointer(WORKUNIT*);
void check_result_pointer(RESULT*);
void check_pers_file_xfer_pointer(PERS_FILE_XFER*);
void check_file_xfer_pointer(FILE_XFER*);
void check_app(APP&);
void check_file_info(FILE_INFO&);
void check_file_ref(FILE_REF&);
void check_app_version(APP_VERSION&);
void check_workunit(WORKUNIT&);
void check_result(RESULT&);
void check_active_task(ACTIVE_TASK&);
void check_pers_file_xfer(PERS_FILE_XFER&);
void check_file_xfer(FILE_XFER&);
void check_all();
};
extern CLIENT_STATE gstate;

View File

@ -2,20 +2,13 @@
Implementation and debugging of BOINC
</h3>
<p>
<b>Note: for legal reasons, the BOINC project has temporarily
been removed from Sourceforge.net and the source code is not available.
We hope to resolve this situation soon.</b>
The BOINC source code is <a href=source.html>here</a>.
<p>
BOINC is open-source software.
If you are an experienced C++ system programmer you may be able
to help us maintain and enhance BOINC.
In any case, you are welcome to browse the source code and
give us feedback.
<p>
Visit <a href=http://sf.net/projects/boinc>http://sf.net/projects/boinc</a>
to download the source code
and to view the list of outstanding bugs and feature requests.
<p>
Before sure that you understand exactly how BOINC is intended
to work (for both <a href=participate.html>participants</a>
and <a href=create_project.html>developers</a>)

View File

@ -52,32 +52,6 @@ Get the source
- released distribution from http://boinc.berkeley.edu/
- CVS:
CVSROOT=anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc
authentication: pserver, password=(blank)
- Command-Line CVS (UNIX/CygWin):
1 At command line, enter:
cvs -d:pserver:anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc login
Enter a blank password.
2 At command line, enter:
cvs -z3 -d:pserver:anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc co boinc
- WinCVS
1 Menu item Create->Checkout module
2 Under General Tab, set CVSROOT to "anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc"
3 Under General Tab, Set authentication to "'passwd' file on the cvs server"
4 Under Checkout settings tab, set module name to "boinc"
5 Under Checkout settings tab, checkout location to "C:\", click OK
-------------------------------------------------------------------------
Setup Build Environments
@ -118,16 +92,7 @@ Macintosh
Build Source Release
0 Get latest source using CVS
0.1 At command line, enter:
cvs -d:pserver:anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc login
Enter a blank password.
0.2 At command line, enter:
cvs -z3 -d:pserver:anonymous@cvs.boinc.sourceforge.net:/cvsroot/boinc co boinc
0 Get latest source
1 Make source distributions (.tar.gz, .tar.bz2, .zip)

View File

@ -1,4 +1,6 @@
<title>Berkeley Open Infrastructure for Network Computing (BOINC)</title>
<meta name=description content="BOINC is a software platform for developing public-participation distributed computing projects">
<meta name=keywords content="distributed scientific computing supercomputing grid">
<body bgcolor=ffffff text=000088 link=000088 vlink=000088>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td>
@ -62,17 +64,20 @@ Help debug and enhance the BOINC software.
<a href=contact.html><b>Contact us</b></a>
<br><br>
<!--
<font size=-1>
<a href=http://www.sf.net/projects/boinc/>BOINC development</a>
is hosted at </font>
<a href="http://sourceforge.net"><img align=top src="http://sourceforge.net/sflogo.php?group_id=52437&amp" border="0" alt="SourceForge Logo"></a>
-->
</td>
<td valign=top bgcolor=d8f4ff width=100%>
<center>
<h3>Status and news</h3>
</center>
<b>July 23, 2003</b>
<br>
The <a href=source.html>BOINC source code</a> is available again,
under <a href=legal.html>a new public license</a>.
Version 1.05 incorporates bug fixes and new features,
including the ability to add your own graphics to the screensaver.
The beta test has been resumed, and the scheduling server and
database have been moved to a new machine.
<br><br>
<b>June 10, 2003</b>
<br>
<a href="http://boinc.berkeley.edu/db_dump.html">XML based statistics</a> for
@ -108,13 +113,5 @@ We hope to resolve this issue soon.
We are preparing a BOINC-based version of SETI@home.
See a <a href=setiathome.jpg>preview of the graphics</a>.
<br><br>
<b>March 25, 2003</b>
<br>
<a href=http://www.boinc.dk/index.php?page=download_languages>Non-English
language.ini files</a> are available.
Preferences include time-of-day restrictions.
Core client and applications communicate via shared memory and signals
rather than files, reducing disk traffic.
<br><br>
<a href=old_news.html>Archived news</a>
</td> </tr></table>

View File

@ -1,3 +1,12 @@
<b>March 25, 2003</b>
<br>
<a href=http://www.boinc.dk/index.php?page=download_languages>Non-English
language.ini files</a> are available.
Preferences include time-of-day restrictions.
Core client and applications communicate via shared memory and signals
rather than files, reducing disk traffic.
<br><br>
<b>March 19, 2003</b>
<br>
New account parameters and preferences: URL, limit number of processors,

View File

@ -184,6 +184,7 @@ char *countries[NUM_COUNTRIES] = {
"Sao Tome and Principe",
"Saudi Arabia",
"Senegal",
"Serbia and Montenegro",
"Seychelles",
"Sierra Leone",
"Singapore",
@ -227,7 +228,6 @@ char *countries[NUM_COUNTRIES] = {
"West Bank",
"Western Sahara",
"Yemen",
"Yugoslavia",
"Zambia",
"Zimbabwe"
};