J'ai un Pc unix et je fais de la programmation en fortran. Mon programme a plusieurs sous programmes et quand je le teste sous windows il marche parfaitement. Je dois pour des raisons de travil le faire aussi tourner sous UNIX. J'ai donc compilé mon programme avec gcc et pas de probleme jusque là mais quand je l'execute il me met segmentation fault.
J'ai alors utiliser valgrind pour voir mes erers et voila ce qu'il me met:
==17780== Memcheck, a memory error detector.
==17780== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==17780== Using LibVEX rev 1575, a library for dynamic binary translation.
==17780== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==17780== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==17780== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==17780==
--17780-- Command line
--17780-- ./EperVeille.out
--17780-- Startup, with flags:
--17780-- -v
--17780-- --leak-check=yes
--17780-- --show-reachable=yes
--17780-- --max-stackframe=30088536
--17780-- Contents of /proc/version:
--17780-- Linux version 2.6.9-55.ELsmp ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Fri Apr 20 17:03:35 EDT 2007
--17780-- Arch and subarch: X86, x86-sse2
--17780-- Valgrind library directory: /usr/lib/valgrind
--17780-- Reading syms from /lib/ld-2.3.4.so (0x68F000)
--17780-- Reading syms from /home/delcourt/Epervier/utilisateur/EperVeille.out (0x8048000)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0xB0000000)
--17780-- object doesn't have a dynamic symbol table
--17780-- Reading suppressions file: /usr/lib/valgrind/default.supp
--17780-- REDIR: 0x6A1450 (index) redirected to 0xB001BC86 (vgPlain_x86_linux_REDIR_FOR_index)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x4000000)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4003000)
--17780-- REDIR: 0x6A15F0 (strlen) redirected to 0x4005E90 (strlen)
--17780-- Reading syms from /lib/tls/libm-2.3.4.so (0x7DC000)
--17780-- Reading syms from /lib/tls/libc-2.3.4.so (0x6AE000)
--17780-- REDIR: 0x717A10 (rindex) redirected to 0x4005B9C (rindex)
--17780-- REDIR: 0x712380 (calloc) redirected to 0x4005639 (calloc)
--17780-- REDIR: 0x718D90 (memcpy) redirected to 0x40061A8 (memcpy)
--17780-- REDIR: 0x68F7A0 (_dl_sysinfo_int80) redirected to 0xB001BC83 (???)
==17780==
==17780== Process terminating with default action of signal 11 (SIGSEGV)
==17780== Access not within mapped region at address 0xBD182040
==17780== at 0x809F089: main (EperVeille.for:2)
==17780==
==17780== Process terminating with default action of signal 11 (SIGSEGV)
==17780== Access not within mapped region at address 0xBD181F8C
==17780== at 0x400031F: _vgw_freeres (vg_preloaded.c:58)
==17780==
==17780== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
--17780--
--17780-- supp: 13 Ubuntu-stripped-ld.so
==17780== malloc/free: in use at exit: 1,005,496 bytes in 1 blocks.
==17780== malloc/free: 1 allocs, 0 frees, 1,005,496 bytes allocated.
==17780==
==17780== searching for pointers to 1 not-freed blocks.
==17780== checked 2,120,252 bytes.
==17780==
==17780== 1,005,496 bytes in 1 blocks are still reachable in loss record 1 of 1
==17780== at 0x40056BF: calloc (vg_replace_malloc.c:279)
==17780== by 0x778839: monstartup (in /lib/tls/libc-2.3.4.so)
==17780== by 0x8048B93: __gmon_start__ (in /home/delcourt/Epervier/utilisateur/EperVeille.out)
==17780== by 0x7DF31C: (within /lib/tls/libm-2.3.4.so)
==17780== by 0x7DF23A: (within /lib/tls/libm-2.3.4.so)
==17780== by 0x69B717: _dl_init (in /lib/ld-2.3.4.so)
==17780== by 0x68F7FE: (within /lib/ld-2.3.4.so)
==17780==
==17780== LEAK SUMMARY:
==17780== definitely lost: 0 bytes in 0 blocks.
==17780== possibly lost: 0 bytes in 0 blocks.
==17780== still reachable: 1,005,496 bytes in 1 blocks.
==17780== suppressed: 0 bytes in 0 blocks.
--17780-- memcheck: sanity checks: 0 cheap, 1 expensive
--17780-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--17780-- memcheck: auxmaps: 0 searches, 0 comparisons
--17780-- memcheck: secondaries: 13 issued (832k, 0M)
--17780-- memcheck: secondaries: 518 accessible and distinguished (33152k, 32M)--17780-- tt/tc: 2,754 tt lookups requiring 2,763 probes
--17780-- tt/tc: 2,754 fast-cache updates, 3 flushes
--17780-- translate: new 1,271 (28,729 -> 455,673; ratio 158:10) [0 scs]
--17780-- translate: dumped 0 (0 -> ??)
--17780-- translate: discarded 9 (214 -> ??)
--17780-- scheduler: 26,594 jumps (bb entries).
--17780-- scheduler: 0/1,562 major/minor sched events.
--17780-- sanity: 1 cheap, 1 expensive checks.
--17780-- exectx: 30,011 lists, 9 contexts (avg 0 per list)
--17780-- exectx: 14 searches, 5 full compares (357 per 1000)
--17780-- exectx: 0 cmp2, 38 cmp4, 0 cmpAll
Segmentation fault
Je pense que c'est un problème d'allocations dynamiques.
Dans le source je travaille avec deux pointeurs mais le problème c'est que je ne vois pas l'erreur. Aisez MOI SVP!!!! Merci pour vos réponses
J'ai alors utiliser valgrind pour voir mes erers et voila ce qu'il me met:
==17780== Memcheck, a memory error detector.
==17780== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==17780== Using LibVEX rev 1575, a library for dynamic binary translation.
==17780== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==17780== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==17780== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==17780==
--17780-- Command line
--17780-- ./EperVeille.out
--17780-- Startup, with flags:
--17780-- -v
--17780-- --leak-check=yes
--17780-- --show-reachable=yes
--17780-- --max-stackframe=30088536
--17780-- Contents of /proc/version:
--17780-- Linux version 2.6.9-55.ELsmp ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 SMP Fri Apr 20 17:03:35 EDT 2007
--17780-- Arch and subarch: X86, x86-sse2
--17780-- Valgrind library directory: /usr/lib/valgrind
--17780-- Reading syms from /lib/ld-2.3.4.so (0x68F000)
--17780-- Reading syms from /home/delcourt/Epervier/utilisateur/EperVeille.out (0x8048000)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0xB0000000)
--17780-- object doesn't have a dynamic symbol table
--17780-- Reading suppressions file: /usr/lib/valgrind/default.supp
--17780-- REDIR: 0x6A1450 (index) redirected to 0xB001BC86 (vgPlain_x86_linux_REDIR_FOR_index)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x4000000)
--17780-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4003000)
--17780-- REDIR: 0x6A15F0 (strlen) redirected to 0x4005E90 (strlen)
--17780-- Reading syms from /lib/tls/libm-2.3.4.so (0x7DC000)
--17780-- Reading syms from /lib/tls/libc-2.3.4.so (0x6AE000)
--17780-- REDIR: 0x717A10 (rindex) redirected to 0x4005B9C (rindex)
--17780-- REDIR: 0x712380 (calloc) redirected to 0x4005639 (calloc)
--17780-- REDIR: 0x718D90 (memcpy) redirected to 0x40061A8 (memcpy)
--17780-- REDIR: 0x68F7A0 (_dl_sysinfo_int80) redirected to 0xB001BC83 (???)
==17780==
==17780== Process terminating with default action of signal 11 (SIGSEGV)
==17780== Access not within mapped region at address 0xBD182040
==17780== at 0x809F089: main (EperVeille.for:2)
==17780==
==17780== Process terminating with default action of signal 11 (SIGSEGV)
==17780== Access not within mapped region at address 0xBD181F8C
==17780== at 0x400031F: _vgw_freeres (vg_preloaded.c:58)
==17780==
==17780== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
--17780--
--17780-- supp: 13 Ubuntu-stripped-ld.so
==17780== malloc/free: in use at exit: 1,005,496 bytes in 1 blocks.
==17780== malloc/free: 1 allocs, 0 frees, 1,005,496 bytes allocated.
==17780==
==17780== searching for pointers to 1 not-freed blocks.
==17780== checked 2,120,252 bytes.
==17780==
==17780== 1,005,496 bytes in 1 blocks are still reachable in loss record 1 of 1
==17780== at 0x40056BF: calloc (vg_replace_malloc.c:279)
==17780== by 0x778839: monstartup (in /lib/tls/libc-2.3.4.so)
==17780== by 0x8048B93: __gmon_start__ (in /home/delcourt/Epervier/utilisateur/EperVeille.out)
==17780== by 0x7DF31C: (within /lib/tls/libm-2.3.4.so)
==17780== by 0x7DF23A: (within /lib/tls/libm-2.3.4.so)
==17780== by 0x69B717: _dl_init (in /lib/ld-2.3.4.so)
==17780== by 0x68F7FE: (within /lib/ld-2.3.4.so)
==17780==
==17780== LEAK SUMMARY:
==17780== definitely lost: 0 bytes in 0 blocks.
==17780== possibly lost: 0 bytes in 0 blocks.
==17780== still reachable: 1,005,496 bytes in 1 blocks.
==17780== suppressed: 0 bytes in 0 blocks.
--17780-- memcheck: sanity checks: 0 cheap, 1 expensive
--17780-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--17780-- memcheck: auxmaps: 0 searches, 0 comparisons
--17780-- memcheck: secondaries: 13 issued (832k, 0M)
--17780-- memcheck: secondaries: 518 accessible and distinguished (33152k, 32M)--17780-- tt/tc: 2,754 tt lookups requiring 2,763 probes
--17780-- tt/tc: 2,754 fast-cache updates, 3 flushes
--17780-- translate: new 1,271 (28,729 -> 455,673; ratio 158:10) [0 scs]
--17780-- translate: dumped 0 (0 -> ??)
--17780-- translate: discarded 9 (214 -> ??)
--17780-- scheduler: 26,594 jumps (bb entries).
--17780-- scheduler: 0/1,562 major/minor sched events.
--17780-- sanity: 1 cheap, 1 expensive checks.
--17780-- exectx: 30,011 lists, 9 contexts (avg 0 per list)
--17780-- exectx: 14 searches, 5 full compares (357 per 1000)
--17780-- exectx: 0 cmp2, 38 cmp4, 0 cmpAll
Segmentation fault
Je pense que c'est un problème d'allocations dynamiques.
Dans le source je travaille avec deux pointeurs mais le problème c'est que je ne vois pas l'erreur. Aisez MOI SVP!!!! Merci pour vos réponses