[Chicken-users] embedding question / seg fault
OS X 10.6.6 with Chicken 4.6.0 Hi, I was trying our the embedding example under CHICKEN_yield here: http://wiki.call-cc.org/man/4/Embedding I keep getting a seg fault and this seems to be the offending line: CHICKEN_get_error_message(buffer, 255); If I comment that out there's no seg fault. I looked at this post: http://www.mail-archive.com/chicken-users@nongnu.org/msg11218.html but I don't see what the resolution would be. Would it be easier to just avoid using define and stick to define-external? Is there any particular reason to use define? FYI, I'm trying to call Chicken commands from Python using Cython. Thanks, -Dave ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] embedding question / seg fault
From: David Dreisigmeyer dwdreisigme...@gmail.com Subject: [Chicken-users] embedding question / seg fault Date: Fri, 14 Jan 2011 09:59:55 -0500 OS X 10.6.6 with Chicken 4.6.0 Hi, I was trying our the embedding example under CHICKEN_yield here: http://wiki.call-cc.org/man/4/Embedding I keep getting a seg fault and this seems to be the offending line: CHICKEN_get_error_message(buffer, 255); If I comment that out there's no seg fault. I get a different error, but it is likely to be caused by the same problem: the compiler optimizes the compiled procedure for `CHICKEN_get_error_message' into a leaf routine (which uses different calling conventions than normal procedures). I have disabled this optimization for all external callback procedures, since the calling convention may not change in this case. See the experimental branch. I looked at this post: http://www.mail-archive.com/chicken-users@nongnu.org/msg11218.html but I don't see what the resolution would be. Would it be easier to just avoid using define and stick to define-external? Is there any particular reason to use define? Sorry, I don't fully understand what you are trying to say. You can only call procedures from outside of Scheme which are defined with `define-external'. FYI, I'm trying to call Chicken commands from Python using Cython. Interesting idea. Keep us informed about your progress, please. cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] embedding question / seg fault
On Fri, Jan 14, 2011 at 11:53:09PM +0100, Felix wrote: From: David Dreisigmeyer dwdreisigme...@gmail.com FYI, I'm trying to call Chicken commands from Python using Cython. Interesting idea. Keep us informed about your progress, please. +1. This is something I'd be able to use myself. I would like to work with another developer who writes in python. -Alan -- .i ko djuno fi le do sevzi ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] embedding question / seg fault
Thanks Felix. I looked at this post: http://www.mail-archive.com/chicken-users@nongnu.org/msg11218.html but I don't see what the resolution would be. Would it be easier to just avoid using define and stick to define-external? Is there any particular reason to use define? Sorry, I don't fully understand what you are trying to say. You can only call procedures from outside of Scheme which are defined with `define-external'. I was looking at this x.scm from http://wiki.call-cc.org/man/4/Embedding : ;;; x.scm (define (bar x) (gc #f) (* x x)) (define-external (baz (int i)) double (sqrt i)) (return-to-host) Not sure what I was thinking about either though... ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] embedding question / seg fault
I tried this with Gambit-C but couldn't quite make it work correctly. Right now I'm planning on going through the Sage/ECL Cython files to see how they get it to work. On Fri, Jan 14, 2011 at 6:29 PM, Alan Post alanp...@sunflowerriver.org wrote: On Fri, Jan 14, 2011 at 11:53:09PM +0100, Felix wrote: From: David Dreisigmeyer dwdreisigme...@gmail.com FYI, I'm trying to call Chicken commands from Python using Cython. Interesting idea. Keep us informed about your progress, please. +1. This is something I'd be able to use myself. I would like to work with another developer who writes in python. -Alan -- .i ko djuno fi le do sevzi ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users