+- +-
Say hello if visiting :) by Gecko
11 Jan 2023, 07:43:05 pm

Seti is down again by Mike
09 Aug 2017, 10:02:44 am

Some considerations regarding OpenCL MultiBeam app tuning from algorithm view by Raistmer
11 Dec 2016, 06:30:56 am

Loading APU to the limit: performance considerations by Mike
05 Nov 2016, 06:49:26 am

Better sleep on Windows - new round by Raistmer
26 Aug 2016, 02:02:31 pm

Author Topic: optimized sources  (Read 548492 times)

Offline Josef W. Segur

  • Janitor o' the Board
  • Knight who says 'Ni!'
  • *****
  • Posts: 3112
Re: optimized sources
« Reply #165 on: 24 Jun 2007, 09:04:05 pm »
Heinz,

When I used MS VC++ 4.0 heavily a few years ago, running a debug version of a program from the IDE had similar problems finding files. It turned out to be that the working directory was not where the program was (in Debug), but the directory above that where the source code was. I never figured out why MS had done it that way, just learned to put the files I wanted the program to access up one level. If they are still doing that it may account for the troubles you are having.
                                                                                    Joe

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #166 on: 25 Jun 2007, 08:27:34 am »
Thank you Joe for this important hint, will try it
Merci Heinz

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #167 on: 26 Jun 2007, 06:32:16 pm »
Hi Crunchr please tell me where in the Ide I must put the commandline and its parameter exactly.
set_boinc.exe -bench -show_benchmark

----------------------------------------------------------------
I did it in Projektmappenexplorer --->seti_boinc -->Eigenschaften --->Konfigurationseigenschaften --->Debuggen --->Befehl --->
C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe -bench -show_benchmark

Pfad + exe + parameter  all in a line

Das Programm wird aufgerufen aber keine Parameter erkannt, dann wird immer work_unit.sah nicht gefunden, bekomme niemals eine filepointer zurück, ---> undefiniertes Programmende

Wahrscheinlich mach ich grundsät5zlich was falsch  :'(

Offline Simon

  • Ni!
  • Knight who says 'Ni!'
  • *****
  • Posts: 1045
    • Is it a bird? Is it a plane? No...its-the.net!
Re: optimized sources
« Reply #168 on: 26 Jun 2007, 06:52:34 pm »
Joe's hint about moving it to the directory above did not work?

Did you try moving all necessary files to a different directory altogether, or will debugging from inside VS not work otherwise? (probably not)

Regards,
Simon.

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #169 on: 26 Jun 2007, 08:02:33 pm »
have the files in all  debug, Release32-NOGFX, and winbuild.
debugging works...but no parameters will be known



Offline Simon

  • Ni!
  • Knight who says 'Ni!'
  • *****
  • Posts: 1045
    • Is it a bird? Is it a plane? No...its-the.net!
Re: optimized sources
« Reply #170 on: 27 Jun 2007, 02:11:24 pm »
Heinz, sounds like you need some quotes for the debug command.

Quote
I did it in Projektmappenexplorer --->seti_boinc -->Eigenschaften --->Konfigurationseigenschaften --->Debuggen --->Befehl --->
C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe -bench -show_benchmark

should be:

"C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe -bench -show_benchmark"
instead.

Since it does recognize the command and seems to be able to find the files, this is the most logical explanation.

If the above does not work, I recommend something even simpler: write a batch file with the commandline options, and put that as debug command.

HTH,
Simon.
« Last Edit: 27 Jun 2007, 02:13:41 pm by Simon »

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #171 on: 27 Jun 2007, 04:48:51 pm »
Hi Simon,
thanks for your proposals
-----------------------------------------
Let´s document what happen:
variant_1 Befehl: "C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe -bench -show_benchmark"

The code:
int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode )
    {
    LPSTR   command_line;
    char    *argv[100];
    int     argc, retval;    <----both are not initialized(undefined value)

    command_line = GetCommandLine();    <---here
    argc = parse_command_line( command_line, argv );
    retval = main( argc, argv );

    return retval;
-------------------------------------------------------------------------
from debug:
-      command_line   0x00151ee0 ""C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe" "   char *
how we can see no parameter will be assigned

 ---------------------------------------
variant_2: without quotes
Befehl: C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe -bench -show_benchmark

 +      command_line   0x00151ee0 ""C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe" "   char *
----------------------------------------------------------------------------------------------------------------------------------------
no parameter will be assigned
interesting the qouots, I marked red
----------------------------------------------------------------------------------------------
variant_3
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"
+      command_line   0x00151ee0 ""C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe" "   char *
-------------------------------------------------------
no argument is assigned
and in all variants argc and retval have undefined values
------------------------------------variant_4
code:
int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode )
    {
    LPSTR   command_line;
    char    *argv[100];
    int     argc, retval;
    argc=retval = 0;  <---new
    command_line = GetCommandLine();       <----------------
    argc = parse_command_line( command_line, argv );
    retval = main( argc, argv );

    return retval;
    }
