The test shows that there are problems in seti_parse_wu_header.
--------------------------------
here is the Callers graph
main ---> it goes to worker()
run_stage = POSTINIT;
retval = boinc_init();
if ( !retval ) worker(); <-------
worker.cpp(239): retval = read_wu_state(); <------
read_wu_state() <--------
Calls to 'seti_parse_wu' ----->
worker.cpp(136): retval = seti_parse_wu( f, analysis_state );
Calls to 'seti_parse_wu_header' ----->
seti.cpp(1004): retval = seti_parse_wu_header( f );
before the statement
buffer += buf;
debugger show: --->
+ buf 0x0012edc4 "</workunit_header>
" char [256]
+ 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> >
...... the whole WU is filled in last shows --->
<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>
-----------------------------------------------------------------------------------
after the statement above we can see tha last entry
</workunit_header>
is done now..... so far OK
if ( wu ) delete wu;
wu = new workunit( buffer );
<-------------- here is a problembuffer is filled properly
it starts with --->
<workunit_header>
<name>01mr99ab.14893.2848.703400.3.151</name>
<group_info>
<tape_info>
<name>01mr99ab</name>
<start_time>2451239.5778227</start_time>
....
....
ended with
<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>
-------------------------------------------------------
ok
now we entry the statement
and switch to dbgnew.cpp
55 void *res = _nh_malloc_dbg( cb, 1, nBlockUse, szFileName, nLine );
we see all parameters are properly filled
cb 1544 unsigned int
nBlockUse 1 int
nLine 254 int
res 0x00000000 void *
+ szFileName 0x005db0e8 "..\seti_header.cpp" const char *
now we execute 55
we switch to dbgheap.c
269 void * pvBlk = _nh_malloc_dbg_impl(nSize, nhFlag, nBlockUse, szFileName, nLine, &errno_tmp);
we see all parameter are properly filled
+ &errno_tmp 0x0012ec8c int *
errno_tmp 0 int
nBlockUse 1 int
nLine 254 int
nSize 1544 unsigned int
nhFlag 1 int
pvBlk 0x0012edc5 void *
+ szFileName 0x005db0e8 "..\seti_header.cpp" const char *
now we execute 269
we switch to
239 pvBlk = _heap_alloc_dbg_impl(nSize, nBlockUse, szFileName, nLine, errno_tmp);
all parameters are properly filled
+ errno_tmp 0x0012ec8c int *
nBlockUse 1 int
nLine 254 int
nSize 1544 unsigned int
nhFlag 1 int
pvBlk 0x00000001 void *
+ szFileName 0x005db0e8 "..\seti_header.cpp" const char *
and execute 239
and come back
pvBlk 0x0037ab58 void *
how we can see pvBlk is filled
allocation was sucessful and we came back from dbgnew.cpp
66 return res;
res 0x0037ab58 void *
......
......
......
so we go on and come to xmemory
pointer allocate(size_type _Count)
{ // allocate array of _Count elements
return (_Allocate(_Count, (pointer)0));
debug shows ---->
_Count 7248 unsigned int
we switch to dbgheap
269 void * pvBlk = _nh_malloc_dbg_impl(nSize, nhFlag, nBlockUse, szFileName, nLine, &errno_tmp);
and see parameters are
not properly filled
+ &errno_tmp 0x0012e9a4 int *
errno_tmp 0 int
nBlockUse 1 int
nLine 0 int
nSize 7248 unsigned int
nhFlag 0 int
pvBlk 0x0012ebd4 void *
+ szFileName 0x00000000 <Bad Ptr> const char *
-------------------------
szFileName has bad pointerwe switch to
239 pvBlk = _heap_alloc_dbg_impl(nSize, nBlockUse, szFileName, nLine, errno_tmp);
+ errno_tmp 0x0012e9a4 int *
nBlockUse 1 int
nLine 0 int
nSize 7248 unsigned int
nhFlag 0 int
pvBlk 0x00000000 void *
+ szFileName 0x00000000 <Bad Ptr> const char *
--------------------
and execute
.......
and came back to xmemory
pointer allocate(size_type _Count)
{ // allocate array of _Count elements
return (_Allocate(_Count, (pointer)0));
}
_Count 7248 unsigned int
+ this 0x0012ec74 std::allocator<char> * const
and execute
......
.......
come now to dbgheap.c
429 pHead = (_CrtMemBlockHeader *)_heap_alloc_base(blockSize);
debugger shows --->
blockSize 7284 unsigned int
nSize 7248 unsigned int
+ pHead 0x7c91ee18 {pBlockHeaderNext=0x83ec8b55 pBlockHeaderPrev=0x565308ec szFileName=0x8bfc5557 <Bad Ptr> ...} _CrtMemBlockHeader *
and execute
come now to malloc.c
121 if (__active_heap == __SYSTEM_HEAP) {
122 return HeapAlloc(_crtheap, 0, size ? size : 1);
debug shows --->
__active_heap 1 int
_crtheap 0x00370000 void *
size 7284 unsigned int
and execute
and come back to dbgheap
429 pHead = (_CrtMemBlockHeader *)_heap_alloc_base(blockSize);
debug shows ---->
‡ _heap_alloc_base returned 0x01220048 void *
blockSize 7284 unsigned int
nSize 7248 unsigned int
+ pHead 0x7c91ee18 {pBlockHeaderNext=0x83ec8b55 pBlockHeaderPrev=0x565308ec szFileName=0x8bfc5557 <Bad Ptr> ...} _CrtMemBlockHeader *
------------------
and execute
switch to
239 pvBlk = _heap_alloc_dbg_impl(nSize, nBlockUse, szFileName, nLine, errno_tmp);
debug shows ---->
‡ _heap_alloc_dbg_impl returned 0x01220068 void *
+ errno_tmp 0x0012e884 int *
nBlockUse 1 int
nLine 0 int
nSize 7248 unsigned int
nhFlag 0 int
pvBlk 0x00000000 void *
+ szFileName 0x00000000 <Bad Ptr> const char *
--------------
and execute
come to dbgheap.c
429 pHead = (_CrtMemBlockHeader *)_heap_alloc_base(blockSize);
debug shows ---->
blockSize 7284 unsigned int
nSize 7248 unsigned int
+ pHead 0x00000000 {pBlockHeaderNext=??? pBlockHeaderPrev=??? szFileName=??? ...} _CrtMemBlockHeader *
--------------
and execute
and switch to malloc.c
121 if (__active_heap == __SYSTEM_HEAP) {
122 return HeapAlloc(_crtheap, 0, size ? size : 1);
<------here debug shows --->
__active_heap 1 int
_crtheap 0x00370000 void *
size 7284 unsigned int
and get in 122 ----->
Unhandled exception at 0x7c91eddd in seti_boinc.exe: 0xC0000005: Access violation writing location 0x00030ffc.--------------------------------
wieso da nach 0x00030ffc geschrieben wird ist mir noch unklar
there again the errors:
First-chance exception at 0x7c93a321 in seti_boinc.exe: 0xC00000FD: Stack overflow.
First-chance exception at 0x7c812a7b in seti_boinc.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000337e4..
First-chance exception at 0x7c91eddd in seti_boinc.exe: 0xC0000005: Access violation writing location 0x00030ffc.
Unhandled exception at 0x7c91eddd in seti_boinc.exe: 0xC0000005: Access violation writing location 0x00030ffc.
------------------------------------------------
we look after blockSize
found in dbgheap.c line 421
421 blockSize = sizeof(_CrtMemBlockHeader) + nSize + nNoMansLandSize;
debug shows ----->
nSize = 7248
_CrtMemBlockHeader = {pBlockHeaderNext=??? pBlockHeaderPrev=??? szFileName=??? ...}
blockSize = 7284
nNoMansLandSize ----> can´t find it
--------------------------------------------------
uhhhhhhhhhh.... must search
any suggestions
heinz