Skip to content

tests: some tests don't work with newlib lock functions. #12732

Open
@gschorcht

Description

Description

The following test applications call puts inside an ISR which can lead to problems when newlib's locking functions are implemented by the platform:

tests/isr_yield_higher
tests/periph_rtc

Background

newlib's reentrant versions of system calls use lock functions for different lock objects. For example, puts locks the stdout file using _lock_acquire_recursive. While the lock functions in single-thread environments are only dummies, these functions would have to be implemented by the operating system in multi-thread environments.

The only reasonable way in RIOT to realize these lock functions

_lock_acquire
_lock_acquire_reusrive
_lock_try_acquire
_lock_try_acquire_reusrive

seems to be RIOT's built-in mechanism mutex and rmutex. Since mutex and rmutex don't work in interrupt context, system calls must not be used in ISRs.

The problem was found out in PR #11108.

Steps to reproduce

Enable locking functions in cpu/esp8266/syscalls.c in PR #11108 and flash tests/isr_yield_higher

make BOARD=esp8266-esp-12x -C tests/isr_yield_higher

Metadata

Assignees

Labels

Area: testsArea: tests and testing frameworkType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions