#4 Guard against garbage collection issues with pointers

Merged
cwebber merged 2 commits from cbaines/fix-garbage-collection-issues-with-parameter-pointers into cwebber/master 3 years ago

I've been seeing "invalid byte sequence for encoding" errors from PostgreSQL, which seem to coincide with doing a query just as garbage collection happens.

I believe the code is vulnerable to a race condition, although it's unlikely to crop up unless you're executing a lot of quick queries while Guile is doing frequent garbage collection operations.

This has been cropping up for me with the Guix Data Service.

I've been seeing "invalid byte sequence for encoding" errors from PostgreSQL, which seem to coincide with doing a query just as garbage collection happens. I believe the code is vulnerable to a race condition, although it's unlikely to crop up unless you're executing a lot of quick queries while Guile is doing frequent garbage collection operations. This has been cropping up for me with the Guix Data Service.
cwebber commented 3 years ago
Owner

For whatever reason I thought this repo had moved somewhere else or I had passed on maintainership. But now I don't see the package anywhere else...

Anyway I don't fully understand how this fixes the issue, but I believe you that it does. I'm going to merge it because I don't see how it can cause any harm and clearly without it, harm is being caused.

By the way, I don't suppose you'd like commit access to the project?

For whatever reason I thought this repo had moved somewhere else or I had passed on maintainership. But now I don't see the package anywhere else... Anyway I don't fully understand how this fixes the issue, but I believe you that it does. I'm going to merge it because I don't see how it can cause any harm and clearly without it, harm is being caused. By the way, I don't suppose you'd like commit access to the project?
Christopher Baines commented 3 years ago
Collaborator

Awesome, thanks! I wouldn't mind commit access. I've been using this for the Guix Data Service [1] for a few years now. I hacked in some NULL handling as well [2] which I should probably look at sorting out properly.

1: https://data.guix.gnu.org/README 2: https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/database.scm#n180

Awesome, thanks! I wouldn't mind commit access. I've been using this for the Guix Data Service [1] for a few years now. I hacked in some NULL handling as well [2] which I should probably look at sorting out properly. 1: https://data.guix.gnu.org/README 2: https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/database.scm#n180
cwebber commented 3 years ago
Owner

You've got commit access now! With great power comes great responsibility, etc.

You've got commit access now! With great power comes great responsibility, etc.
This pull request has been merged successfully!
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.