Domanda

Quando si esegue il mio programma ottengo i seguenti errori dal Boehm GC (con GC_DEBUG definito):

GC_check_heap_block: found smashed heap objects:
0x8ef1008 in or near object at 0x8ef1010(<smashed>, appr. sz = 29)
0x8ef1188 in or near object at 0x8ef1190(<smashed>, appr. sz = 29)
...

È possibile che questo continua di circa 20 volte.

Stranamente, non riesco a trovare niente di sbagliato con il programma, si fa quello che si suppone, e non va in crash.

I può compilare il mio programma disabilitando il GC. Poi posso correre valgrind con esso, ma stranamente, valgrind non trova alcun problema!

Potrebbe essere un problema all'interno Boehm GC -? Devo solo ignorarlo

Qualcuno ha qualche idea su come eseguire il debug in modo efficace questo?

In alternativa, qualcuno può spiegare che cosa precisamente il messaggio di cui sopra mezzi

È stato utile?

Soluzione

To answer my own question more than 3 months later...

I've tried logging every pointer into a file, and comparing with pointers that gave the smashed warning. However, that didn't lead anywhere, the suspect pointers were coming from various allocations all over the codebase (no one particular place that was maybe broken).

In the meantime, without GC, valgrind didn't report any errors, but of course that doesn't mean it's not possible errors still exist.

However, I figured I'd try if this particular version of the GC has a subtle bug maybe. I was using the latest stable version GC 7.1. I upgraded to 7.2alpha4, and the problem went away!

If someone runs across this, hopefully this will help.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top