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 :

Erreur de segmentation : Previous frame inner to this frame (corrupt stack?)


Sujet :

C++

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Août 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 8
    Points : 5
    Points
    5
    Par défaut Erreur de segmentation : Previous frame inner to this frame (corrupt stack?)
    Bonjour à tous,

    C'est mon premier message alors j'en profite pour me présenter rapidement. Je suis étudiant à l'utbm de Belfort, j'ai 20 ans. Je me suis récement mis au C++ pour approcher un peu le monde de la 3D.

    Je vous expose donc mon problème :
    J'ai codé un parseur de fichier ASE, qui sont des fichiers texte composés de valeurs entières et à virgule flottante. Il me faut en fait récuperer plusieurs de ces valeurs (plus de 1000), afin de définir le maillage de mes objet 3D.

    Le problème concerne bien le C++ : Je commence par récuperer plusieurs valeurs et toujours au meme moment j'ai un erreur de segmentation lorsque je récupere une certaine valeur en utilisant ce code.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    double val;
    file >> val;
    Dans le doute j'ai vérifié que la valeur récuperé était bien un double en testant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    string val;
    file >> val;
    La valeur contenue dans le string est bien un double (0.4000). Lorsque je mets dans un string aucune erreur de segmentation ne survient, alors que si je tente de mettre cette valeur dans un double j'obtient cette erreur : (à noter quand meme que cette syntaxe file >> un_double marche un bon millier de fois avant que cette erreur ne survienne.)

    Segmentation fault
    Previous frame inner to this frame (corrupt stack?)


    J'espere que vous aurez plus d'idées que moi, ca fait 3h que je planche sur le problème. Alors y a t'il des problèmes à utiliser cette méthode (>>) pour lire un fichier, un limitation ou quoi que ce soit ?

    Merci d'avance !

    Alexandre

    EDIT : J'ai essayé de modifier le fichier pour mettre une valeur entiere :
    Si je la récupere dans un int ancun problème. Si je la récupere dans un float ou double, meme erreur.

    OS : xp
    IDE : C:B

    Voila le log d'erreur du débuggueur(gdb): (surement inutile ?)
    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
    #0 0x7c936a36	ntdll!iswdigit (??:??)
    #1 0x00afa458	?? (??:??)
    #2 0x00af0000	?? (??:??)
    #3 0x00afa460	?? (??:??)
    #4 0x00000000	?? (??:??)
    #5 0x00000020	?? (??:??)
    #6 0x0022f49c	?? (??:??)
    #7 0x00af75f8	?? (??:??)
    #8 0x7c9206f0	ntdll!RtlAppendStringToString (??:??)
    #9 0x00afa460	?? (??:??)
    #10 0x00af0000	?? (??:??)
    #11 0x00af9c90	?? (??:??)
    #12 0x00000000	?? (??:??)
    #13 0x00af7808	?? (??:??)
    #14 0x7c959b34	ntdll!RtlInsertElementGenericTableAvl (??:??)
    #15 0x00afa458	?? (??:??)
    #16 0x00000000	?? (??:??)
    #17 0xfeeefeee	?? (??:??)
    #18 0x00af0000	?? (??:??)
    #19 0x0022f28c	?? (??:??)
    #20 0x00000000	?? (??:??)
    #21 0x0022f6cc	?? (??:??)
    #22 0x7c91ee18	strchr (??:??)
    #23 0x7c92b690	wcsncat (??:??)
    #24 0x414c4c4f	?? (??:??)
    #25 0x7c92b686	wcsncat (??:??)
    #26 0x00afa458	?? (??:??)
    #27 0x00000370	?? (??:??)
    #28 0x00afa460	?? (??:??)
    #29 0x7c9206eb	ntdll!RtlAppendStringToString (??:??)
    #30 0x00000001	?? (??:??)
    #31 0x00afa460	?? (??:??)
    #32 0x0000002d	?? (??:??)
    #33 0x00000008	?? (??:??)
    #34 0x00000000	?? (??:??)
    #35 0x00af7810	?? (??:??)
    #36 0x00000000	?? (??:??)
    #37 0x0022f5bc	?? (??:??)
    #38 0x00936a44	?? (??:??)
    #39 0x00af0000	?? (??:??)
    #40 0x00af0000	?? (??:??)
    #41 0x00afa458	?? (??:??)
    #42 0x7c96db5c	ntdll!RtlZeroHeap (??:??)
    #43 0x00afa7b1	?? (??:??)
    #44 0x00000000	?? (??:??)
    #45 0x00000000	?? (??:??)
    #46 0x0000a458	?? (??:??)
    #47 0x00000095	?? (??:??)
    #48 0x0022f448	?? (??:??)
    #49 0x0022f51c	?? (??:??)
    #50 0x0022f580	?? (??:??)
    #51 0x7c91ee18	strchr (??:??)
    #52 0x7c936ac8	ntdll!iswdigit (??:??)
    #53 0x00000001	?? (??:??)
    #54 0x0022f590	?? (??:??)
    #55 0x7c97e062	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #56 0x00af0000	?? (??:??)
    #57 0x50000061	?? (??:??)
    #58 0x00afa460	?? (??:??)
    #59 0x00af0000	?? (??:??)
    #60 0x00afa460	?? (??:??)
    #61 0x40000060	?? (??:??)
    #62 0x00000000	?? (??:??)
    #63 0x00af9c90	?? (??:??)
    #64 0x00af0000	?? (??:??)
    #65 0x00af9c98	?? (??:??)
    #66 0x00af0000	?? (??:??)
    #67 0x00000000	?? (??:??)
    #68 0x0022f588	?? (??:??)
    #69 0x7c97cde9	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #70 0x00af0000	?? (??:??)
    #71 0x00000370	?? (??:??)
    #72 0x00afa458	?? (??:??)
    #73 0x00af0000	?? (??:??)
    #74 0x00af01a0	?? (??:??)
    #75 0x7c92b690	wcsncat (??:??)
    #76 0x000198b8	?? (??:??)
    #77 0x0022f530	?? (??:??)
    #78 0x7c92b298	wcsncat (??:??)
    #79 0x0022f668	?? (??:??)
    #80 0x7c91ee18	strchr (??:??)
    #81 0x7c97e0f8	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #82 0x00000001	?? (??:??)
    #83 0x0022f678	?? (??:??)
    #84 0x7c95a5d0	ntdll!RtlInsertElementGenericTableAvl (??:??)
    #85 0x00af0000	?? (??:??)
    #86 0x50000061	?? (??:??)
    #87 0x00afa460	?? (??:??)
    #88 0x00af0000	?? (??:??)
    #89 0x00afa460	?? (??:??)
    #90 0x40000060	?? (??:??)
    #91 0x7c936abe	ntdll!iswdigit (??:??)
    #92 0x0022f5e8	?? (??:??)
    #93 0x7c97cde9	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #94 0x00af0000	?? (??:??)
    #95 0x00000000	?? (??:??)
    #96 0x00af98b8	?? (??:??)
    #97 0x00af0000	?? (??:??)
    #98 0x00af98c0	?? (??:??)
    #99 0x0022f5e4	?? (??:??)
    #100 0x0022f648	?? (??:??)
    #101 0x7c91ee18	strchr (??:??)
    #102 0x00000000	?? (??:??)
    #103 0x00af0000	?? (??:??)
    #104 0x00000000	?? (??:??)
    #105 0x0022f658	?? (??:??)
    #106 0x7c97e0f0	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #107 0x00af0608	?? (??:??)
    #108 0x7c97e0d4	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #109 0x00af0000	?? (??:??)
    #110 0x00af98c0	?? (??:??)
    #111 0x40000060	?? (??:??)
    #112 0x50000061	?? (??:??)
    #113 0x7c936abe	ntdll!iswdigit (??:??)
    #114 0x00af0000	?? (??:??)
    #115 0x00af7810	?? (??:??)
    #116 0x40000060	?? (??:??)
    #117 0x0022f688	?? (??:??)
    #118 0x7c97e0f0	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #119 0x00af0608	?? (??:??)
    #120 0x7c97e0d4	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #121 0x00000028	?? (??:??)
    #122 0x00af98b8	?? (??:??)
    #123 0x00af0000	?? (??:??)
    #124 0x7c95a5d0	ntdll!RtlInsertElementGenericTableAvl (??:??)
    #125 0x00af0000	?? (??:??)
    #126 0x01010061	?? (??:??)
    #127 0x00af0000	?? (??:??)
    #128 0x00af0000	?? (??:??)
    #129 0x0022f730	?? (??:??)
    #130 0x7c91ee18	strchr (??:??)
    #131 0x7c97e0f8	ntdll!RtlpNtMakeTemporaryKey (??:??)
    #132 0xffffffff	?? (??:??)
    #133 0x7c00e0d4	?? (??:??)
    #134 0x7c95a5d0	ntdll!RtlInsertElementGenericTableAvl (??:??)
    #135 0x0022f5a4	?? (??:??)
    #136 0x50000061	?? (??:??)
    #137 0x0022f738	?? (??:??)
    #138 0x7c91ee18	strchr (??:??)
    #139 0x7c936ac8	ntdll!iswdigit (??:??)
    #140 0xffffffff	?? (??:??)
    #141 0x0022f748	?? (??:??)
    #142 0x7c9368ad	ntdll!iswdigit (??:??)
    #143 0x00af0000	?? (??:??)
    #144 0x40000060	?? (??:??)
    #145 0x00afa460	?? (??:??)
    #146 0x00000000	?? (??:??)
    #147 0x00afa460	?? (??:??)
    #148 0x00000000	?? (??:??)
    #149 0x7c936abe	ntdll!iswdigit (??:??)
    #150 0x00af0000	?? (??:??)
    #151 0x00af9c98	?? (??:??)
    #152 0x40000060	?? (??:??)
    #153 0x00000000	?? (??:??)
    #154 0x00000000	?? (??:??)
    #155 0x7c91e288	ntdll!ZwReadFile (??:??)
    #156 0x7c801875	ReadFile (??:??)
    #157 0x0000074c	?? (??:??)
    #158 0x00000000	?? (??:??)
    #159 0x00af0000	?? (??:??)
    #160 0x0022f4bc	?? (??:??)
    #161 0x0022f6f0	?? (??:??)
    #162 0x0022f70c	?? (??:??)
    #163 0x7c91ee18	strchr (??:??)
    #164 0x7c9206f0	ntdll!RtlAppendStringToString (??:??)
    #165 0xffffffff	?? (??:??)
    #166 0x7c9206eb	ntdll!RtlAppendStringToString (??:??)
    #167 0x77bfc3c9	msvcrt!free (??:??)
    #168 0x00af0000	?? (??:??)
    #169 0x40000060	?? (??:??)
    #170 0x77bfc3ce	msvcrt!free (??:??)
    #171 0x0044f1f0	__gnu_cxx::__pool_alloc<wchar_t>::_S_force_new (??:??)
    #172 0x00000000	?? (??:??)
    #173 0x0000002d	?? (??:??)
    #174 0x00000074	?? (??:??)
    #175 0x00000000	?? (??:??)
    #176 0x00000000	?? (??:??)
    #177 0x0022f798	?? (??:??)
    #178 0x00000074	?? (??:??)
    #179 0x00af0000	?? (??:??)
    #180 0x00000074	?? (??:??)
    #181 0x00af0000	?? (??:??)
    #182 0x0022f514	?? (??:??)
    #183 0x0022f73c	?? (??:??)
    #184 0x0022f764	?? (??:??)
    #185 0x0001ee18	?? (??:??)
    #186 0x7c9206f0	ntdll!RtlAppendStringToString (??:??)
    #187 0x0022f68c	?? (??:??)
    #188 0x7c9206eb	ntdll!RtlAppendStringToString (??:??)
    #189 0x0022f780	?? (??:??)
    #190 0x7c91ee18	strchr (??:??)
    #191 0x7c920570	ntdll!RtlFreeThreadActivationContextStack (??:??)
    #192 0xffffffff	?? (??:??)
    #193 0x0022f790	?? (??:??)
    #194 0x77bfc2de	msvcrt!free (??:??)
    #195 0x00af0000	?? (??:??)
    #196 0x00000000	?? (??:??)
    #197 0x00afa460	?? (??:??)
    #198 0x00000000	?? (??:??)
    #199 0x00000000	?? (??:??)
    #200 0x00000000	?? (??:??)
    #201 0x77c2f79a	msvcrt!__crtCompareStringA (??:??)
    #202 0x77c2f970	msvcrt!__crtCompareStringA (??:??)
    #203 0x00000000	?? (??:??)
    #204 0x0022f7a4	?? (??:??)
    #205 0x0022f75c	?? (??:??)
    #206 0x00afa460	?? (??:??)
    #207 0x0022f878	?? (??:??)
    #208 0x77c05c94	msvcrt!_except_handler2 (??:??)
    
    

  2. #2
    Membre averti Avatar de Higestromm
    Profil pro
    Inscrit en
    Juin 2002
    Messages
    516
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 516
    Points : 412
    Points
    412
    Par défaut
    A tout hazard essai de vider ton flux avec flush de temps en temps.
    J'aime pas les épinards... Mais alors pas du tout

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Août 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 8
    Points : 5
    Points
    5
    Par défaut
    Merci pour ta réponse j'y avais pensé mais ce n'était pas ça. J'ai corrigé il y a quelques minutes le problème qui était tout simplement une étourderie qui a mal tournée. (Oublié de réinitialiser une variable à 0, le problème n'avait apparement aucun lien avec les flux)

    Merci, a bientot

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

Discussions similaires

  1. Réponses: 5
    Dernier message: 27/07/2006, 08h05
  2. Erreur de segmentation (Inconnue)
    Par Dark-Meteor dans le forum C
    Réponses: 5
    Dernier message: 08/09/2005, 13h42
  3. [Dev-C++] Erreur de segmentation...
    Par sas dans le forum Dev-C++
    Réponses: 11
    Dernier message: 26/03/2005, 14h25
  4. erreur de segmentation
    Par transistor49 dans le forum C++
    Réponses: 10
    Dernier message: 15/03/2005, 11h18
  5. Erreur lors d'une requete INNER JOIN
    Par k-lendos dans le forum Langage SQL
    Réponses: 2
    Dernier message: 17/03/2004, 15h09

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