This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Bug in openrisc __malloc_lock
- From: Stefan Wallentowitz <stefan dot wallentowitz at tum dot de>
- To: newlib at sourceware dot org, julius dot schmidt at argondesign dot com
- Date: Mon, 03 Aug 2015 11:32:28 +0200
- Subject: Re: Bug in openrisc __malloc_lock
- Authentication-results: sourceware.org; auth=none
- References: <90ad8c9df79e4e8caf3d46e7292bd78f at SEHSTE15D3BE7 dot hs20 dot net>
Hi Julius,
On 03.08.2015 11:25, Julius Schmidt wrote:
> I believe there is a bug in the openrisc implementation of __malloc_lock:
> The lines
> restore = or1k_critical_begin();
> _or1k_malloc_lock_restore = restore;
> are executed every time _malloc_lock is called. If __malloc_lock is called recursively then the
> old value of restore will be forgotten and so interrupts will remain disabled even after the
> required number of __malloc_unlock calls.
Sorry, I got obstructed during my last upstreaming efforts and this was
something that was fixed recently
(https://github.com/openrisc/newlib/commit/3e342ed01b69304f18595c982a6c2383457eeb78).
You can find the proper version at the OpenRISC development repository:
https://github.com/openrisc/newlib/blob/or1k/newlib/libc/sys/or1k/mlock.c
I will prepare the upstream patches asap, sorry for the inconvenience.
Best,
Stefan