Commit Graph

9 Commits

Author SHA1 Message Date
Vitalii Koshura e442d8add4
script_validator segfault fix
Fix script to verify that both init_script and compare_script parameters are defined

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2018-07-20 16:12:28 +03:00
Vitalii Koshura aae36b1d69
script_validator segfault fix
Fix missed semicolon

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2018-07-20 15:36:20 +03:00
Vitalii Koshura dd7c152bc6
script_validator segfault fix
Current script_validator implementation contains next statements:

sprintf(cmd, "../bin/%s", init_script[0].c_str());

and

sprintf(cmd, "../bin/%s", compare_script[0].c_str());

It is dangerous to use this arrays
that are filled by parsing command line
without validating whether they contain any elements
and leads to next behavior:

Program received signal SIGSEGV, Segmentation fault.
0x000000000040f838 in compare_results (r1=..., r2=..., match=match@entry=@0x7ffffffb6c17: false) at script_validator.cpp:154
154	script_validator.cpp: No such file or directory.
(gdb) bt
#0  0x000000000040f838 in compare_results (r1=..., r2=..., match=match@entry=@0x7ffffffb6c17: false) at script_validator.cpp:154
#1  0x000000000040e85d in check_set (results=std::vector of length 2, capacity 2 = {...}, wu=..., canonicalid=@0x7ffffffb6dd0: 0,
    retry=@0x7ffffffb6dcf: false) at validate_util2.cpp:134
#2  0x000000000040944e in handle_wu (validator=..., items=std::vector of length 3, capacity 4 = {...}) at validator.cpp:411
#3  0x000000000040a9f2 in do_validate_scan () at validator.cpp:730
#4  0x000000000040aae4 in main_loop () at validator.cpp:756
#5  0x00000000004039f6 in main (argc=5, argv=0x7fffffffdd48) at validator.cpp:929

This fix checks whether these arrays contain some elements
and output a readable error of missed inout parameter.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2018-07-20 15:21:10 +03:00
Christian Beer 2c36e7246d Daemons: enhance validator framework
The validator handler can now pass unknown arguments to the project specific handler.
Projects that have there own validator need to implement the validate_handler_init() function and handle project specific arguments there. They also need to supply a validate_handler_usage() function that printf()'s a description of the custom options. For examples see sample_substr_validator.cpp or script_validator.cpp
The validator test harness was also adopted to use this new functions.

This brings the implementation of the validator framework on the same level as the assimilator framework where similar changes where made in 0038d275c and dd004404a.
2016-08-16 11:14:42 +02:00
David Anderson 8cd8c8e7ee server software: handle 64-bit database IDs
The SETI@home result table is about to run out of 32-bit IDs,
so we need to move to 64-bit result IDs.
This will happen to the workunit table at some point too.

I changed the server C++ code to use the "long" type for all DB IDs
(and to use appropriate conversion codes like %lu).
"long" is 64 bit on 64-bit machines.
For uniformity I did this for all tables,
even ones (like app) that will never get big.

I chose NOT to change the DB schema for now.
The new code will work with 32-bit ID fields in the DB.
As projects approach the 32-bit limit on a table they can change
its ID field, and fields that reference this table, to BIGINT.
This is likely to happen only on the result and workunit tables.
I put functions in html/ops/db_update.php
to change the IDs of these tables.
2015-07-23 10:11:08 -07:00
David Anderson 6eabd34068 server: extend script_validator and script_assimilator to pass extra args
You can arrange to pass result IDs, runtime, etc.
to your validation and assimilation scripts.  See
http://boinc.berkeley.edu/trac/wiki/ValidationSimple#Usingscriptinglanguages
http://boinc.berkeley.edu/trac/wiki/AssimilateIntro#Usingscriptinglanguages
2014-10-24 14:22:07 -07:00
David Anderson d2488ef87f server: add script_assimilator.cpp: support for script-based assimilators.
Also fix bug in script_validator.cpp
2014-10-22 10:24:40 -07:00
David Anderson 302aa8c7aa server: add script_validator: a validator framework for Python, Perl, bash etc.
Added script_validator, a validator that invokes scripts of your choice
to check and compare results.
These can be in any language you want.
2014-10-21 22:14:57 -07:00
David Anderson d1b2c57c37 client, Android: clear out project directory on project reset.
When a project is reset, the client deletes all the files from its dir
that BOINC knows about.
However, there may be other files, created by its apps.
On Android, where space is likely to be scarce,
delete these when the project is reset.

Maybe we should do this on all projects.
But we'd need to not to delete user-created files
like app_config.xml, and anonymous-platform stuff
like app_info.xml and the app files.
2014-10-21 22:06:22 -07:00