GNU bug report logs - #64039
C-procedure runs when called from C-code, but hags when called from Guile

Previous Next

Package: guile;

Reported by: Михаил Бахтерев <mike.bakhterev <at> gmail.com>

Date: Tue, 13 Jun 2023 10:20:02 UTC

Severity: normal

To reply to this bug, email your comments to 64039 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#64039; Package guile. (Tue, 13 Jun 2023 10:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Михаил Бахтерев <mike.bakhterev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 13 Jun 2023 10:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Михаил Бахтерев
 <mike.bakhterev <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: C-procedure runs when called from C-code,
 but hags when called from Guile
Date: Tue, 13 Jun 2023 15:18:51 +0500
[Message part 1 (text/plain, inline)]
Greetings.

1. The version

$ guile --version
guile (GNU Guile) 3.0.9

2. The machine

$ uname -a
Linux bioscope 6.3.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 10 Jun 2023
00:35:35 +0000 x86_64 GNU/Linux

3. The package

$ pacman -Qi guile
Version         : 3.0.9-1
Architecture    : x86_64
Depends On      : gmp  ncurses  libunistring  gc  libffi  libxcrypt

4. The problem

I'm working on application for scientific computer vision. We use one of
the Andor camera. I've decided to code configuration and user interface
parts in Guile Scheme, as to my experience, it is a lot simpler. But i've
encountered strange error.

Attached archive contains three source files. cam.c implements simple
sequence of interactions with camera driver. That sequence should result in
image acquisition and in the clicking of camera shutter. I've built shared
library from this code (see makefile, please) and have linked it with
simple main program (test.c). When i run resulting binary, i get

$ ./test
INITIALIZATION
CONFIGURATION
ACQUISITION
-- shutter clicks here
AWAITING
SHUTTING DOWN

When i try to run this code from Guile Scheme, as extension, it hangs.

$ guile test.scm
defining single-shot
INITIALIZATION
CONFIGURATION
ACQUISITION
AWAITING
-- no shutter clicking
^C

I do not understand how to debug further, so i just include straces of both
runs in attached archive. If anyone will give me some directions for
investigation of the problem, i'll try to do my best. Thanks in advance!

- Respectfully, Mike.
[Message part 2 (text/html, inline)]
[andor-bug.tar.gz (application/gzip, attachment)]

Information forwarded to bug-guile <at> gnu.org:
bug#64039; Package guile. (Tue, 13 Jun 2023 13:36:02 GMT) Full text and rfc822 format available.

Message #8 received at 64039 <at> debbugs.gnu.org (full text, mbox):

From: Mike Gran <spk121 <at> yahoo.com>
To: "64039 <at> debbugs.gnu.org" <64039 <at> debbugs.gnu.org>, 
 Михаил Бахтерев
 <mike.bakhterev <at> gmail.com>
Subject: Re: bug#64039: C-procedure runs when called from C-code, but hags
 when called from Guile
Date: Tue, 13 Jun 2023 13:34:51 +0000 (UTC)
Hello-

I don't see the problem with the shutter.

But the GetStatus lines should be more like what is below. Your current code
only checks status once.

do {
  GetStatus(&status);
} while (status== DRV_ACQUIRING);





On Tuesday, June 13, 2023 at 04:29:46 AM PDT, Михаил Бахтерев <mike.bakhterev <at> gmail.com> wrote: 





Greetings.

1. The version

$ guile --version
guile (GNU Guile) 3.0.9

2. The machine

$ uname -a
Linux bioscope 6.3.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 10 Jun 2023 00:35:35 +0000 x86_64 GNU/Linux

3. The package

$ pacman -Qi guile
Version         : 3.0.9-1
Architecture    : x86_64
Depends On      : gmp  ncurses  libunistring  gc  libffi  libxcrypt

4. The problem

I'm working on application for scientific computer vision. We use one of the Andor camera. I've decided to code configuration and user interface parts in Guile Scheme, as to my experience, it is a lot simpler. But i've encountered strange error.

Attached archive contains three source files. cam.c implements simple sequence of interactions with camera driver. That sequence should result in image acquisition and in the clicking of camera shutter. I've built shared library from this code (see makefile, please) and have linked it with simple main program (test.c). When i run resulting binary, i get

$ ./test 
INITIALIZATION
CONFIGURATION
ACQUISITION
-- shutter clicks here
AWAITING
SHUTTING DOWN

When i try to run this code from Guile Scheme, as extension, it hangs.

$ guile test.scm 
defining single-shot
INITIALIZATION
CONFIGURATION
ACQUISITION
AWAITING
-- no shutter clicking
^C

I do not understand how to debug further, so i just include straces of both runs in attached archive. If anyone will give me some directions for investigation of the problem, i'll try to do my best. Thanks in advance!

- Respectfully, Mike.





Information forwarded to bug-guile <at> gnu.org:
bug#64039; Package guile. (Tue, 13 Jun 2023 14:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 64039 <at> debbugs.gnu.org (full text, mbox):

From: Mike Gran <spk121 <at> yahoo.com>
To: "64039 <at> debbugs.gnu.org" <64039 <at> debbugs.gnu.org>, 
 Михаил Бахтерев
 <mike.bakhterev <at> gmail.com>
Subject: Re: bug#64039: C-procedure runs when called from C-code, but hags
 when called from Guile
Date: Tue, 13 Jun 2023 14:25:46 +0000 (UTC)
Actually, no, you're right. I've just never seen a do/while w/o braces.






On Tuesday, June 13, 2023 at 06:37:01 AM PDT, Mike Gran via "Bug reports for GUILE, GNU's Ubiquitous Extension Language <bug-guile <at> gnu.org> wrote: 





Hello-

I don't see the problem with the shutter.

But the GetStatus lines should be more like what is below. Your current code
only checks status once.

do {
  GetStatus(&status);
} while (status== DRV_ACQUIRING);





On Tuesday, June 13, 2023 at 04:29:46 AM PDT, Михаил Бахтерев <mike.bakhterev <at> gmail.com> wrote: 





Greetings.

1. The version

$ guile --version
guile (GNU Guile) 3.0.9

2. The machine

$ uname -a
Linux bioscope 6.3.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 10 Jun 2023 00:35:35 +0000 x86_64 GNU/Linux

3. The package

$ pacman -Qi guile
Version         : 3.0.9-1
Architecture    : x86_64
Depends On      : gmp  ncurses  libunistring  gc  libffi  libxcrypt

4. The problem

I'm working on application for scientific computer vision. We use one of the Andor camera. I've decided to code configuration and user interface parts in Guile Scheme, as to my experience, it is a lot simpler. But i've encountered strange error.

Attached archive contains three source files. cam.c implements simple sequence of interactions with camera driver. That sequence should result in image acquisition and in the clicking of camera shutter. I've built shared library from this code (see makefile, please) and have linked it with simple main program (test.c). When i run resulting binary, i get

$ ./test 
INITIALIZATION
CONFIGURATION
ACQUISITION
-- shutter clicks here
AWAITING
SHUTTING DOWN

When i try to run this code from Guile Scheme, as extension, it hangs.

$ guile test.scm 
defining single-shot
INITIALIZATION
CONFIGURATION
ACQUISITION
AWAITING
-- no shutter clicking
^C

I do not understand how to debug further, so i just include straces of both runs in attached archive. If anyone will give me some directions for investigation of the problem, i'll try to do my best. Thanks in advance!

- Respectfully, Mike.








This bug report was last modified 325 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.