unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <m.othacehe@gmail.com>
Cc: 36402@debbugs.gnu.org, Juan <r5jm@protonmail.com>
Subject: bug#36402: installation error
Date: Thu, 05 Sep 2019 10:32:18 +0200	[thread overview]
Message-ID: <87pnkfi1nx.fsf@gnu.org> (raw)
In-Reply-To: <87imq8tf88.fsf@gmail.com> (Mathieu Othacehe's message of "Wed, 04 Sep 2019 14:31:35 +0200")

Hello!

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> And here is what was going wrong:
>
> ped_device_get and ped_device_get_next can return pointers to already
> existing device object. So set-pointer-finalizer! was possibly called
> multiple times on the same device pointer, resulting in calling
> ped_device_destroy multiple times on the same device pointer.
>
> To prevent that, I created a weak value hash table to make sure that one
> <device> object maps to exactly one device pointer, and that the pointer
> finalizer is set only once. See commit b35839b.

Good catch!

I confirm that:

  guix build guile-parted --with-branch=guile-parted=master --check

passed several times in a row.  :-)

b35839b LGTM!

(‘define-wrapped-pointer-type’ takes care of this, but we can’t use it
while we use bytestructures (info "(guile) Void Pointers and Byte
Access").)

It seems to me that the fix should be not just for ‘pointer->device!’
but for all the ‘pointer->RECORD!’ procedures, where we potentially have
similar scenarios, and where we’d rather have:

  (eq? (pointer->X ptr) (pointer->X ptr))

So perhaps you should define your own ‘define-wrapped-type’ macro that
does ‘define-record-type’ + the weak hash table thing, and replace all
‘define-record-type’ instances in structs.scm with
‘define-wrapped-type’.  How does that sound?

Thank you!

Ludo’.

  reply	other threads:[~2019-09-05  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27  1:47 bug#36402: installation error Juan
2019-06-27 21:08 ` Ludovic Courtès
2019-06-29 15:47   ` Mathieu Othacehe
2019-07-02 13:25     ` Ludovic Courtès
2019-08-31 18:43   ` Mathieu Othacehe
2019-09-01 19:55     ` Ludovic Courtès
2019-09-02  9:50       ` Mathieu Othacehe
2019-09-03  9:13         ` Ludovic Courtès
2019-09-04 12:31           ` Mathieu Othacehe
2019-09-05  8:32             ` Ludovic Courtès [this message]
2019-09-05 13:53               ` Mathieu Othacehe
2019-09-08 19:35                 ` Ludovic Courtès
2020-03-18 17:56                   ` Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnkfi1nx.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=36402@debbugs.gnu.org \
    --cc=m.othacehe@gmail.com \
    --cc=r5jm@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).