-------------------------------------------------
-      command_line   0x00151ee0 ""C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build\Debug\setiathome_2.3S5B_windows_intelx86.exe" "   char *
-----------------------------------------------------
think "GetCommandLine(); did not work right.........
will search why

heinz

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #172 on: 27 Jun 2007, 05:25:25 pm »
I should read documentation  :)

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #173 on: 28 Jun 2007, 06:03:55 pm »
found the following instruction set   ---->

Befehl (Lokaler Windows-Debugger)
Gibt den Startbefehl für das auf dem lokalen Computer zu debuggende Programm an.

Befehlsargumente (Lokaler Windows-Debugger und Remote-Windows-Debugger)
Gibt Argumente für den oben aufgeführten Befehl an.

In diesem Feld können die folgenden Umleitungsoperatoren verwendet werden:

< file
Liest "stdin" aus Datei.

> file
Schreibt "stdout" in Datei.

>> file
Fügt "stdout" an Datei an.

2> file
Schreibt "stderr" in Datei.

2>> file
Fügt "stderr" an Datei an.

2> &1
Sendet "stderr (2)"-Ausgaben an denselben Speicherort wie "stdout (1)".

1> &2
Sendet "stdout (1)"-Ausgaben an denselben Speicherort wie "stderr (2)".

In den meisten Fällen sind diese Operatoren nur auf Konsolenanwendungen anwendbar.
------------------------
Arbeitsverzeichnis
Gibt das Arbeitsverzeichnis des zu debuggenden Programms relativ zum Projektverzeichnis mit der EXE-Datei an. Wenn Sie kein Arbeitsverzeichnis festlegen, wird das Projektverzeichnis verwendet. Beim Remotedebuggen befindet sich das Projektverzeichnis auf dem Remoteserver.
----------------------------
Projektverzeichnis ist das Verzeichnis in dem sich die .sln Datei befindet. In unserem Fall seti_boinc.sln im Verzeichnis winbuild
C:\I\SC\seti\seti_boinc_2k3_2.2B-Ben-Joe\client\win_build
heisst die Dateien boinc_lockfile, stderr.txt, work_unit.sah müssen in dieses Verzeichnis kopiert werden.
Das ist bei mir auch so.
-------------------------------
Hätten wir das also auch geklärt.

heinz


Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #174 on: 30 Jun 2007, 09:22:54 am »
reading documentation
1. int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode )   :o
2. command_line = GetCommandLine();  ::)

zu 1. found this --->http://msdn.microsoft.com/library/deu/default.asp?url=/library/DEU/vccore/html/_core_revising_the_winmain_function.asp
zu 2. found this --->http://msdn2.microsoft.com/en-us/library/ms683156.aspx

It looks like there is still something to do
be patient... work is going on
heinz

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #175 on: 03 Jul 2007, 05:57:27 pm »
made some short sample programs.... now I´m testing the application and debug....
heinz

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #176 on: 04 Jul 2007, 10:03:44 pm »
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 --->
&#135;      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 ? ?

Offline Urs Echternacht

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 4121
  • ++
Re: optimized sources
« Reply #177 on: 06 Jul 2007, 06:33:30 pm »
No translation necessary.
(Vorweg: Bei meinen zweisprachigen Kommentaren beachte bitte nur die in Deutsch, da ich die in Englisch nur zur Verständnis für alle hier eingefügt habe.)
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
...
-----------------
we make the allocation and come back with
    void *res = _nh_malloc_dbg( cb, 1, nBlockUse, szFileName, nLine );

      res   0x0037ab20   void *
----------------------------------------
0x0037ab20 seems to be the end of space for the heap. Which values do go into the _nh_malloc_dbg(...) ?
(Soweit reicht wohl der Speicherbereich, den der Heap später belegen darf. Welche Werte führen den in _nh_malloc_dbg(...) zu diesem Ergebnis ?)
Quote
then back to seti_header.cpp
...
+      subband_desc   {number=??? center=??? base=??? ...}   subband_description_t
      sb_id   CXX0030: Error: expression cannot be evaluated
