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

Avoid assert failure when NULL EC is expected #5156

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Nov 22, 2021

After 5680c38, postponed job APIs now
expect to be called on native threads not managed by Ruby and handles
getting a NULL execution context. However, in debug builds the change
runs into an assertion failure with GET_EC() which asserts that EC is
non-NULL. Avoid the assertion failure by passing false for expect_ec
instead as the intention is to handle when there is no EC.

Add a test from John Crepezzi and John Hawthorn to exercise this
situation.

[Bug #17573]

Co-authored-by: John Hawthorn john@hawthorn.email
Co-authored-by: John Crepezzi john.crepezzi@gmail.com

@XrXr XrXr marked this pull request as draft November 22, 2021 22:46
After 5680c38, postponed job APIs now
expect to be called on native threads not managed by Ruby and handles
getting a NULL execution context. However, in debug builds the change
runs into an assertion failure with GET_EC() which asserts that EC is
non-NULL. Avoid the assertion failure by passing `false` for `expect_ec`
instead as the intention is to handle when there is no EC.

Add a test from John Crepezzi and John Hawthorn to exercise this
situation.

[Bug #17573]

Co-authored-by: John Hawthorn <john@hawthorn.email>
Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
@XrXr XrXr marked this pull request as ready for review November 22, 2021 22:47
@XrXr
Copy link
Member Author

XrXr commented Nov 22, 2021

I'm a bit worried about using pthread in test in the shared library as linking might go wrong on esoteric systems. CI seems fine though so it should be okay.

@XrXr XrXr merged commit f5d2041 into ruby:master Nov 23, 2021
@XrXr XrXr deleted the fix-null-ec-assert branch November 23, 2021 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant