the application read now the files init_data.xml and work_unit.sah.
from init_data.xml debug shows ----> in hostinfo
m_nbytes 134217728.00000000 double
and here in apc_ipc.c
void APP_INIT_DATA::copy(const APP_INIT_DATA& a) {
memcpy(this, &a, sizeof(APP_INIT_DATA));
if (a.project_preferences) {
project_preferences = strdup(a.project_preferences); <----here
}
}
project_preferences will not be filled.... hmm ?
----------------------------------
and here in boinc_api.c app_init_data will be filled
int boinc_get_init_data(APP_INIT_DATA& app_init_data) {
app_init_data = aid; <----- here
return 0;
}
how we can see --->
+ app_init_data {major_version=0 minor_version=0 release=0 ...} APP_INIT_DATA &
m_nbytes 134217728.00000000 double
host_info m_nbytes is there obove
------------------------------------------------
boinc_get_init_data( app_init_data );
if ( !nographics_flag
&& (app_init_data.host_info.m_nbytes != 0)
&& (app_init_data.host_info.m_nbytes <= ( double ) (48 * 1024 * 1024)) )
{
#ifdef BOINC_APP_GRAPHICS
fprintf( stderr, "Low memory machine... Disabling graphics.\n" );
fprintf(
stderr,
"%f <= %f\n",
app_init_data.host_info.m_nbytes,
( double ) 48 * 1024 * 1024 );
fflush( stderr );
nographics_flag = 1;
#endif
}
#ifdef BOINC_APP_GRAPHICS
if ( !nographics_flag )
{
run_stage = GRXINIT;
#ifdef DYNAMIC_GRAPHICS
retval = boinc_init_graphics_lib( worker, argv[0] );
#else
retval = boinc_init_graphics( worker );
#endif
run_stage = POSTINIT;
}
else
#endif
{
run_stage = POSTINIT;
retval = boinc_init(); <------ here it should run into
if ( !retval ) worker(); <------ than to worker()
}
---------------------
it goes to boinc_init()
boinc_lockfile will be read
+ filename 0x005d4014 "boinc_lockfile" const char *
it goes now to ----->
retval = boinc_parse_init_data_file();
if (retval) {
standalone = true;
} else {
retval = setup_shared_mem();
if (retval) {
fprintf(stderr, "Can't set up shared mem: %d\n", retval);
standalone = true;
}
}
boinc_init is sucessful done and it go´s to worker()
there it goes to read_wu_state --->
retval = read_wu_state();
the workunit will be assigned
+ this "work_unit.sah" std::basic_string<char,std::char_traits<char>,std::allocator<char> > * const
we open the file work_unit.sah
// Open the file and load the first line
FILE *fp = fopen(virtual_name, "r");
if (!fp) return ERR_FOPEN;
char buf[512];
fgets(buf, 512, fp);
fclose(fp);
--------------------------------------------
read 512 bytes into buf and close the file
+ buf 0x0012f1a0 "<workunit>
" char [512]
+ physical_name "work_unit.sah" std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
now we are in worker opened the file an come to --->
retval = seti_parse_wu( f, analysis_state ); <------- here
fclose( f );
-----------------------
it goes to seti.cpp
int seti_parse_wu( FILE *f, ANALYSIS_STATE &state )
then to -->
retval = seti_parse_wu_header( f );
we come to xstring
bool __CLR_OR_THIS_CALL _Grow(size_type _Newsize,
bool _Trim = false)
{ // ensure buffer is big enough, trim to size if _Trim is true
if (max_size() < _Newsize)
_String_base::_Xlen(); // result too long
if (_Myres < _Newsize)
_Copy(_Newsize, _Mysize); // reallocate to grow
else if (_Trim && _Newsize < _BUF_SIZE)
_Tidy(true, // copy and deallocate if trimming to small string
_Newsize < _Mysize ? _Newsize : _Mysize);
else if (_Newsize == 0)
_Eos(0); // new size is zero, just null terminate
return (0 < _Newsize); // return true only if more work to do
}
new size is zero and it goes back
it goes now to seti_header.cpp ---->
int seti_parse_wu_header( FILE *f )
and there to the loops --->
do
{
fgets( buf, 256, f );
}
while ( !feof( f ) && !xml_match_tag( buf, "<workunit_header" ) );
buffer += buf;
while ( fgets( buf, 256, f ) && !xml_match_tag( buf, "</workunit_header" ) )
{
buffer += buf;
}
buffer += buf;
if ( wu ) delete wu;
wu = new workunit( buffer );
SETI_WU_INFO temp( *wu );
swi = temp;
found = 1;
----------------------------------
we run into the loop to fill the buffer
+ buf 0x0012edc4 "<workunit_header>
" char [256]
+ buffer "" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ f 0x0061f590 {_ptr=0x00379aff " <name>01mr99ab.14893.2848.703400.3.151</name>
<group_info>
<tape_info>
<name>01mr99ab</name>
<start_time>2451239.5778227</start_time>
<last_block_time>2451239.5778227</last_block_time>
<last_block_done>2848</last_block_done>
<missed>0</missed>
<tape_quality>0</tape_quality>
<sb_id>0</sb_id>
</tape_info>
_iobuf *
----------------------------------------------
and fill the buffer till we found "</workunit_header" ---> means end of header
the whole workunit is now read into the buffer --->
<workunit_header>
<name>01mr99ab.14893.2848.703400.3.151
.....
<subband_desc>
<number>151</number>
<center>1418978879.8359</center>
<base>1418974607.375</base>
<sample_rate>9765.625</sample_rate>
</subband_desc>
<sb_id>0</sb_id>
</workunit_header>----------------------------------------------------------------
we come now to --->
if ( wu ) delete wu;
wu = new workunit( buffer );
-----------
it goes to dbgnew.cpp --->allocate memory block
in it it swiches to dbg_heap.cpp
and there to ---> _nh_malloc_dbg_impl
extern "C" void * __cdecl _nh_malloc_dbg (
size_t nSize,
int nhFlag,
int nBlockUse,
const char * szFileName,
int nLine
)
{
int errno_tmp = 0;
void * pvBlk = _nh_malloc_dbg_impl(nSize, nhFlag, nBlockUse, szFileName, nLine, &errno_tmp); <--here
if ( pvBlk == NULL && errno_tmp != 0 && _errno())
{
errno = errno_tmp; // recall, #define errno *_errno()
}
return pvBlk;
----------------------------------
and there we do the allocation
for (;
{
/* do the allocation
*/
pvBlk = _heap_alloc_dbg_impl(nSize, nBlockUse, szFileName, nLine, errno_tmp);
if (pvBlk)
{
return pvBlk;
}
if (nhFlag == 0)
{
*errno_tmp = ENOMEM;
return pvBlk;
}
/* call installed new handler */
if (!_callnewh(nSize))
{
*errno_tmp = ENOMEM;
return NULL;
}
/* new handler was successful -- try to allocate again */
}
-----------------
we make the allocation and come back with
void *res = _nh_malloc_dbg( cb, 1, nBlockUse, szFileName, nLine );
res 0x0037ab20 void *
----------------------------------------
then back to seti_header.cpp
wu = new workunit( buffer ); <------ here
SETI_WU_INFO temp( *wu );
swi = temp;
found = 1;
--------------------
debugger shows --->
‡ operator new returned 0x0037ab20 void *
+ buffer "<workunit_header>
<name>01mr99ab.14893.2848.703400.3.151</name>
<group_info>
<tape_info>
<name>01mr99ab</name>
<start_time>2451239.5778227</start_time>
<last_block_time>2451239.5778227</last_block_time>
<last_block_done>2848</last_block_done>
<missed>0</missed>
<tape_quality>0</tape_quality>
<sb_id>0</sb_id>
</tape_info>
<nam std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ wu 0x00000000 {id=??? name=0x00000010 <Bad Ptr> group_info={...} ...} workunit_header *
+ db_table<workunit_header> {table_name=0x005d7014 "workunit_header" me=??? _search_tag=0x005d7014 "workunit_header" ...} db_table<workunit_header>
id
CXX0030: Error: expression cannot be evaluated + name 0x00000010 <Bad Ptr> char [64]
+ group_info {r={...} id=??? } db_reference<workunit_grp,long>
+ subband_desc {number=??? center=??? base=??? ...} subband_description_t
sb_id
CXX0030: Error: expression cannot be evaluated------------------
and in it db_table looks not so well prepared I think- db_table<workunit_header> {table_name=0x005d7014 "workunit_header" me=??? _search_tag=0x005d7014 "workunit_header" ...} db_table<workunit_header>
track_mem<workunit_header> {...} track_mem<workunit_header>
+ table_name 0x005d7014 "workunit_header" char * const
me
CXX0030: Error: expression cannot be evaluated + _search_tag 0x005d7014 "workunit_header" char *
_nfields 5 int
+ column_names 0x005d7914 char * const * const db_table<class workunit_header>::column_names char * const [5]
cursor
CXX0030: Error: expression cannot be evaluated--------------------------------------------
we come to dbgheap.c --->
RTCCALLBACK(_RTC_FuncCheckSet_hook,(0));
pHead = (_CrtMemBlockHeader *)_heap_alloc_base(blockSize); <---- here
and call the function
--------------------------
blockSize 7284 unsigned int
nSize 7248 unsigned int
+ pHead 0x00000000 {pBlockHeaderNext=??? pBlockHeaderPrev=??? szFileName=??? ...} _CrtMemBlockHeader *
-----------------
I believe _CrtMemBlockHeader * has in szFileName a bad value
----------------------
it goes to malloc.c ---->
if (__active_heap == __SYSTEM_HEAP) {
return HeapAlloc(_crtheap, 0, size ? size : 1);
----------------
__active_heap 1 int
_crtheap 0x00370000 void *
size 7284 unsigned int
and HeapAlloc is called --->
it runs through it more than 100 always with the values obove.... then it crashes
all this is in seti_parse_wu
suddenly we get a eror --->
Unhandled exception at 0x7c91eddd in seti_boinc.exe: 0xC0000005: Access violation writing location 0x00030ffc.
in stderr.txt we find ----> Can't set up shared mem: -1
------------------------------------
searching now
any suggestions ? ?