Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native getchar is blocking RIOT #16834

Open
kfessel opened this issue Sep 10, 2021 · 2 comments · May be fixed by #19002
Open

native getchar is blocking RIOT #16834

kfessel opened this issue Sep 10, 2021 · 2 comments · May be fixed by #19002
Assignees
Labels
Area: cpu Area: CPU/MCU ports Platform: native Platform: This PR/issue effects the native platform Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@kfessel
Copy link
Contributor

kfessel commented Sep 10, 2021

Description

On native:
getchar and therefor shell are blocking RIOT (lower than getchar priority tasks) (it does not change thread since it does no use the internal mutex)

This is an stdio on native problem ztimer is just used for demonstration purposes.

Steps to reproduce the issue

I just attached en example (inside the zip since zip is much saver than demo.c and a Makefile - maybe there is another reasoning for the choice of attachables)

bug_stdio.zip

$ make
$ make term

> hello HULK

second arg to hello will be interpreted as int offset for the priority of the hello (-1 will put it in front and block shell, this is expecteted as it is spinning on a ztimer)

The same problem exists if ztimer sleep is used but it does not show as nice

Expected results

HULK shall be greeted every 2 seconds while the shell keeps running

running that same thing on non native e.g. nucleo... works as expected

Actual results

no greetings to HULK shell keeps running

Versions

current RIOT

was discovered while processing #16808

#16822 does not yet help

bug_stdio.zip

@kfessel kfessel added Area: cpu Area: CPU/MCU ports Platform: native Platform: This PR/issue effects the native platform Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Sep 17, 2021
@maribu
Copy link
Member

maribu commented Jan 5, 2023

I think @benpicco had/has a PR open for a similar issue?

@benpicco benpicco linked a pull request Jan 5, 2023 that will close this issue
@benpicco
Copy link
Contributor

benpicco commented Jan 5, 2023

Yes #19002 should fix this.
The problem is that the blocking stdio masks #495 because it prevents a context switch.

With this fixed we have preemption working properly and therefore trigger floating point issues on native for tests that use floating point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Platform: native Platform: This PR/issue effects the native platform Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants