Closed julchat closed 3 years ago
Buenas Cris, primero que nada te menciono que de nuestro lado se nos hace mucho mas rapido leer codigo formateado. Esto lo podes hacer con esto.
Respecto a tu error, dice doble free o corruption. El doble free, significa que al momento que queres liberar esa memoria, alguien lo hizo antes.
Como primera recomendacion, te diria que lo corras con valgrind para analizarlo mejor. Algo que vi en la función de serialización, es que al hacer los memcpy sobre content pero no te vas desplazando el offset.
Si queres podes compartir el log del valgrind (con formato Markdown).
Pd: podes ejecutar valgrind --log-file="filename"
para llevar todo el output de valgrind a un archivo.
Pd2: Como usar valgrind?
¡Buenas buenas!
¿Como va? ¿Pudiste solucionar el problema? 😺
¡Saludos!
Cierro por inactividad, pero cualquier cosa, no dudes en abrirlo 😄 .
Hola, estuve queriendo hacer pruebas por la consola de cliente, y para primero probar al cliente como si, lo debugee. La siguiente función me trajo problemas
Con la función de serializar siendo
Cuando yo le hago free a (paquete->content), al que lo igualé cuando entré en el switch (entró, lo vi en el debugeo) e use la función de serializar que me devuelve un void* malloqueado, me rompe todo y me tira esto.