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

Small FFM race fix and small cleanup #84

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

bgilbert
Copy link
Member

@bgilbert bgilbert commented May 3, 2024

When OpenSlide returns a pointer to a structure inside the openslide_t, we need to hold the OpenSlideRef lock until we're done copying out the returned data. This prevents another thread from closing the openslide_t out from under us.

Drop redundant OpenSlideFFM null checks. These were carried over from the JNI implementation, where they were needed to prevent segfaults. With FFM, each of the affected variables is passed to arena.allocateFrom(), which properly throws a NullPointerException on null. That seems more correct than returning a method-specific sentinel value, since none of these methods should ever receive null in normal operation.

These were carried over from the JNI implementation, where they were
needed to prevent segfaults.  With FFM, each of the affected variables is
passed to arena.allocateFrom(), which properly throws a
NullPointerException on null.  That seems more correct than returning a
method-specific sentinel value, since none of these methods should ever
receive null in normal operation.

Signed-off-by: Benjamin Gilbert <bgilbert@cs.cmu.edu>
When OpenSlide returns a pointer to a structure inside the openslide_t, we
need to hold the OpenSlideRef lock until we're done copying out the
returned data.  This prevents another thread from closing the openslide_t
out from under us.

Fixes: 6d10501 ("Push locking down into OpenSlideFFM")
Signed-off-by: Benjamin Gilbert <bgilbert@cs.cmu.edu>
@openslide-bot
Copy link

DCO signed off ✔️

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

@bgilbert bgilbert merged commit 8be2d71 into openslide:main May 3, 2024
5 checks passed
@bgilbert bgilbert deleted the ffm branch May 3, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants