Skip to content

Avoid race condition in kernel launch and kernel finish (Windows Only) #38

Open
@sherry-yuan

Description

@sherry-yuan

A follow-up to #37

Kernel interrupt are sent when kernel changed status from init to running, however this case was not checked in the signal handler

void acl_kernel_if_update_status(acl_kernel_if *kern) {

And previously it was assumed that the finish bit must be set after checking "all other possible cases" (i.e buffer full, profiler interrupt). This assumption was enforced by an assert statement which was removed in #37. It was temporarily removed because the "all other possible case" did not cover all the possible case, namely it missed the "kernel running" status. This means it is possible that no kernel finishes when reaching the check for finish count, and assertion of finish_count > 0.

The full solution is to add additional checking on status register's values so that we don't reach the final "kernel finish" case checking without checking for kernel running status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions