Skip to content

Python hal.is_rt / hal.is_sim is broken #4129

@hdiethelm

Description

@hdiethelm

PyModule_AddIntConstant(m, "is_rt", rtapi_is_realtime());

^ this is broken: The value is_rt is always false due to rtapi_is_realtime() checks if the actual process is real time capable. But the python runtime is hopefully never setuid... ;-)

Fixing that one is a bit difficult, we would have to call rtapi_app to get the true rtapi_is_realtime() value of the rtapi_app process.

Alternative: Just remove is_rt / is_sim. I would have a halcmd getrt POC ready that does exactly ^. But it needs some finalizing / doc. As much as I know, there is only the halcmd way to execute actions inside the rtapi_app process.

Looking at the initial commit, this worked more or less:
3eac731
until a setuid check was added in detect_realtime(), which broke it for user components:
2faa909

It was broken in:
#3964
to fix the inconsistency of rtapi_is_realtime(): #3928

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions