IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 C Discussion :

SIGTRAP sur free


Sujet :

C

  1. #1
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut SIGTRAP sur free
    Bonjour,

    J'ai un SIGTRAP lors d'un appel de la fonction free mais je ne comprends pas pourquoi.
    L'erreur se produit dans la fonction csv_deallocate(p) -> destroy_1D_c(p->raw); -> free(p)
    Normalement j'ai ajouté les fonctions nécessaires.

    Merci d'avance pour vos lumières !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    int main(int argc, char *argv[], char* env[])
    {
        logger_on();
    
        t_csv *p = csv_allocate("D:\\fichier.csv");
        csv_deallocate(p);
    
        logger_off();
        logger_read();
        return 0;
    }
    
    void csv_deallocate(t_csv * p)
    {
        if(p)
        {
            if (p->raw)
                destroy_1D_c(p->raw);
    
            if (p->array)
                destroy_3D_c(p->array);
    
            free(p);
        }
    }
    
    void destroy_1D_c( t_1Dc *s)
    {
        if (s)
        {
            if (s->da)
                deallocate_1D_c(s->da);
    
            free(s);
        }
        s=NULL;
    }
    
    void deallocate_1D_c( char *p )
    {
        if (p)
        {
            free(p); /// SIGTRAP ICI ///
            p=NULL;
        }
        else fprintf(logger,"deallocate.h::deallocate_1D_c -> %s\n",strerror(errno));
    }
    
    t_csv *csv_allocate_empty()
    {
        t_csv *p = NULL;
        if ( !(p = (t_csv*)malloc(sizeof(t_csv))) ) /// T1
            fprintf(logger, "csv.h::csv_allocate_empty.T1 -> The function has returned a NULL pointer\n");
    
        return p;
    }
    
    t_csv *csv_allocate( const char *path )
    {
        t_csv *p = NULL;
        if ( (p = csv_allocate_empty()) ) ///T0
         {
            if ( path ) ///T1
            {
                if ( (p->path = str_copy(path)) ) ///T2
                {
                    if ( (p->raw = create_empty_1D_c()) ) ///T3
                    {
                        if ( (p->raw->da = file_to_string(path)) ) ///T4
                        {
                            p->raw->x = str_length(p->raw->da);
                            p->line   = csv_get_line( p );
                            p->row    = csv_get_row ( p );
                            if ( p->line != 0 && p->row != 0 ) ///T5
                            {
                                if ( (p->array = create_3D_c( p->line, p->row, 1000 )) ) ///T6
                                    p->array = csv_format(p);
    
                                else
                                {
                                    destroy_1D_c(p->raw);
                                    deallocate_1D_c(p->path);
                                    free(p);
                                    fprintf(logger, "csv.h::csv_allocate.T6 -> Memory allocation of the t_3Dc structure's Array member has failed\n");
                                }
                            }
                            else
                            {
                                destroy_1D_c(p->raw);
                                deallocate_1D_c(p->path);
                                free(p);
                                fprintf(logger, "csv.h::csv_allocate.T5 -> Lines and/or rows quantity are equals to 0\n");
                            }
                        }
                        else
                        {
                            deallocate_1D_c(p->path);
                            free(p);
                            fprintf(logger, "csv.h::csv_allocate.T4 -> Memory allocation of the t_1Dc structure's Array member has failed\n");
                        }
                    }
                    else
                    {
                        deallocate_1D_c(p->path);
                        free(p);
                        fprintf(logger, "csv.h::csv_allocate.T3 -> Memory allocation of the t_1Dc structure's Array member has failed\n");
                    }
                }
                else fprintf(logger, "csv.h::csv_allocate.T2 -> The function str_copy has returned a NULL pointer\n");
            }
            else fprintf(logger, "csv.h::csv_allocate.T1 -> The CSV file path's pointer is NULL\n");
        }
        else fprintf(logger, "csv.h::csv_allocate.T0 -> p is NULL\n");
        return p;
    }
    
    
    t_3Dc *csv_format( t_csv *p )
    {
        t_3Dc *p_out = NULL;
        if ( p ) ///T0
        {
            if ( p->raw->da ) ///T1
            {
                if ( (p_out = create_3D_c(p->line, p->row, 1000)) ) ///T2
                {
                    t_uint64 i, i_tmp, line, row;
                    i_tmp = 0;
                    line  = 0;
                    row   = 0;
    
                    for( i=0 ; i < p->raw->x ; i++ )
                    {
                        if ( p->raw->da[i] == ';' )
                            i_tmp = 0, row++;
    
                        else if ( (p->raw->da[i] == '\n') )
                            i_tmp = 0, line++, row = 0;
    
                        else
                        {
                            if ( line >= p->line || row >= p->row || i_tmp >= 1000 )
                                printf("\n Possible SIGSEV signal while translating data to the 3D array\n line = %I64u ; current is %I64u\n line = %I64u ; current is %I64u\n row = %I64u ; current is %I64u\n i_tmp = %I64u ; current is %I64u", line , p->line, row, p->row, i_tmp, (t_uint64)1000 );
    
                            else
                            {
                                if (p->raw->da[i] != '\r')
                                    p_out->da[line][row][i_tmp] = p->raw->da[i], i_tmp++;
                            }
                        }
                    }
                }
                else fprintf(logger, "csv.h::csv_format.T2 -> The memory allocation of the csv array's pointer is NULL\n");
            }
            else fprintf(logger, "csv.h::csv_format.T1 -> The raw csv file's pointer is NULL\n");
        }
        else fprintf(logger, "csv.h::csv_format.T0 -> The t_csv structure's pointer is NULL\n");
        return p_out;
    }
    
    t_uint64 csv_get_line( t_csv *p )
    {
        t_uint64 line = 0;
        if( p ) ///T1
        {
            if ( p->raw->da ) ///T2
                line = str_count_occurrence( p->raw->da, '\n' );
    
            else fprintf(logger, "csv.h::csv_get_line.T2 -> The char's pointer is NULL\n");
        }
        else fprintf(logger, "csv.h::csv_get_line.T1 -> The t_csv structure's pointer is NULL\n");
        return line;
    }
    
    t_uint64 csv_get_row( t_csv *p )
    {
        t_uint64 max = 0;
        t_uint64 row = 0;
        if( p )
        {
            if ( p->raw )
            {
                t_uint64 i;
                for ( i=0 ; i<p->raw->x ; i++ )
                {
                    if ( p->raw->da[i] == '\n' )
                    {
                        if (row>max)
                            max=row;
    
                        row = 0;
                    }
    
                    if ( p->raw->da[i] == ';' )
                        row+=1;
                }
            }
            else fprintf(logger, "csv.h::csv_get_row -> da t_2Dc structure's member is NULL\n");
        }
        else fprintf(logger, "csv.h::csv_get_row -> t_csv structure is NULL\n");
        return max+1;
    }
    
    
    }
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

  2. #2
    Modérateur
    Avatar de dinobogan
    Homme Profil pro
    ingénieur
    Inscrit en
    Juin 2007
    Messages
    4 073
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France

    Informations professionnelles :
    Activité : ingénieur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 4 073
    Points : 7 163
    Points
    7 163
    Par défaut
    Je n'ai pas de solution pour ton problème initial.
    Par contre il y a un truc qui m'a piqué les yeux : ta fonction d'écriture de log.
    Au lieu d'écrire ça : fprintf(logger, "csv.h::csv_allocate_empty.T1 -> The function has returned a NULL pointer\n");Tu pourrais automatiser l'écriture du nom de fichier, de fonction et de numéro de ligne avec une idée du genre :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    #define MON_LOG( msg, ar... ) { fprintf( logger, "%s::%s.%d -> " msg, __FILE__, __FUNCTION__, __LINE__, ##ar ); fprintf( logger, "\n" ); }
    ...
    MON_LOG( "The function has returned a NULL pointer" );
    ...
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java
    Que la force de la puissance soit avec le courage de ta sagesse.

  3. #3
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut
    Trop de paramètres variables pour m'amuser à faire ça. Il va m'en falloir des macros en fonction du nombres et des types d'arguments. Ou bien si c'est faisable, je ne sais pas comment faire et je ne me suis pas intéréssé à ce problème. Pour le moment, ce n'est pas ma priorité.
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

  4. #4
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 860
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 860
    Points : 219 064
    Points
    219 064
    Billets dans le blog
    120
    Par défaut
    Bonjour,

    J'utiliserai Valgrind/Dr Memory, car le SIGTRAP sur free() est surement lié aux protections et vérification de corruption de la mémoire.
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  5. #5
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut
    Citation Envoyé par LittleWhite Voir le message
    Bonjour,

    J'utiliserai Valgrind/Dr Memory, car le SIGTRAP sur free() est surement lié aux protections et vérification de corruption de la mémoire.
    Très très bon le DrMemory, je ne connaissais pas et c'est vrai que le problème de vlagring c'est que sous daub.....

    Du coup, j'ai un rapport :
    Désolé de lacher ça comme ça mais j'avoue que je suis perplexe là.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    Dr. Memory version 1.8.0 build 8 built on Sep  9 2014 16:27:02
    Dr. Memory results for pid 6260: "LIBRARY.exe"
    Application cmdline: ""C:\Users\XXX\Desktop\Code source\bin\Debug\LIBRARY.exe""
    Recorded 108 suppression(s) from default C:\Program Files (x86)\Dr. Memory\bin\suppress-default.txt
     
    Error #1: UNINITIALIZED READ: reading register eax
    # 0 <not in a module>   (0x0036011b)
    # 1 KERNEL32.dll!BaseThreadInitThunk +0x11     (0x7684336a <KERNEL32.dll+0x1336a>)
    Note: @0:00:00.598 in thread 8096
    Note: instruction: cmp    %eax $0x00000102
     
    Error #2: UNINITIALIZED READ: reading register ebp
    # 0 <not in a module>   (0x0036012c)
    # 1 KERNEL32.dll!BaseThreadInitThunk +0x11     (0x7684336a <KERNEL32.dll+0x1336a>)
    Note: @0:00:00.599 in thread 8096
    Note: instruction: mov    0x08(%ebp) -> %ecx
     
    Error #3: UNINITIALIZED READ: reading 0x00b4ff5c-0x00b4ff60 4 byte(s) within 0x00b4ff5c-0x00b4ff60
    # 0 system call NtQueryInformationThread parameter value #2
    # 1 KERNEL32.dll!BaseThreadInitThunk                                     +0x11     (0x7684336a <KERNEL32.dll+0x1336a>)
    Note: @0:00:00.599 in thread 8096
     
    Error #4: UNADDRESSABLE ACCESS beyond heap bounds: writing 0x00625d2d-0x00625d2e 1 byte(s)
    # 0 file_to_string                            [C:/Users/lt008176/Desktop/Code source/file.c:486]
    # 1 csv_allocate                              [C:/Users/lt008176/Desktop/Code source/csv.c:52]
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:02.227 in thread 6956
    Note: instruction: mov    $0x00 -> (%ebx,%edi,1)
     
    Error #5: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x00625d2d-0x00625d2e 1 byte(s)
    # 0 str_length                                [C:/Users/lt008176/Desktop/Code source/str.c:18]
    # 1 csv_allocate                              [C:/Users/lt008176/Desktop/Code source/csv.c:54]
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:02.284 in thread 6956
    Note: instruction: cmp    (%ecx) $0x00
     
    Error #6: UNADDRESSABLE ACCESS beyond heap bounds: reading 0x00625d2d-0x00625d2e 1 byte(s)
    # 0 str_count_occurrence                      [C:/Users/lt008176/Desktop/Code source/str.c:30]
    # 1 csv_get_line                              [C:/Users/lt008176/Desktop/Code source/csv.c:152]
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:02.291 in thread 6956
    Note: instruction: movzx  (%ecx) -> %ebx
     
    Error #7: UNINITIALIZED READ: reading register eax
    # 0 UMEngx86.dll!?                           +0x0      (0x74014266 <UMEngx86.dll+0x4266>)
    # 1 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 2 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 3 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 4 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 5 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 6 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    # 7 __mingw_CRTStartup
    # 8 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.307 in thread 6956
    Note: instruction: movzx  0x04(%eax) -> %ecx
     
    Error #8: UNINITIALIZED READ: reading register edx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014271 <UMEngx86.dll+0x4271>)
    # 1 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 2 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 3 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 4 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 5 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 6 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    # 7 __mingw_CRTStartup
    # 8 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.312 in thread 6956
    Note: instruction: mov    0x14(%edx) -> %eax
     
    Error #9: UNINITIALIZED READ: reading register ecx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014279 <UMEngx86.dll+0x4279>)
    # 1 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 2 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 3 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 4 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 5 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 6 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    # 7 __mingw_CRTStartup
    # 8 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.316 in thread 6956
    Note: instruction: mov    0x14(%ecx) -> %ecx
     
    Error #10: UNINITIALIZED READ: reading register ebx
    # 0 UMEngx86.dll!?                           +0x0      (0x740140e9 <UMEngx86.dll+0x40e9>)
    # 1 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 2 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 3 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 4 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 5 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 6 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 7 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    # 8 __mingw_CRTStartup
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    #10 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.321 in thread 6956
    Note: instruction: cmp    0x08(%ebx) $0x00000000
     
    Error #11: UNINITIALIZED READ: reading 0x0028f7b0-0x0028f7b4 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x19951  (0x7402faf1 <UMEngx86.dll+0x1faf1>)
    # 1 UMEngx86.dll!RegQueryValueExW            +0x21fc9  (0x7403816a <UMEngx86.dll+0x2816a>)
    # 2 UMEngx86.dll!RegQueryValueExW            +0x21fe6  (0x74038187 <UMEngx86.dll+0x28187>)
    # 3 UMEngx86.dll!?                           +0x0      (0x74014359 <UMEngx86.dll+0x4359>)
    # 4 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 5 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 6 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 7 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 8 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 9 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    #10 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    #11 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    #12 __mingw_CRTStartup
    #13 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    #14 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.333 in thread 6956
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #12: UNINITIALIZED READ: reading 0x0028f7d0-0x0028f7d4 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x1999b  (0x7402fb3b <UMEngx86.dll+0x1fb3b>)
    # 1 UMEngx86.dll!?                           +0x0      (0x74014390 <UMEngx86.dll+0x4390>)
    # 2 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 3 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNELBASE.dll!CreateMutexExW            +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 5 KERNELBASE.dll!DebugBreak                +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 6 KERNELBASE.dll!OutputDebugStringA        +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 7 msvcrt.dll!chkesp                        +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 8 msvcrt.dll!ftol2_sse_excpt               +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 9 logger_off                                [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    #10 __mingw_CRTStartup
    #11 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    #12 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.343 in thread 6956
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #13: UNINITIALIZED READ: reading 0x0028f81c-0x0028f824 8 byte(s) within 0x0028f81c-0x0028f82c
    # 0 system call NtDeviceIoControlFile InputBuffer
    # 1 UMEngx86.dll!?                                             +0x0      (0x740115cc <UMEngx86.dll+0x15cc>)
    # 2 UMEngx86.dll!?                                             +0x0      (0x740141cc <UMEngx86.dll+0x41cc>)
    # 3 UMEngx86.dll!?                                             +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNELBASE.dll!CreateMutexExW                              +0x64     (0x74d80f6f <KERNELBASE.dll+0x10f6f>)
    # 5 KERNELBASE.dll!DebugBreak                                  +0x20d    (0x74d83438 <KERNELBASE.dll+0x13438>)
    # 6 KERNELBASE.dll!OutputDebugStringA                          +0xb1     (0x74d8354d <KERNELBASE.dll+0x1354d>)
    # 7 msvcrt.dll!chkesp                                          +0xb0     (0x769a69c4 <msvcrt.dll+0x669c4>)
    # 8 msvcrt.dll!ftol2_sse_excpt                                 +0x196d7  (0x7698b493 <msvcrt.dll+0x4b493>)
    # 9 logger_off                                                  [C:/Users/lt008176/Desktop/Code source/logger.c:21]
    #10 __mingw_CRTStartup
    #11 ntdll.dll!RtlInitializeExceptionChain                      +0x62     (0x77079882 <ntdll.dll+0x39882>)
    #12 ntdll.dll!RtlInitializeExceptionChain                      +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.352 in thread 6956
     
    Error #14: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028fee0-0x0028fee4 4 byte(s)
    # 0 <not in a module>           (0x003e0be4)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.396 in thread 6956
    Note: 0x0028fee0 refers to 28 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    %ecx -> 0xffffffe4(%esp)
     
    Error #15: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028fef0-0x0028fef4 4 byte(s)
    # 0 <not in a module>           (0x003e0be8)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.400 in thread 6956
    Note: 0x0028fef0 refers to 12 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    $0x003e0c52 -> 0xfffffff4(%esp)
     
    Error #16: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003e0bf5)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.404 in thread 6956
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    %eax -> 0xfffffff0(%esp)
     
    Error #17: UNINITIALIZED READ: reading register eax
    # 0 UMEngx86.dll!?                           +0x0      (0x74014266 <UMEngx86.dll+0x4266>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.408 in thread 6956
    Note: instruction: movzx  0x04(%eax) -> %ecx
     
    Error #18: UNINITIALIZED READ: reading register edx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014271 <UMEngx86.dll+0x4271>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.411 in thread 6956
    Note: instruction: mov    0x14(%edx) -> %eax
     
    Error #19: UNINITIALIZED READ: reading register ecx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014279 <UMEngx86.dll+0x4279>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.415 in thread 6956
    Note: instruction: mov    0x14(%ecx) -> %ecx
     
    Error #20: UNINITIALIZED READ: reading register ebx
    # 0 UMEngx86.dll!?                           +0x0      (0x740140e9 <UMEngx86.dll+0x40e9>)
    # 1 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.418 in thread 6956
    Note: instruction: cmp    0x08(%ebx) $0x00000000
     
    Error #21: UNINITIALIZED READ: reading 0x0028fdf8-0x0028fdfc 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x19951  (0x7402faf1 <UMEngx86.dll+0x1faf1>)
    # 1 UMEngx86.dll!RegQueryValueExW            +0x21fc9  (0x7403816a <UMEngx86.dll+0x2816a>)
    # 2 UMEngx86.dll!RegQueryValueExW            +0x21fe6  (0x74038187 <UMEngx86.dll+0x28187>)
    # 3 UMEngx86.dll!?                           +0x0      (0x74014359 <UMEngx86.dll+0x4359>)
    # 4 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 5 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 6 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 7 __mingw_CRTStartup
    # 8 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.422 in thread 6956
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #22: UNINITIALIZED READ: reading 0x0028fe18-0x0028fe1c 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x1999b  (0x7402fb3b <UMEngx86.dll+0x1fb3b>)
    # 1 UMEngx86.dll!?                           +0x0      (0x74014390 <UMEngx86.dll+0x4390>)
    # 2 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 3 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 5 __mingw_CRTStartup
    # 6 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 7 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.428 in thread 6956
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #23: UNINITIALIZED READ: reading 0x0028fe64-0x0028fe6c 8 byte(s) within 0x0028fe64-0x0028fe74
    # 0 system call NtDeviceIoControlFile InputBuffer
    # 1 UMEngx86.dll!?                                             +0x0      (0x740115cc <UMEngx86.dll+0x15cc>)
    # 2 UMEngx86.dll!?                                             +0x0      (0x740141cc <UMEngx86.dll+0x41cc>)
    # 3 UMEngx86.dll!?                                             +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNEL32.dll!ExitProcess                                   +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 5 __mingw_CRTStartup
    # 6 ntdll.dll!RtlInitializeExceptionChain                      +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 7 ntdll.dll!RtlInitializeExceptionChain                      +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.432 in thread 6956
     
    Error #24: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003e0c07)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.439 in thread 6956
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    %eax -> 0xfffffff0(%esp)
     
    Error #25: UNADDRESSABLE ACCESS beyond top of stack: reading 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003e0c15)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.442 in thread 6956
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    0xfffffff0(%esp) -> %eax
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

  6. #6
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut
    Alors,

    J'ai trouvé je pense mes boulettes :

    1-Fonction file_to_string // Problème d'allocation

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    if ( (t_realloc=(char *)realloc(str_out, (f_sz)*sizeof(char))) )
    DEVIENT
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if ( (t_realloc=(char *)realloc(str_out, (f_sz+1)*sizeof(char))) )
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    char *file_to_string( const char *path )
    {
        char *str_out=NULL;
        if ( path )
        {
            FILE *pFile=NULL;
            if ( (pFile=file_open(path,"rb")) )
            {
                char *t_realloc = NULL;
                char buffer='\0';
                t_uint64 f_sz = 0;
                size_t read_byte = 0;
                while( 0<(read_byte=fread(&buffer, sizeof(char), 1, pFile)) )
                {
                    f_sz++;
                    if ( (t_realloc=(char *)realloc(str_out, f_sz*sizeof(char))) )
                        str_out=t_realloc, str_out[f_sz-1]=buffer;
    
                    else
                    {
                        deallocate_1D_c(str_out);
                        fprintf(logger,"file.h::file_to_string --> The reallocation has failed at offset=%I64u [ERRNO:%s]\n", f_sz, strerror(errno));
                        read_byte=-1;
                    }
                }
                if ( (t_realloc=(char *)realloc(str_out, (f_sz+1)*sizeof(char))) )
                        str_out=t_realloc, str_out[f_sz]='\0';
    
                else
                {
                    deallocate_1D_c(str_out);
                    fprintf(logger,"file.h::file_to_string --> The reallocation has failed at offset=%I64u [ERRNO:%s]\n", f_sz, strerror(errno));
                }
            }
            else fprintf(logger,"file.h::file_to_string --> The openning of the \"%s\" file has failed [ERRNO:%s]\n", path, strerror(errno));
            file_close(pFile);
        }
        return str_out;
    }
    2- t_csv *csv_allocate_empty() // Oublié d'initialiser les pointers, variables si allocation résussie

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    t_csv *csv_allocate_empty()
    {
        t_csv *p = NULL;
        if ( !(p = (t_csv*)malloc(sizeof(t_csv))) ) /// T1
            fprintf(logger, "csv.h::csv_allocate_empty.T1 -> The function has returned a NULL pointer\n");
     
        return p;
    }
    DEVIENT

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    t_csv *csv_allocate_empty()
    {
        t_csv *p = NULL;
        if ( !(p = (t_csv*)malloc(sizeof(t_csv))) ) /// T1
            fprintf(logger, "csv.h::csv_allocate_empty.T1 -> The function has returned a NULL pointer\n");
     
        else
        {
            p->array = NULL;
            p->line = 0;
            p->path = NULL;
            p->raw = NULL;
            p->row = 0;
        }
     
        return p;
    }
    Cela résout le problème de SIGTRAP, cependant j'ai quand même des erreurs qui n'empêche pas le programme de s'executer.
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

  7. #7
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut
    Suite à mon dernier post voici le dernier DrMemory :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.285 in thread 8308
    Note: 0x0028fef0 refers to 12 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    $0x003d0c52 -> 0xfffffff4(%esp)
     
    Error #13: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003d0bf5)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.290 in thread 8308
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    %eax -> 0xfffffff0(%esp)
     
    Error #14: UNINITIALIZED READ: reading register eax
    # 0 UMEngx86.dll!?                           +0x0      (0x74014266 <UMEngx86.dll+0x4266>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.294 in thread 8308
    Note: instruction: movzx  0x04(%eax) -> %ecx
     
    Error #15: UNINITIALIZED READ: reading register edx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014271 <UMEngx86.dll+0x4271>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.300 in thread 8308
    Note: instruction: mov    0x14(%edx) -> %eax
     
    Error #16: UNINITIALIZED READ: reading register ecx
    # 0 UMEngx86.dll!?                           +0x0      (0x74014279 <UMEngx86.dll+0x4279>)
    # 1 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 2 __mingw_CRTStartup
    # 3 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.304 in thread 8308
    Note: instruction: mov    0x14(%ecx) -> %ecx
     
    Error #17: UNINITIALIZED READ: reading register ebx
    # 0 UMEngx86.dll!?                           +0x0      (0x740140e9 <UMEngx86.dll+0x40e9>)
    # 1 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.308 in thread 8308
    Note: instruction: cmp    0x08(%ebx) $0x00000000
     
    Error #18: UNINITIALIZED READ: reading 0x0028fdf8-0x0028fdfc 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x19951  (0x7402faf1 <UMEngx86.dll+0x1faf1>)
    # 1 UMEngx86.dll!RegQueryValueExW            +0x21fc9  (0x7403816a <UMEngx86.dll+0x2816a>)
    # 2 UMEngx86.dll!RegQueryValueExW            +0x21fe6  (0x74038187 <UMEngx86.dll+0x28187>)
    # 3 UMEngx86.dll!?                           +0x0      (0x74014359 <UMEngx86.dll+0x4359>)
    # 4 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 5 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 6 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 7 __mingw_CRTStartup
    # 8 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 9 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.312 in thread 8308
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #19: UNINITIALIZED READ: reading 0x0028fe18-0x0028fe1c 4 byte(s)
    # 0 UMEngx86.dll!RegQueryValueExW            +0x1999b  (0x7402fb3b <UMEngx86.dll+0x1fb3b>)
    # 1 UMEngx86.dll!?                           +0x0      (0x74014390 <UMEngx86.dll+0x4390>)
    # 2 UMEngx86.dll!?                           +0x0      (0x74014185 <UMEngx86.dll+0x4185>)
    # 3 UMEngx86.dll!?                           +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 5 __mingw_CRTStartup
    # 6 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 7 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.316 in thread 8308
    Note: instruction: cmp    %ecx 0x08(%ebp)
     
    Error #20: UNINITIALIZED READ: reading 0x0028fe64-0x0028fe6c 8 byte(s) within 0x0028fe64-0x0028fe74
    # 0 system call NtDeviceIoControlFile InputBuffer
    # 1 UMEngx86.dll!?                                             +0x0      (0x740115cc <UMEngx86.dll+0x15cc>)
    # 2 UMEngx86.dll!?                                             +0x0      (0x740141cc <UMEngx86.dll+0x41cc>)
    # 3 UMEngx86.dll!?                                             +0x0      (0x740142b0 <UMEngx86.dll+0x42b0>)
    # 4 KERNEL32.dll!ExitProcess                                   +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 5 __mingw_CRTStartup
    # 6 ntdll.dll!RtlInitializeExceptionChain                      +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 7 ntdll.dll!RtlInitializeExceptionChain                      +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.321 in thread 8308
     
    Error #21: UNADDRESSABLE ACCESS beyond top of stack: writing 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003d0c07)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.328 in thread 8308
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    %eax -> 0xfffffff0(%esp)
     
    Error #22: UNADDRESSABLE ACCESS beyond top of stack: reading 0x0028feec-0x0028fef0 4 byte(s)
    # 0 <not in a module>           (0x003d0c15)
    # 1 ntdll.dll!RtlExitUserProcess             +0x40     (0x77099c13 <ntdll.dll+0x59c13>)
    # 2 KERNEL32.dll!ExitProcess                 +0x14     (0x768479c5 <KERNEL32.dll+0x179c5>)
    # 3 __mingw_CRTStartup
    # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x77079882 <ntdll.dll+0x39882>)
    # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x77079855 <ntdll.dll+0x39855>)
    Note: @0:00:03.332 in thread 8308
    Note: 0x0028feec refers to 16 byte(s) beyond the top of the stack 0x0028fefc
    Note: instruction: mov    0xfffffff0(%esp) -> %eax
    Il met en évidence le fichier logger.c ligne 21

    logger.c
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
     
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <dirent.h>
     
    #include "file.h"
    #include "ptrop.h"
    #include "str.h"
    #include "tim.h"
    #include "logger.h"
     
     
    void logger_on()
    {
        remove("logger.txt");
        logger = fopen("logger.txt","w");
    }
     
    void logger_off()
    {
        fclose(logger);
    }
     
    void logger_read()
    {
        char *log = NULL;
        if ( (log=file_to_string("logger.txt")) )
            if ( strcmp(log, "") != 0 )
            {
                printf("\n\n±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");
                printf("\n±±         LOG FILE        ±±");
                printf("\n±±±±±±±±±±±±±±±±±±±±±±±±±±±±±\n");
                unsigned long long int i;
                for (i=0;i<str_length(log);i++)
                {
                    printf("%c",log[i]);
                    if(log[i]=='\n')
                        time_wait(0.25);
                }
                free(log);
                printf("\n±±±±±±±±±±±±±±±±±±±±±±±±±±±±±\n");
            }
            else remove(".\\logger.txt");
    }
    logger.h
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    #ifndef LOGGER_H
    #define LOGGER_H
     
    FILE *logger;
     
    void logger_on();
    void logger_off();
    void logger_read();
    # endif
    Visiblement, il n'aime pas l'appel de la fonction fclose dans la fonction logger_off. Est-ce que vous auriez une petite idée ?

    Merci d'avance.
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

  8. #8
    Expert éminent sénior

    Femme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    5 189
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 5 189
    Points : 17 141
    Points
    17 141
    Par défaut
    Ca pourrait être quelque chose comme:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    void logger_off() {
        if (logger) {
            fclose(logger);
            logger = 0;
        }
    }
    De cette façon, tu ne fermeras pas un pointeur null, et tu mettras le pointeur à null en fermant.
    Par contre, je pense qu'il faudrait vérifier le code retour de fclose, s'il y en a.
    Mes principes de bases du codeur qui veut pouvoir dormir:
    • Une variable de moins est une source d'erreur en moins.
    • Un pointeur de moins est une montagne d'erreurs en moins.
    • Un copier-coller, ça doit se justifier... Deux, c'est un de trop.
    • jamais signifie "sauf si j'ai passé trois jours à prouver que je peux".
    • La plus sotte des questions est celle qu'on ne pose pas.
    Pour faire des graphes, essayez yEd.
    le ter nel est le titre porté par un de mes personnages de jeu de rôle

  9. #9
    Membre confirmé
    Homme Profil pro
    amateur
    Inscrit en
    Octobre 2007
    Messages
    731
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : amateur

    Informations forums :
    Inscription : Octobre 2007
    Messages : 731
    Points : 460
    Points
    460
    Par défaut
    Bonjour leternel,

    Ok parfait, cela règle les 7 erreurs liées à logger.c.
    Je le fais sur mes autres fonctions, et là je le fais pas... 0/20.

    Du coup il me reste 15 erreurs mais c'est incompréhensible pour moi.
    Pour le moment, on va dire que c'est bon.

    Merci pour votre aide, comme d'habitude !
    UNE REPONSE UTILE : &|| UN PROBLEME RESOLU :

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Petite question sur free()
    Par psyphi dans le forum C
    Réponses: 2
    Dernier message: 17/08/2006, 15h55
  2. Crontab sur free
    Par bigorre1000 dans le forum Serveurs (Apache, IIS,...)
    Réponses: 2
    Dernier message: 20/02/2006, 19h47
  3. question sur "Free" et "Nil"
    Par jakouz dans le forum Langage
    Réponses: 2
    Dernier message: 27/10/2005, 11h15
  4. forcer la création de tables InnoDB sur Free
    Par Eldarion dans le forum SQL Procédural
    Réponses: 2
    Dernier message: 13/10/2005, 22h23
  5. mysqldump sur free
    Par bouba64 dans le forum Administration
    Réponses: 4
    Dernier message: 15/07/2003, 17h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo