Skip to content

Fix segfaults #1368

New issue

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

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

Already on GitHub? # to your account

Merged
merged 4 commits into from
Sep 6, 2020
Merged

Fix segfaults #1368

merged 4 commits into from
Sep 6, 2020

Conversation

mohd-akram
Copy link
Contributor

@mohd-akram mohd-akram commented Aug 5, 2020

This PR makes TRY_CATCH_CALL return on failure, and to enable proper cleanup, replaces usage of delete with smart pointers. It also fixes two sources of segmentation faults.

Fixes #1026, fixes #1323.

@mohd-akram mohd-akram mentioned this pull request Aug 6, 2020
@jjhbw
Copy link

jjhbw commented Aug 7, 2020

Seems to fix #1323

If the database was being closed, and non-exclusive work was scheduled,
it overrode the lock flag such that the state became open=false locked=false
instead of open=false locked=true. This caused queued work to not be
processed, leaking memory, which causes a segfault during napi cleanup.

Make the same changes to other methods for safe measure.
@kewde
Copy link
Collaborator

kewde commented Sep 6, 2020

Thanks again!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segmentation fault / EXC_BAD_ACCESS / KERN_INVALID_ADDRESS when closing DB when a query is in progress Segmentation Fault
3 participants