Closed btrevizan closed 5 years ago
Parece ser de fato um problema oriundo da inicilização do programa. Em qual sistema isso é obtido?
Em um Linux recente, a lista obtida com o comando valgrind --leak-check=full ./imsobuggy
é a seguinte:
==29557== Memcheck, a memory error detector
==29557== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==29557== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==29557== Command: ./imsobuggy
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x1092DC: VectorSet (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091CD: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x10948B: ResizeArray (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x109307: VectorSet (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091CD: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x1094BA: ResizeArray (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x109307: VectorSet (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091CD: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Use of uninitialised value of size 8
==29557== at 0x1094A8: ResizeArray (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x109307: VectorSet (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091CD: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE8CA: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109531: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Use of uninitialised value of size 8
==29557== at 0x48BA7BB: _itoa_word (_itoa.c:179)
==29557== by 0x48BDFAF: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109531: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BA7C5: _itoa_word (_itoa.c:179)
==29557== by 0x48BDFAF: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109531: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE053: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109531: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE134: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109531: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE8CA: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109560: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Use of uninitialised value of size 8
==29557== at 0x48BA7BB: _itoa_word (_itoa.c:179)
==29557== by 0x48BDFAF: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109560: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BA7C5: _itoa_word (_itoa.c:179)
==29557== by 0x48BDFAF: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109560: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE053: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109560: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== Conditional jump or move depends on uninitialised value(s)
==29557== at 0x48BE134: vfprintf (vfprintf.c:1642)
==29557== by 0x48C5F75: printf (printf.c:33)
==29557== by 0x109560: PrintIntVector (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091E3: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
[0,0,0,0,0,0,0,0,0,0]
==29557==
==29557== HEAP SUMMARY:
==29557== in use at exit: 528 bytes in 22 blocks
==29557== total heap usage: 23 allocs, 1 frees, 1,552 bytes allocated
==29557==
==29557== 32 bytes in 1 blocks are definitely lost in loss record 1 of 5
==29557== at 0x48357BF: malloc (vg_replace_malloc.c:299)
==29557== by 0x109214: VectorCreate (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x10918D: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== 136 (16 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 5
==29557== at 0x48357BF: malloc (vg_replace_malloc.c:299)
==29557== by 0x109200: VectorCreate (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x10918D: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== 360 bytes in 9 blocks are definitely lost in loss record 5 of 5
==29557== at 0x48357BF: malloc (vg_replace_malloc.c:299)
==29557== by 0x10943A: ResizeArray (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x109307: VectorSet (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557== by 0x1091CD: main (in /home/schnorr/ensino/github/mlp/catps/def/17/imsobuggy)
==29557==
==29557== LEAK SUMMARY:
==29557== definitely lost: 408 bytes in 11 blocks
==29557== indirectly lost: 120 bytes in 11 blocks
==29557== possibly lost: 0 bytes in 0 blocks
==29557== still reachable: 0 bytes in 0 blocks
==29557== suppressed: 0 bytes in 0 blocks
==29557==
==29557== For counts of detected and suppressed errors, rerun with: -v
==29557== Use --track-origins=yes to see where uninitialised values come from
==29557== ERROR SUMMARY: 58 errors from 17 contexts (suppressed: 0 from 0)
Parece ser de fato um problema oriundo da inicilização do programa. Em qual sistema isso é obtido?
Mac OS. São esses erros que aparecem. Por que isso acontece?
Olá @btrevizan, tudo indica que trata-se de um bug na função de inicialização de programas no Mac OS, especificamente na função objc_initializeClassPair_internal
que acaba sendo chamada quando dyldbootstrap::start
acontece.
Estou com dificuldade em identificar e corrigir os erros do
imsobuggy
. O valgrind está apresentando erros como:Parecem ser erros de alguma biblioteca. Porém, como faço para corrigir esses erros? Tentei verificar se não é o próprio programa que causa esses erros, mas não cheguei a nenhuma conclusão.