------------------
The missing values seem to be filled in by templates, so this could be a debugger problem.
(Da die fehlenden Werte in Templates eingesetzt werden sollen, kann es sein, daß der Debugger Probleme hat, zu erkennen, was da drin stehen soll.)
Quote
...
--------------------------------------------
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 <----- Ist das ein Tippfehler (siehe weiter unten) ?
+      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
So, the memory for the heap starts at 0x00370000 and ends at 0x0037ab19. The rights to write at that memoryarea are given. But how does that calculate to 7284 times space for unsigned int's (debug: 1+4+1) ?
(Das ist also der Speicherbereich, der für den Heap reserviert ist. Nur in diesem Speicherbereich haben wir die Schreibrechte. Aber wie passt das ganze mit den 7284 vorzeichenlosen Integer-Werten zusammen die da drauf passen sollen ? Hast Du mal nachgerechnet, ob das in der Regel und im Extremfall hinkommt ?)
Quote
   
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 ? ?
I give it a try, but i don't know if that helps much.
(Ich habs versucht, weiss aber leider nicht, ob Dir das viel hilft.)

Try to reproduce the error with the debugger. If that is possible, take a look at the dissassembly in the debugger. Check what commands were called before the error( at 0x7c91eddd ) happened. Try to go back to the last command called inside seti-code. Indentify what variables and calls are included and which one gets/produces the wrong write command.
(Versuche mal mit dem Disassembly des Debuggers "näher" an den Fehler heranzukommen. Identifiziere einmal welcher Befehl im Seti-Code zu dieser Fehlermeldung geführt hat. Welche Variablen sind genau beteiligt und führen zu dieser Zugriffsverletzung?)

No translation !
(Na, toll ausgerechnet mein "Lieblingsfehler": 0xC0000005.  >:(   (Den hab ich "gefressen" !) )
_\|/_
U r s

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #178 on: 10 Jul 2007, 06:53:13 pm »
Merci Urs,
compiled the whole application new, will see if there are any differences. will post tomorrow more about it.

     blockSize   7284   unsigned int
      nSize   7248   unsigned int <----- Ist das ein Tippfehler (siehe weiter unten) ?

nein kein tippfehler
-----------------------
get a stack overflow....

regards heinz

Offline _heinz

  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 2117
Re: optimized sources
« Reply #179 on: 11 Jul 2007, 05:38:31 pm »
if I compile I get 2 warings, as you can see in 'xml_match_tag' and 'xml_find_tag'
maybe this make the trouble.....
Code wird generiert...
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\db\xml_util.cpp(663) : warning C4717: 'xml_match_tag': Rekursiv für alle Steuerelementpfade. Die Funktion verursacht einen Stapelüberlauf zur Laufzeit.
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\db\xml_util.cpp(689) : warning C4717: 'xml_find_tag': Rekursiv für alle Steuerelementpfade. Die Funktion verursacht einen Stapelüberlauf zur Laufzeit.
Kompilieren...
------------------------------------------------------------------------------------------------------------------------
and here is the code ---->
// return true if the tag appears in the line
//
bool xml_match_tag(char* buf,  char* tag) {
    char tmp_tag[BUFSIZ]={'<',0};
    if (strlen(buf)==0) return false;
    if (tag[0] == '<') {
      strlcpy(tmp_tag,tag,BUFSIZ);
    } else {
      strlcat(tmp_tag,tag,BUFSIZ);
    }
    char *p=tmp_tag+strlen(tmp_tag);
    do {
      *(p--)=0;
    } while (isxmldelim(*p));
    while ((buf=strstr(buf,tmp_tag))) {
      if (isxmldelim(buf[strlen(tmp_tag)])) return true;
      buf++;
    }
    return false;
}


bool xml_match_tag(const std::string &s, char* tag)
{
   return xml_match_tag(s.c_str(),tag);
663 }    <----- here

size_t xml_find_tag( char* buf, char* tag) {
//       const char *buf0=buf; // OK
    char *buf0=buf;
    char tmp_tag[BUFSIZ]={'<',0};
    if (tag[0] == '<') {
      strlcpy(tmp_tag,tag,BUFSIZ);
    } else {
      strlcat(tmp_tag,tag,BUFSIZ);
    }
    char *p=tmp_tag+strlen(tmp_tag);
    do {
      *(p--)=0;
    } while (isxmldelim(*p));
    while ((buf=strstr(buf,tmp_tag))) {
      if (isxmldelim(buf[strlen(tmp_tag)])) return buf-buf0;
      buf++;
    }
    return strlen(buf0);
}

std::string::size_type xml_find_tag(const std::string &s, char* tag)
{
   std::string::size_type p=xml_find_tag(s.c_str(),tag);
   return (p!=strlen(s.c_str()))?p:(std::string::npos);
689 }      <------- here
----------------------------------------------------------------------------------------------------------
have anybody of you a idea to prevent this
your suggestions are welcome....
regards heinz

 

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?
Members
Total Members: 97
Latest: ToeBee
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 59559
Total Topics: 1672
Most Online Today: 40
Most Online Ever: 983
(20 Jan 2020, 03:17:55 pm)
Users Online
Members: 0
Guests: 27
Total: 27
Powered by EzPortal