Bonjour,

Je vous contacte, car j'ai un petit problème avec la nouvelle version de gcc via à vis d'un de mes projets.
Auparavant(avant de griller mon DD....), j'utilisai une version de gcc antérieure à la 4.2.1 et je n'avais aucuns problèmes. Maintenant, j'ai des erreurs du genre SegFault, etc

Pour m'assurer que ce n'était pas mon code, j'ai essayé avec la version 4.0 de gcc avec succés et sur une autre machine (Debian Lenny).

Seul gcc dans sa version 4.2.1 (Apple Inc. build 5664) pause problème, pensez vous à un problème en particulier, ou est-ce un bug dans mon code? Cela reste bizarre, même un passage par valgrind n'a rien détecté... 0 fuites mémoire, 0 allocations farfelues....

Voila le depôt où trouver mon code : http://codaset.com/frazakar/amr-graph

Donc pour compiler ce projet et qu'il marche (sous le dernier toolchain d'apple, fraichement téléchargé d'hier) : make clean && make "CC=gcc-4.0"
Pour lancer l'exécutable : ./test_graph
Et pour qu'il bug : make clean && make

Exemples d'erreurs et trace GDB:
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
$ ./test_graph -nt
Segmentation fault
$ ./test_graph -nt
test_graph(3682) malloc: *** error for object 0x100100700: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap

$ gdb ./test_graph
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) r -nt
Starting program: test_graph -nt
Reading symbols for shared libraries +. done
test_graph(2625) malloc: *** error for object 0x100100670: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff8016f616 in __kill ()
(gdb) where
#0  0x00007fff8016f616 in __kill ()
#1  0x00007fff8020fcca in abort ()
#2  0x00007fff801fe901 in szone_error ()
#3  0x00007fff8012ac83 in tiny_free_list_remove_ptr ()
#4  0x00007fff80129f38 in szone_free ()
#5  0x00007fff801299a9 in szone_realloc ()
#6  0x00007fff801290db in malloc_zone_realloc ()
#7  0x00007fff80135172 in realloc ()
#8  0x0000000100002c9f in memory_realloc (p=0x100100690, size=28) at memory.c:67
#9  0x00000001000036be in rallonger (self=0x100100400, nouvelle_taille=7) at vext.c:63
#10 0x000000010000381d in vext_ecrire (self=0x100100400, i=3, valeur=0x100100250) at vext.c:91
#11 0x00000001000038eb in vext_ajouter (self=0x100100400, valeur=0x100100250) at vext.c:110
#12 0x000000010000200a in add_child_node (n=0x1001003e0, child=0x100100250) at node.c:60
#13 0x00000001000026f1 in add_node_child_to_graph (g=0x100100080, i=9, j=4) at graph.c:109
#14 0x00000001000024bd in create_graph_random (nb_nodes=16, p=0.5) at graph.c:60
#15 0x0000000100001bc9 in main (argc=2, argv=0x7fff5fbfee98) at test_graph.c:140
(gdb) q
The program is running.  Exit anyway? (y or n) y
Je vous remercie par avance pour vos réponses!!!