.
4. Implementar la función estaEnTRefugio y ejecutar el caso de prueba refugio3-esta.
Número de respuestas: 4
En respuesta a Sofia Tito Virgilio Rodriguez
Re: 4. Implementar la función estaEnTRefugio y ejecutar el caso de prueba refugio3-esta.
Buenas noches, ultimamente estuve tienendo un error el cual nose a que se debe, ya probe mil cosas, cambie el codigo pero sigue persisitiendo, trate de ejecutar el caso de prueba a mano y el error salta cuando escribo el comando estaEnRefugio 5 el , adjunto imagen del error
En respuesta a Luis Emilio Martínez Lechini
Re: 4. Implementar la función estaEnTRefugio y ejecutar el caso de prueba refugio3-esta.
Buenas,
El error ocurre porque esta tratando de acceder a memoria no reservada de un identificador. Es probable que te estés pasando de rango al recorrer el arreglo con tope del refugio.
Saludos,
Ignacio.
El error ocurre porque esta tratando de acceder a memoria no reservada de un identificador. Es probable que te estés pasando de rango al recorrer el arreglo con tope del refugio.
Saludos,
Ignacio.
En respuesta a Sofia Tito Virgilio Rodriguez
Re: 4. Implementar la función estaEnTRefugio y ejecutar el caso de prueba refugio3-esta.
Hola, buenos días. El unico caso de prueba que me da mal es refugio 3. Lo que me devuelve valgrind es:
valgrind --leak-check=full ./principal < test/refugio3-esta-obtener.in
==22483== Memcheck, a memory error detector
==22483== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22483== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==22483== Command: ./principal
==22483==
1>2># creo cuatro perros para ingresarlos al refugio .
principal: principal.cpp:260: void main_crearPerro(rep_perro*&, rep_fecha*&): Assertion `(perro == NULL) && (fecha != NULL)' failed.
==22483==
==22483== Process terminating with default action of signal 6 (SIGABRT)
==22483== at 0x4B269FC: __pthread_kill_implementation (pthread_kill.c:44)
==22483== by 0x4B269FC: __pthread_kill_internal (pthread_kill.c:78)
==22483== by 0x4B269FC: pthread_kill@@GLIBC_2.34 (pthread_kill.c:89)
==22483== by 0x4AD2475: raise (raise.c:26)
==22483== by 0x4AB87F2: abort (abort.c:79)
==22483== by 0x4AB871A: __assert_fail_base.cold (assert.c:94)
==22483== by 0x4AC9E95: __assert_fail (assert.c:103)
==22483== by 0x109CFD: main_crearPerro(rep_perro*&, rep_fecha*&) (principal.cpp:260)
==22483== by 0x109508: main (principal.cpp:123)
==22483==
==22483== HEAP SUMMARY:
==22483== in use at exit: 79,008 bytes in 8 blocks
==22483== total heap usage: 13 allocs, 5 frees, 79,566 bytes allocated
==22483==
==22483== LEAK SUMMARY:
==22483== definitely lost: 0 bytes in 0 blocks
==22483== indirectly lost: 0 bytes in 0 blocks
==22483== possibly lost: 0 bytes in 0 blocks
==22483== still reachable: 79,008 bytes in 8 blocks
==22483== suppressed: 0 bytes in 0 blocks
==22483== Reachable blocks (those to which a pointer was found) are not shown.
==22483== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==22483==
==22483== For lists of detected and suppressed errors, rerun with: -s
==22483== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted (core dumped)
valgrind --leak-check=full ./principal < test/refugio3-esta-obtener.in
==22483== Memcheck, a memory error detector
==22483== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22483== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==22483== Command: ./principal
==22483==
1>2># creo cuatro perros para ingresarlos al refugio .
principal: principal.cpp:260: void main_crearPerro(rep_perro*&, rep_fecha*&): Assertion `(perro == NULL) && (fecha != NULL)' failed.
==22483==
==22483== Process terminating with default action of signal 6 (SIGABRT)
==22483== at 0x4B269FC: __pthread_kill_implementation (pthread_kill.c:44)
==22483== by 0x4B269FC: __pthread_kill_internal (pthread_kill.c:78)
==22483== by 0x4B269FC: pthread_kill@@GLIBC_2.34 (pthread_kill.c:89)
==22483== by 0x4AD2475: raise (raise.c:26)
==22483== by 0x4AB87F2: abort (abort.c:79)
==22483== by 0x4AB871A: __assert_fail_base.cold (assert.c:94)
==22483== by 0x4AC9E95: __assert_fail (assert.c:103)
==22483== by 0x109CFD: main_crearPerro(rep_perro*&, rep_fecha*&) (principal.cpp:260)
==22483== by 0x109508: main (principal.cpp:123)
==22483==
==22483== HEAP SUMMARY:
==22483== in use at exit: 79,008 bytes in 8 blocks
==22483== total heap usage: 13 allocs, 5 frees, 79,566 bytes allocated
==22483==
==22483== LEAK SUMMARY:
==22483== definitely lost: 0 bytes in 0 blocks
==22483== indirectly lost: 0 bytes in 0 blocks
==22483== possibly lost: 0 bytes in 0 blocks
==22483== still reachable: 79,008 bytes in 8 blocks
==22483== suppressed: 0 bytes in 0 blocks
==22483== Reachable blocks (those to which a pointer was found) are not shown.
==22483== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==22483==
==22483== For lists of detected and suppressed errors, rerun with: -s
==22483== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted (core dumped)
En respuesta a Eric Imanol Rodríguez Espinosa
Re: 4. Implementar la función estaEnTRefugio y ejecutar el caso de prueba refugio3-esta.
Buenas,
Probaste de correr el caso a mano? Así podes ver en qué momento salta el error.
Saludos
Probaste de correr el caso a mano? Así podes ver en qué momento salta el error.
Saludos