Forum > Windows

optimized sources

<< < (26/179) > >>

_heinz:
though about this error

if we enter analyseFuncs the first to do is --->Allocate data array and work area arrays.

here are the importend statements:
int seti_analyze( ANALYSIS_STATE &state )
 ......
    NumDataPoints = state.npoints; //seti_britta: problem, npoints has no init value ?
struct ANALYSIS_STATE
    {
    sah_complex *data;
    sah_complex *savedWUData;   // Save the original WU data
    int         npoints;
    int         icfft;
    int         PoT_freq_bin;   // where we are in PoT analysis for this icfft

    // ... will be -1 if no PoT analysis in progress
    int         PoT_activity;
    int         doing_pulse;
    double      FLOP_counter;
    };
.......
    PowerSpectrum = ( float * ) MEM.calloc( "PowerSpectrum", NumDataPoints, sizeof(float) );
.......
we go now to MEM.calloc ---->
      void *calloc( const char *name, size_t size, size_t nitems, size_t alignment = MEM_ALIGN)
         {
         void *ptr = calloc_a( size, nitems, alignment );
         if ( ptr == NULL ) SETIERROR( MALLOC_FAILED, report( name ) );
//         fprintf(stderr, "(%1.1fK) %s \n", size*nitems/1024.0, name);
         return ptr;
         };
-----------------------------------------------------
maybe nitems has no or a wrong value
-----------------------------------------------------
if NumDataPoints has no value, calloc fails and how you can see there is no opcode written  to prevent this, so we get a errormassage from the system like this ---->Can't set up shared mem: -1, Unhandled Exception Detected...
----------------------------------------------------------
it looks like this is the error, we will see if this will be confirm.......
 ;)

_heinz:

--- Quote from: seti_britta on 06 Jun 2007, 11:00:30 am ---
it looks like this is the error, we will see if this will be confirm.......
 ;)

--- End quote ---
it is necessary to have a look at main.cpp and seti.cpp where wrote_header writes values into the structure ANALYSIS_STATE  ;)

_heinz:
the critical problem is in malloc_a.h
there are 2 variables undefined ---> nitems, alignment
-------------------------------------------------------------------------------
68      void *calloc( const char *name, size_t size, size_t nitems, size_t alignment = MEM_ALIGN)
69      {
70         void *ptr = calloc_a( size, nitems, alignment );
71         if ( ptr == NULL ) SETIERROR( MALLOC_FAILED, report( name ) );
72//         fprintf(stderr, "(%1.1fK) %s \n", size*nitems/1024.0, name);
73         return ptr;
74         };

81      void __fastcall free( void * ptr )   { __OUR_FREE( ptr ); };

------------------------------------------------------------------------------------------------------------------
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(68) : warning C4002: Zu viele übergebene Parameter für das Makro 'calloc'
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(68) : error C2059: Syntaxfehler: 'Konstante'
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(81) : error C2059: Syntaxfehler: 'Konstante'
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(70) : error C2065: 'nitems': nichtdeklarierter Bezeichner
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(70) : error C2065: 'alignment': nichtdeklarierter Bezeichner
------------------------------------------------------------------------------------------------------------------------------------------------------------------
that´s the reason why the application crashes on the first call of calloc 
and this happen in main.cpp in the first lines --->

int main( int argc, char **argv )
    {
    int retval = 0, i;
    FORCE_FRAME_POINTER;
    run_stage = PREGRX;
    g_argc = argc;

    if ( !(g_argv = ( char ** ) calloc( argc + 2, sizeof(char *) )) )
        {
        exit( MALLOC_FAILED );
        }
----------------------------------------------------------------------------------------------------------------------------------
seti_britta ~heinz   ;)

_heinz:
quote
c:\i\sc\seti\seti_boinc_2k3_2.2b-ben-joe\client\malloc_a.h(68) : warning C4002: Zu viele übergebene Parameter für das Makro 'calloc'
--------------------------
calloc braucht genau 2 Parameter beim Aufruf
calloc(anzahl_der_elemente, groesse_der_elemente)
-------------------------------------------------------------------------------

next problem is the multideclaration of FORCE_FRAME_POINTER;
as you can see it is declared in s_util.h, line 133 and in seti.h line 144
and there are no cunstruct in the headerfiles to prevent this.
for instance:
#ifndef FORCE_FRAME_POINTER
#define FORCE_FRAME_POINTER
#endif
----------------------------------------------------------------
zur Erinnerung: ich habe es schon einmal in #36 gesagt --->
-----------------------------------------------------------------
Hauptsächliche Probleme im Projekt sind:
1. Migrationsprobleme -->siehe http://msdn2.microsoft.com/de-de/library/ms235289(VS.80).aspx
2. varalteter Deklarationsstil
3. Typkonvertierungen
4. Konvertierungen bei Parameterübernahme und Rückgabe in Funktionen.
5. Parameter in Makrodefinitionen
6. Benutzung nicht definierter Variablen
7. Multideclarationen (Mehrdeutigkeit)

um mal einige zu nennen

------------------------------------------------------------------
die Fehler in 4. und 5. sind oft schwierig zu finden, weil hier meist keine Typüberprüfung durch den Compiler durchgeführt wird. Dafür ist allein der Programmierer verantwortlich.
Das erklärt auch die Tatsache dass ein fehlerfrei compiliertes  Programm ,wie in unserem Fall geschehen, bei der Ausführung abstürzt .

seti_britta ~heinz  ;)

Josef W. Segur:

--- Quote from: seti_britta on 07 Jun 2007, 02:43:17 pm ---...
next problem is the multideclaration of FORCE_FRAME_POINTER;
as you can see it is declared in s_util.h, line 133 and in seti.h line 144
and there are no cunstruct in the headerfiles to prevent this.
for instance:
#ifndef FORCE_FRAME_POINTER
#define FORCE_FRAME_POINTER
#endif
...
--- End quote ---

That seems to have crept into our sources before 2.0, I suggest changing to what the cvs sources now have; no define in seti.h and the following in s_util.h :


--- Code: ---// The MS & intel compilers don't allow alloca in try/catch blocks
#ifndef FORCE_FRAME_POINTER
#if ( defined(HAVE_ALLOCA) || defined(_WIN32) ) && !( defined(__INTEL_COMPILER) || defined (_MSC_VER) )
#define FORCE_FRAME_POINTER alloca(16)
#else
#define FORCE_FRAME_POINTER (0)
#endif
#endif
--- End code ---

Note: Crunch3r identified the error with Intel compiler, and the changes were made after that. But the 5.15 code from which ours has evolved was before.
                                                                                        Joe

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version