This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Bug in openrisc __malloc_lock
- From: Julius Schmidt <julius dot schmidt at argondesign dot com>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Mon, 3 Aug 2015 09:25:17 +0000
- Subject: Bug in openrisc __malloc_lock
- Authentication-results: sourceware.org; auth=none
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.
Am I missing something or should these lines be moved into the if() statement?
Julius Schmidt
Argon Design