From: Catonano <catonano@gmail.com>
To: guile-user@gnu.org
Subject: segmenation fault
Date: Fri, 9 Jun 2017 09:21:35 +0200 [thread overview]
Message-ID: <CAJ98PDyN6HwBQQd928Sorrx-YE+3BezBGKGO8iCTf56gSna6=w@mail.gmail.com> (raw)
in using the guile FFI I am having a segmentation fault
This is the C unction that I'm trying to wrap
https://www.gaia-gis.it/gaia-sins/freexl-1.0.1-doxy-doc/html/freexl_8h.html#acbd27ba5bc7b21d4ae32c0542d51f1e4
My code is here
https://gitlab.com/humanitiesNerd/guile-freexl
(configure is to be called with --with-freexl-libdir=... otherwise it won't
work)
Here's an excerpt
(define freexl-open
(let* ((ptr (freexl-func "freexl_open"))
(proc (pointer->procedure int ptr '(* *)))
;;const char *path, const void **xls_handle
)
(lambda (path)
(let ((handle (scm->pointer 0))
(path-ptr (string->pointer path)))
(proc path-ptr handle)))))
At the REPL, when calling it with
> (freexl-open"resources/Lavoro_P.xsl")
it produces a segmentation fault
probably this line
(scm->pointer 0)
is not correct
But I don't know how to produce a void pointer and then pass it to
freexl-open
Thanks in advance
next reply other threads:[~2017-06-09 7:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 7:21 Catonano [this message]
2017-06-09 7:43 ` segmenation fault Thomas Danckaert
2017-06-09 8:00 ` Amirouche Boubekki
2017-06-09 8:17 ` Catonano
2017-06-09 11:18 ` Chris Vine
2017-06-09 16:36 ` Josh Datko
2017-06-09 20:18 ` Catonano
2017-06-11 20:56 ` Catonano
2017-06-11 22:09 ` Catonano
2017-06-09 8:42 ` Catonano
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://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ98PDyN6HwBQQd928Sorrx-YE+3BezBGKGO8iCTf56gSna6=w@mail.gmail.com' \
--to=catonano@gmail.com \
--cc=guile-user@gnu.org \
/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.
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).