[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] Bug in core/mem.c
From: |
Jason White |
Subject: |
Re: [lwip-devel] Bug in core/mem.c |
Date: |
Tue, 17 Apr 2018 13:17:26 -0400 |
Is there a bug filed for this?
-----Original Message-----
From: lwip-devel <address@hidden> On Behalf Of Matthias Pfaller
Sent: Tuesday, April 17, 2018 8:00 AM
To: address@hidden
Subject: [lwip-devel] Bug in core/mem.c
Hi,
I just tracked down a bug in mem.c that leads to sporadic memory corruption
when LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is active.
I think lfree needs to be declared volatile (static struct mem * volatile
lfree). Otherwise the compiler might use the old value of lfree at the top of
the for-loop in mem_malloc.
regards, Matthias
--
Matthias Pfaller Software Entwicklung
marco Systemanalyse und Entwicklung GmbH Tel +49 8131 5161 41
Hans-Böckler-Str. 2, D 85221 Dachau Fax +49 8131 5161 66
http://www.marco.de/ Email address@hidden
Geschäftsführer Martin Reuter HRB 171775 Amtsgericht München