From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: Re: segmenation fault Date: Mon, 12 Jun 2017 00:09:36 +0200 Message-ID: References: <20170609.094329.1861758562085707445.post@thomasdanckaert.be> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1497219000 13786 195.159.176.226 (11 Jun 2017 22:10:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Jun 2017 22:10:00 +0000 (UTC) Cc: guile-user@gnu.org, Matt Wette To: Amirouche Boubekki Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jun 12 00:09:56 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKB3U-0003P9-2o for guile-user@m.gmane.org; Mon, 12 Jun 2017 00:09:56 +0200 Original-Received: from localhost ([::1]:35325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKB3Z-0006td-I3 for guile-user@m.gmane.org; Sun, 11 Jun 2017 18:10:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKB3D-0006tW-1N for guile-user@gnu.org; Sun, 11 Jun 2017 18:09:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKB3C-00043u-5R for guile-user@gnu.org; Sun, 11 Jun 2017 18:09:39 -0400 Original-Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:36613) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKB3B-00043i-Rs for guile-user@gnu.org; Sun, 11 Jun 2017 18:09:38 -0400 Original-Received: by mail-wr0-x22a.google.com with SMTP id v111so78340081wrc.3 for ; Sun, 11 Jun 2017 15:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8Al4T2n2mK6tBNONTlhGzf+fK+DD+9o6NJPbX+n2aEw=; b=WLC2vTw0z765pVP8LOeU4GHuHGmWX7Xjkm9WMAHdzquyxhe4BWCH0lSYyynDaCHpvu CZtBI3TDdTyUVy6+DI8SAvxJD+hLNv/Jk3s5/Vd4ZMilRhiaemVfXTnkevAJBx9kDoiQ Xv//7KhjDVZe5zuXGUO34T2a+WpYV5G3gKC9mB14G3usmZEhG0wEjhWPAz+oN178upK2 lyShaQKRhU7lbbitteLBnTOZcjBV4kaitdhW1ghHgh2pZtklJfKkrD+yrPc62yg3kazI HO1nZeyNFuSSPUF3A8OBHg7l7uNATfBP/wz//jFquBe+6ajlt/u72wOKaUgaq8TkMpRY cAUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8Al4T2n2mK6tBNONTlhGzf+fK+DD+9o6NJPbX+n2aEw=; b=LBuul8Qg9jLUFjQllbaRzELm+T+QHENvTF0S0VePpc6NqaJ80QSasKu0syrbptkvJq zJN+1nP3Q2D0EEjo78HZSu9zQ4gwfXWXBKW27acpfNP6IEgyu1YQA2Yv4qLo3GkVUeXr bvooQJYj0dzptI8WaNmlsQgNm893q8F0W73UT4hGyQ9VHmSEQm1359nsA4zLw0qjKuwy 0Lp3Tq/JG8jyyR/tq/pjTq1j2N/PnIIA249BrmWvoW1gXWm1ypjS63F4+GYKAmRpV1rY hHxkWj41AS1opKnGQNj5oAjC8TqGOyftZjDY/jBlvDbws0dJLGERHTy07FmvXUXI5Lla H/zA== X-Gm-Message-State: AODbwcA0UnyVSvKGdVVS3CsPrj/f6qINl6GCmgRFmfTnr0gYBK7a1Apj xBynnaPuGQQ01VzfskD64cIEZOhUAA== X-Received: by 10.80.137.97 with SMTP id f30mr20840363edf.152.1497218976583; Sun, 11 Jun 2017 15:09:36 -0700 (PDT) Original-Received: by 10.80.131.4 with HTTP; Sun, 11 Jun 2017 15:09:36 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22a X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13818 Archived-At: 2017-06-11 22:56 GMT+02:00 Catonano : > Amirouche, Thomas, > > > 2017-06-09 10:00 GMT+02:00 Amirouche Boubekki < > amirouche.boubekki@gmail.com>: > >> It's something like (bytevector->pointer (make-vector)) there is a >> make-double-pointer procedure in guile git >> > > I have overlooked both your remarks and Thomas's remarks > > I apologize, I was not understanding the issue correctly > > I have found define-wrapped-pointer-type in the manual only now and of > course both of you are right. > > The case described in the manual is slightly different than the one freexl > poses > > I can't wrap a pointer created by the C funtion. I have to pass one > created in scheme land > > The make-double-pointer procedure in guile-git seems appropriate. Thanks, > Amirouche > Ok, I finally managed to make it work ! Amirouche, I didn't remember but I had written a line exactly equal to yours: (bytevector->pointer (make-bytevector (sizeof '*))) in order to create e void pointer in scheme land ! The thing is that when I passed it in as an argument it was a void pointer: void * but when freexl_open had run it was a double pointer: handler ** Subsequent functions expected a simple pointer: handler * So it simply had to be dereferenced ! Like this (dereference-pointer handler **double-pointer) this returns a handler *single-pointer It's impossible discussing pointer types without becoming psychedelic in a few lines ! :-/ Now, to make thing really tidy, I should also use the wrap unwrap mechanism Thank you all people !