From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#36402: installation error Date: Thu, 27 Jun 2019 23:08:00 +0200 Message-ID: <87lfxmu47j.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:55126) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgbdi-00007H-P9 for bug-guix@gnu.org; Thu, 27 Jun 2019 17:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgbdg-0002p1-I1 for bug-guix@gnu.org; Thu, 27 Jun 2019 17:09:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgbde-0002ni-RE for bug-guix@gnu.org; Thu, 27 Jun 2019 17:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgbde-0003AF-KZ for bug-guix@gnu.org; Thu, 27 Jun 2019 17:09:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: (Juan's message of "Thu, 27 Jun 2019 01:47:51 +0000") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Juan Cc: Mathieu Othacehe , 36402@debbugs.gnu.org Hi Juan, Juan skribis: > I ran into some trouble while attempting to install Guix SD (1.0.1.x86_64= ). It happens when I try to do the guided graphical installation, I'll tran= script the whole text here: [...] > 755:33 14 (run-partitioning-page) > In ./gnu/installer/parted.scm: > 1010:14 13 (auto-partition! #< bytestructure: #> #:scheme _) > 870:21 12 (loop _ _ _) > 863:17 11 (loop _ 2617712816 1289318400) > 771:25 10 (mkpart #< bytestructure: #>= _ #:previous-partition _) > In parted/structs.scm: > 552:19 9 (pointer->partition _) > 132:3 8 (pointer->bytestructure # #) > In unknown file: > 7 (pointer->bytevector # 88 # #) > In ice-9/boot.scm: > 751:25 6 (dispatch-exception 5 null-pointer-error ("pointer->bytevect= or" "null pointer dereference" () ())) That looks like what was reported at , so I=E2=80=99ve merged both. Th= anks for the report, Juan! Mathieu, in the same spirit as , I think we have an object life cycle and memory management issue. I hadn=E2=80=99t noticed but we=E2=80=99re doing manual memory management b= y calling things like =E2=80=98disk-destroy=E2=80=99 in the installer. That=E2=80=99= s crash-prone and best avoided. The usual way to handle it in bindings is by: 1. Adding pointer finalizers. So for example the pointer object associated with a record would have a finalizer that calls =E2=80=98ped_disk_destroy=E2=80=99. 2. Having a weak-key hash table to track object dependencies when needed. So, if a aggregates a , there must be an entry in the hash table that maps the to the . That way, we ensure that the object remains live as long as the is live. We can expose =E2=80=9Cclose=E2=80=9D functions that free OS resources such= as file descriptors, but we should not expose deallocation functions like =E2=80=98ped_disk_destroy=E2=80=99; instead, we let the GC call them when t= he objects become unreachable. Does that make sense? I think we should audit and adjust Guile-Parted in that spirit. WDYT? Thanks, Ludo=E2=80=99.