Forum > Windows
optimized sources
_heinz:
Merci, hab ich hereingetan...
Mit dem debugger komme ich bis zu der Stelle wo er das testfile (die wu "workunit.sah" einlesen will.
hier
// Open the file and load the first line
FILE *fp = fopen(virtual_name, "r"); <----- hier passiert es
if (!fp) return ERR_FOPEN;
es wird dann verzweigt zu iosfwd
439 static size_t __CLRCALL_OR_CDECL length(const _Elem *_First)
{ // find length of null-terminated string
// _DEBUG_POINTER(_First);
return (::strlen(_First)); <------
}
Eine Ausnahme (erste Chance) bei 0x7c812a7b in setiathome_2.3S5B_windows_intelx86.exe: Microsoft C++-Ausnahme: seti_error an Speicherposition 0x0012f158..
Der Thread 'Debug Exception Monitor' (0xd9c) hat mit Code -5 (0xfffffffb) geendet.
Der Thread 'Timer' (0x7a0) hat mit Code -5 (0xfffffffb) geendet.
Das Programm "[2928] setiathome_2.3S5B_windows_intelx86.exe: Systemeigen" wurde mit Code -5 (0xfffffffb) beendet.
-----------------------------------------------------------------------------------
hab mal nachgeschaut: workunit.sah hat nur das archivbit gesetzt
???? hmmm...
fehlt noch was ??
heinz
_heinz:
sieht aus als hätt ich ein problem mit mkl.... muss prüfen ::)
Simon:
Äh,
MKL wird in unseren derzeitigen Sourcen eigentlich nicht verwendet (wir verwenden IPP's FFT-Implementation für die optimierten Apps, Berkeley verwendet FFTW). Würde vorschlagen, die MKL includes/libraries raus zu nehmen, falls Du sie drin hast.
MfG,
Simon.
_heinz:
Hi all,
to debug the client I took the 3 files ( init_data.xml stderr.txt work_unit.sah ) into the debug directory where the client is compiled and linked. Then set in seti_boinc ---> Konfigurationseigenschaften ---> Debuggen ---->Befehl C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe
---->Befehlsargumente -bench -show_benchmark
Now set line 240 worker.cpp a stoppoint and begin to debug
239 retval = read_wu_state();
240 if ( retval ) SETIERROR( retval, "from read_wu_state() in worker()" ); <----stoppoint
if we reached it we can see that read_wu_state() give back errno=2
normally that means: 2 ENOENT No such file or directory. A component of a specified pathname did not exist, or the pathname was an empty string.
But now the error must be interpreted through the program.
It goes to: line 286 worker.cpp
286 catch( seti_error e )
{
if ( e == RESULT_OVERFLOW )
{
fprintf( stderr, "SETI@Home Informational message -9 result_overflow\n" );
fprintf(
stderr,
"NOTE: The number of results detected exceeds the storage space allocated.\n" );
final_report(); // add signal and flop counts to stderr.txt
progress = 1;
remaining = 0;
boinc_fraction_done( progress );
checkpoint( true ); // force a checkpoint
boinc_fpops_cumulative( analysis_state.FLOP_counter * LOAD_STORE_ADJUSTMENT );
boinc_finish( 0 );
exit( 0 ); // an overflow is not an app error
}
else
{
e.print(); <---------- to here
exit ( static_cast< int >( e ) );
}
}
} // worker()
Because its not a result overflow it goes to e.print ----> in s_util.cpp
void seti_error::print( void ) const
{
std::cerr << "SETI@home error " << -value << " ";
if ( (value <= atexit_failure) && (value >= 0) )
{
std::cerr << message[value];
}
else
{
std::cerr << "Unknown error";
}
std::cerr << std::endl << data << std::endl;
std::cerr << "File: " << file << std::endl;
std::cerr << "Line: " << line << std::endl;
std::cerr << std::endl;
}
--------------------------- now to iosfwd ---->
static size_t __CLRCALL_OR_CDECL length(const _Elem *_First)
{ // find length of null-terminated string
// _DEBUG_POINTER(_First);
return (::strlen(_First)); <--------
}
------------------------------------------
- _First 0x00714558 "C" const char *
and
+ _First 0x006cb5a8 "" const char * <---second loop
--------------------------------------
‡ std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign zurückgegeben. "work_unit.sah" std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
-----------------------------------------------
come now to 318 app_ipc
318 FILE *fp = fopen(virtual_name, "r");
if (!fp) return ERR_FOPEN;
--------------------------------------------------------
then to 129 app_ipc
129 FILE *fp = fopen(virtual_name, "r");
if (!fp) return ERR_FOPEN;
-----------------------------------------------------------------
then to
static int read_wu_state( void )
{
FILE *f;
int retval = 0;
string path;
FORCE_FRAME_POINTER;
boinc_resolve_filename_s( WU_FILENAME, path );
f = boinc_fopen( path.c_str(), "rb" );
if ( f )
{
#ifdef BOINC_APP_GRAPHICS
if ( !nographics() ) sprintf( sah_graphics->status, "Scanning data file\n" );
#endif
retval = seti_parse_wu( f, analysis_state );
fclose( f );
if ( retval ) SETIERROR( retval, "from seti_parse_wu() in read_wu_state()" );
}
else
{
char msg[1024];
sprintf( msg, "(%s) in read_wu_state() errno=%d\n", path.c_str(), errno );
SETIERROR( FOPEN_FAILED, msg );
}
retval = seti_init_state();
if ( retval ) SETIERROR( retval, "from seti_init_state() in read_wu_state()" );
#ifdef BOINC_APP_GRAPHICS
if ( !nographics() ) sprintf( sah_graphics->status, "Scanning state file.\n" );
#endif
try
{
retval = parse_state_file( analysis_state );
}
catch( seti_error e )
{
// Failure to open the state file means that are starting a new WU.
if ( static_cast< int >( e ) == FOPEN_FAILED )
{
retval = initialize_for_wu();
if ( retval )
SETIERROR( retval, "from initialize_for_wu() in read_wu_state()" );
}
else
throw e;
}
boinc_fraction_done( progress * remaining + (1.0 - remaining) * (1.0 - remaining) );
return 0;
}
------------------------------------------------------ then to
static size_t __CLRCALL_OR_CDECL length(const _Elem *_First)
{ // find length of null-terminated string
// _DEBUG_POINTER(_First);
return (::strlen(_First));
}
----------------------------------------------------
+ _First 0x0012f3b4 "(work_unit.sah) in read_wu_state() errno=2
" const char *
+ this "(work_unit.sah) in read_wu_state() errno=2
" std::basic_string<char,std::char_traits<char>,std::allocator<char> > * const
------------------------------------------------------
+ this 0x0012f158 {value=5 file="c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\worker.cpp" line=144 ...} seti_error * const
-------------------------------------------
then to 143 worker.cpp
143 sprintf( msg, "(%s) in read_wu_state() errno=%d\n", path.c_str(), errno );
SETIERROR( FOPEN_FAILED, msg );
-------------------------------------------------------------
then to catch_error 286
286 catch( seti_error e )
{
if ( e == RESULT_OVERFLOW )
{
fprintf( stderr, "SETI@Home Informational message -9 result_overflow\n" );
fprintf(
stderr,
"NOTE: The number of results detected exceeds the storage space allocated.\n" );
final_report(); // add signal and flop counts to stderr.txt
progress = 1;
remaining = 0;
boinc_fraction_done( progress );
checkpoint( true ); // force a checkpoint
boinc_fpops_cumulative( analysis_state.FLOP_counter * LOAD_STORE_ADJUSTMENT );
boinc_finish( 0 );
exit( 0 ); // an overflow is not an app error
}
else
{
e.print();
exit ( static_cast< int >( e ) ); <--------------- here the app crash
}
}
} // worker()
-----------------------------------------------
+ e {value=5 file="c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\worker.cpp" line=144 ...} seti_error
-------------------
how you see e = 5
+ e {value=5 file="c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\worker.cpp" line=144 ...} seti_error
if ( (value <= atexit_failure) && (value >= 0) )
value 5 int
+ _First 0x006cf4b8 "Can't open file" const char *
exit ( static_cast< int >( e ) );
+ e {value=5 file="c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\worker.cpp" line=144 ...} seti_error
------------------------------------------------------------------------------------------------------
and now ------> crashs the application thats not a really good solution of this problem
Eine Ausnahme (erste Chance) bei 0x7c812a7b in setiathome_2.3S5B_windows_intelx86.exe: Microsoft C++-Ausnahme: seti_error an Speicherposition 0x0012f158..
Der Thread 'Debug Exception Monitor' (0xd50) hat mit Code -5 (0xfffffffb) geendet.
Der Thread 'Timer' (0x278) hat mit Code -5 (0xfffffffb) geendet.
Das Programm "[3288] setiathome_2.3S5B_windows_intelx86.exe: Systemeigen" wurde mit Code -5 (0xfffffffb) beendet.
-----------------------------------------------------------------------------------------------------------------
questions:
1. why the did the program not open the file ? ( it was the first of the 7 test wu´s ), still the archive bit is set
did I made something wrong in the test with the file ?
2. the error is not well reported, solution should not crash
3. the stderr.txt is cleaned and empty
-----------------------------------------------------------------------------------------------
Merci for your attention, your suggestions are welcome
regards heinz
_heinz:
have some new test lines inserted to handle the error.
else
{
//seti_britta: always exit with 0
e.print();
if ( e == FOPEN_FAILED )
{
fprintf( stderr, "Can´t open file" );
exit( 0 ); <-------- here it come back with 0 now
}
if ( e == READ_FAILED )
{
fprintf( stderr, "Can´t read file" );
exit( 0 );
}
exit ( static_cast< int >( e ) );
}
really interesting, FOPE_FAILED is true, it goes then to fprintf statement, run it, then to exit(0), in assembler code come back with 0 now.
I believe it is a problem with crt
there is the assembly:
--- f:\sp\vctools\crt_bld\self_x86\crt\src\crt0dat.c ---------------------------
0063C2B0 push ebp
0063C2B1 mov ebp,esp
0063C2B3 push 0
0063C2B5 push 0
0063C2B7 mov eax,dword ptr
--- Code: ---
0063C2BA push eax
0063C2BB call doexit (63C520h)
0063C2C0 add esp,0Ch
0063C2C3 pop ebp
0063C2C4 ret
--- End code ---
-------------------------------------------------------------------
Eine Ausnahme (erste Chance) bei 0x7c812a7b in setiathome_2.3S5B_windows_intelx86.exe: Microsoft C++-Ausnahme: seti_error an Speicherposition 0x0012f158..
Der Thread 'Debug Exception Monitor' (0x764) hat mit Code 0 (0x0) geendet.
Der Thread 'Timer' (0x804) hat mit Code 0 (0x0) geendet.
Das Programm "[2336] setiathome_2.3S5B_windows_intelx86.exe: Systemeigen" wurde mit Code 0 (0x0) beendet.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
huuh .... I took the file boinc_lockfile from the test-package into the debug ... is that right ?
thought that the output comes into the stderr.txt , but it is always empty ? ? ?
But I believe that the program cant read file is a other problem...
regards heinz
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version