Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package guile-parted for openSUSE:Factory 
checked in at 2023-06-26 18:15:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/guile-parted (Old)
 and      /work/SRC/openSUSE:Factory/.guile-parted.new.15902 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "guile-parted"

Mon Jun 26 18:15:59 2023 rev:6 rq:1095259 version:0.0.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/guile-parted/guile-parted.changes        
2022-09-25 15:35:44.215685629 +0200
+++ /work/SRC/openSUSE:Factory/.guile-parted.new.15902/guile-parted.changes     
2023-06-26 18:16:09.322486758 +0200
@@ -1,0 +2,6 @@
+Sun Jun 18 20:39:21 UTC 2023 - Jonathan Brielmaier <[email protected]>
+
+- Update to 0.0.7:
+  * Remove the finalizer on device pointers 
+
+-------------------------------------------------------------------

Old:
----
  guile-parted-0.0.6.tar.gz

New:
----
  guile-parted-0.0.7.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ guile-parted.spec ++++++
--- /var/tmp/diff_new_pack.xx8tqh/_old  2023-06-26 18:16:09.926489442 +0200
+++ /var/tmp/diff_new_pack.xx8tqh/_new  2023-06-26 18:16:09.930489459 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package guile-parted
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           guile-parted
-Version:        0.0.6
+Version:        0.0.7
 Release:        0
 Summary:        Guile bindings to Parted
 License:        GPL-3.0-or-later

++++++ guile-parted-0.0.6.tar.gz -> guile-parted-0.0.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/guile-parted-0.0.6/parted/device.scm 
new/guile-parted-0.0.7/parted/device.scm
--- old/guile-parted-0.0.6/parted/device.scm    2022-08-08 17:08:00.000000000 
+0200
+++ new/guile-parted-0.0.7/parted/device.scm    2022-11-10 13:20:10.000000000 
+0100
@@ -1,5 +1,5 @@
 ;;; Guile-parted --- GNU Guile bindings of libparted
-;;; Copyright © 2018, 2019 Mathieu Othacehe <[email protected]>
+;;; Copyright © 2018, 2019, 2022 Mathieu Othacehe <[email protected]>
 ;;;
 ;;; This file is part of Guile-parted.
 ;;;
@@ -43,20 +43,23 @@
             device-get-minimum-alignment
             device-get-optimum-alignment))
 
-;; Record all devices, so that pointer finalizers are only set once,
-;; even if get-device returns an already known pointer.  Use the
-;; pointer as key and the associated <device> as value.
-(define %devices (make-weak-value-hash-table))
-
-(define %device-destroy
-  (libparted->pointer "ped_device_destroy"))
+;; Record all devices, so that we do not end up with different <device>
+;; objects aliasing the same underlying C pointer. Use the pointer as key and
+;; the associated <device> as value.
+(define %devices (make-hash-table))
 
+;; %DEVICES was a weak hash-table and we used to set a finalizer on POINTER.
+;; This is inevitably causing double free issues for the following reason:
+;;
+;; When <device> goes out of scope and is removed from the %DEVICES table, the
+;; finalizer that is set on the underlying C pointer is still registered but
+;; possibly not called as finalization happens is a separate thread.  If a
+;; subsequent call to ped_device_get returns the same C pointer, another
+;; finalizer will be registered.  This means that the finalization function
+;; can be called twice on the same pointer, causing a double free issue.
 (define (pointer->device! pointer)
-  ;; Check if a finalizer is already registered for this pointer.
   (or (hash-ref %devices pointer)
       (let ((device (pointer->device pointer)))
-        ;; Contrary to its name, this "adds" a finalizer.
-        (set-pointer-finalizer! pointer %device-destroy)
         (hash-set! %devices pointer device)
         device)))
 

Reply via email to