Open Nyfero opened 2 years ago
Erreur avec fsanitize si tu ouvres cub3D avec une erreur de map :
==34140==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x0000004efb30 bp 0xbebebebebebebebe sp 0x7fff91e59ba0 T0) ==34140==The signal is caused by a READ memory access. ==34140==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#1 0x4cea0e in free_img /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/free/free_img.c:26:3
#2 0x4ce1e9 in free_all /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/free/free.c:20:2
#3 0x4cdfc6 in print_error_and_exit /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/errors/print_error.c:25:2
#4 0x4cb051 in check_extension_cub /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/check/check_file.c:44:11
#5 0x4ca3fa in main /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/main.c:99:3
#6 0x7fd092d73082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x41c5fd in _start (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x41c5fd)
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x4efb30) in mlx_destroy_image ==34140==ABORTING
Puis valgrind aussi
==35697==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x0000004efb30 bp 0xbebebebebebebebe sp 0x7ffd5405aaa0 T0) ==35697==The signal is caused by a READ memory access. ==35697==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
#1 0x4cea0e in free_img /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/free/free_img.c:26:3
#2 0x4ce1e9 in free_all /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/free/free.c:20:2
#3 0x4cdfc6 in print_error_and_exit /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/errors/print_error.c:25:2
#4 0x4cb051 in check_extension_cub /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/check/check_file.c:44:11
#5 0x4ca3fa in main /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/main.c:99:3
#6 0x7fcfccee0082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
#7 0x41c5fd in _start (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x41c5fd)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x4efb30) in mlx_destroy_image
==35697==ABORTING
e1r4p19% vim Makefile
e1r4p19% valgrind ./cub3D maps
==36063== Memcheck, a memory error detector
==36063== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==36063== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==36063== Command: ./cub3D maps
==36063==
==36063==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==36063==ASan shadow was supposed to be located in the [0x00007fff7000-0x10007fff7fff] range.
==36063==This might be related to ELF_ET_DYN_BASE change in Linux 4.12.
==36063==See https://github.com/google/sanitizers/issues/856 for possible workarounds.
==36063==Process memory map follows:
0x000000400000-0x00000041c000 /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D
0x00000041c000-0x0000004f0000 /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D
0x0000004f0000-0x000000526000 /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D
0x000000527000-0x000000528000 /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D
0x000000528000-0x000000530000 /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D
0x000000530000-0x000000dd6000
0x000004000000-0x000004001000 /usr/lib/x86_64-linux-gnu/ld-2.31.so
0x000004001000-0x000004024000 /usr/lib/x86_64-linux-gnu/ld-2.31.so
0x000004024000-0x00000402c000 /usr/lib/x86_64-linux-gnu/ld-2.31.so
0x00000402c000-0x00000402d000
0x00000402d000-0x00000402e000 /usr/lib/x86_64-linux-gnu/ld-2.31.so
0x00000402e000-0x00000402f000 /usr/lib/x86_64-linux-gnu/ld-2.31.so
0x00000402f000-0x000004030000
0x000004030000-0x000004031000
0x000004830000-0x000004831000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
0x000004831000-0x000004832000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
0x000004832000-0x000004833000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
0x000004833000-0x000004834000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
0x000004834000-0x000004835000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_core-amd64-linux.so
0x000004835000-0x000004837000
0x000004837000-0x00000483b000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
0x00000483b000-0x000004845000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
0x000004845000-0x000004848000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
0x000004848000-0x000004849000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
0x000004849000-0x00000484a000 /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so
0x00000484a000-0x000004865000
0x000004867000-0x000004868000 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
0x000004868000-0x00000486a000 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
0x00000486a000-0x00000486b000 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
0x00000486b000-0x00000486c000 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
0x00000486c000-0x00000486d000 /usr/lib/x86_64-linux-gnu/libdl-2.31.so
0x00000486d000-0x00000487a000 /usr/lib/x86_64-linux-gnu/libm-2.31.so
0x00000487a000-0x000004921000 /usr/lib/x86_64-linux-gnu/libm-2.31.so
0x000004921000-0x0000049ba000 /usr/lib/x86_64-linux-gnu/libm-2.31.so
0x0000049ba000-0x0000049bb000 /usr/lib/x86_64-linux-gnu/libm-2.31.so
0x0000049bb000-0x0000049bc000 /usr/lib/x86_64-linux-gnu/libm-2.31.so
0x0000049bc000-0x0000049c0000 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
0x0000049c0000-0x0000049cb000 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
0x0000049cb000-0x0000049cf000 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
0x0000049cf000-0x0000049d0000 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
0x0000049d0000-0x0000049d1000 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
0x0000049d1000-0x0000049e9000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x0000049e9000-0x000004a74000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x000004a74000-0x000004b08000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x000004b08000-0x000004b09000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x000004b09000-0x000004b0a000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x000004b0a000-0x000004b0e000 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x000004b0e000-0x000004b14000 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
0x000004b14000-0x000004b25000 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
0x000004b25000-0x000004b2b000 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
0x000004b2b000-0x000004b2c000 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
0x000004b2c000-0x000004b2d000 /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
0x000004b2d000-0x000004b33000
0x000004b33000-0x000004b35000 /usr/lib/x86_64-linux-gnu/librt-2.31.so
0x000004b35000-0x000004b39000 /usr/lib/x86_64-linux-gnu/librt-2.31.so
0x000004b39000-0x000004b3b000 /usr/lib/x86_64-linux-gnu/librt-2.31.so
0x000004b3b000-0x000004b3c000 /usr/lib/x86_64-linux-gnu/librt-2.31.so
0x000004b3c000-0x000004b3d000 /usr/lib/x86_64-linux-gnu/librt-2.31.so
0x000004b3d000-0x000004b40000 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
0x000004b40000-0x000004b52000 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
0x000004b52000-0x000004b56000 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
0x000004b56000-0x000004b57000 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
0x000004b57000-0x000004b58000 /usr/lib/x86_64-linux-gnu/libgcc_s.so.1
0x000004b58000-0x000004b7a000 /usr/lib/x86_64-linux-gnu/libc-2.31.so
0x000004b7a000-0x000004cf2000 /usr/lib/x86_64-linux-gnu/libc-2.31.so
0x000004cf2000-0x000004d40000 /usr/lib/x86_64-linux-gnu/libc-2.31.so
0x000004d40000-0x000004d44000 /usr/lib/x86_64-linux-gnu/libc-2.31.so
0x000004d44000-0x000004d46000 /usr/lib/x86_64-linux-gnu/libc-2.31.so
0x000004d46000-0x000004d4a000
0x000004d4a000-0x000004d55000 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
0x000004d55000-0x000004d69000 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
0x000004d69000-0x000004d72000 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
0x000004d72000-0x000004d73000 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
0x000004d73000-0x000004d74000 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
0x000004d74000-0x000004d75000 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
0x000004d75000-0x000004d77000 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
0x000004d77000-0x000004d78000 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
0x000004d78000-0x000004d79000 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
0x000004d79000-0x000004d7a000 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
0x000004d7a000-0x000004d7c000
0x000004d7c000-0x000004d7e000 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
0x000004d7e000-0x000004d80000 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
0x000004d80000-0x000004d82000 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
0x000004d82000-0x000004d83000 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
0x000004d83000-0x000004d84000 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
0x000004d84000-0x000004d88000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d88000-0x000004d97000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d97000-0x000004d9a000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d9a000-0x000004d9b000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d9b000-0x000004d9c000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d9c000-0x000004d9d000 /usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0
0x000004d9d000-0x0000050f2000
0x0000050f2000-0x0000054f2000
0x0000054f2000-0x0000054f6000
0x000058000000-0x000058001000 /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
0x000058001000-0x0000581f6000 /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
0x0000581f6000-0x000058294000 /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
0x000058294000-0x00005829a000 /usr/lib/x86_64-linux-gnu/valgrind/memcheck-amd64-linux
0x00005829a000-0x000059c9d000
0x001002001000-0x001002c16000
0x001002c8c000-0x001002cb0000
0x001002cb0000-0x001002cb2000
0x001002cb2000-0x001002db2000
0x001002db2000-0x001002db4000
0x001002db4000-0x001002db5000 /tmp/vgdb-pipe-shared-mem-vgdb-36063-by-gsap-on-???
0x001002db5000-0x001004f01000
0x001005075000-0x001005375000
0x001005481000-0x001005681000
0x001006450000-0x001006550000
0x001006745000-0x001006985000
0x001ffeffe000-0x001fff001000
0x7ffcf678d000-0x7ffcf67ae000 [stack]
0x7ffcf67bb000-0x7ffcf67be000 [vvar]
0xffffffffff600000-0xffffffffff601000 [vsyscall]
==36063==End of process memory map.
==36063==
==36063== HEAP SUMMARY:
==36063== in use at exit: 0 bytes in 0 blocks
==36063== total heap usage: 14 allocs, 14 frees, 580 bytes allocated
==36063==
==36063== All heap blocks were freed -- no leaks are possible
==36063==
==36063== For lists of detected and suppressed errors, rerun with: -s
==36063== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Je pense que tu dois quitter ton programme plus tot si jamais tu as une erreur de parsing/fichier
Oooohh merciii pour ce checking de qualité !
De : Gaëtan SAP @.> Envoyé : mardi 12 juillet 2022 18:24 À : vietdu91/42_cub3d_ongoing @.> Cc : Subscribed @.***> Objet : Re: [vietdu91/42_cub3d_ongoing] Segfault en mode dark (Issue #1)
Erreur avec fsanitize si tu ouvres cub3D avec un dossier en parametre :
AddressSanitizer:DEADLYSIGNAL
==34140==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x0000004efb30 bp 0xbebebebebebebebe sp 0x7fff91e59ba0 T0) ==34140==The signal is caused by a READ memory access. ==34140==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used.
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x4efb30) in mlx_destroy_image ==34140==ABORTING
— Reply to this email directly, view it on GitHubhttps://github.com/vietdu91/42_cub3d_ongoing/issues/1#issuecomment-1181982270, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASXISSJ6XUY55MXEJC5DNHDVTWL4VANCNFSM53LS57FA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Si tu prends la grande map big couloir en mode dark et que tu regardes l'ennemie tu as un segfault quand tu t'approches. Rapport de fsanitize:
AddressSanitizer:DEADLYSIGNAL
==33963==ERROR: AddressSanitizer: SEGV on unknown address 0x631ffffff07c (pc 0x0000004e5d29 bp 0x7ffdc0d88be0 sp 0x7ffdc0d88b90 T0) ==33963==The signal is caused by a READ memory access.
0 0x4e5d29 in store_color /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/sprites/sprites_draw.c:48:10
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/sprites/sprites_draw.c:48:10 in store_color ==33963==ABORTING
Un deuxieme sur la map peppa en dark mode toujours :)
================================================================= ==35478==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6320000005a4 at pc 0x0000004e5d25 bp 0x7ffdf783d430 sp 0x7ffdf783d428 READ of size 4 at 0x6320000005a4 thread T0
0 0x4e5d24 in store_color /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/sprites/sprites_draw.c:48:10
0x6320000005a4 is located 604 bytes to the left of 90000-byte region [0x632000000800,0x632000016790) allocated by thread T0 here:
0 0x49785d in malloc (/mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/cub3D+0x49785d)
SUMMARY: AddressSanitizer: heap-buffer-overflow /mnt/nfs/homes/gsap/Documents/in_progress/cub3d_Manu_Dim/srcs/sprites/sprites_draw.c:48:10 in store_color Shadow bytes around the buggy address: 0x0c647fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c647fff80b0: fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff80d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff80e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c647fff8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==35478==ABORTING
Peut etre voir les couleurs de l'ennemie ?