This is the mail archive of the
mailing list for the Cygwin project.
mixed Ada-C program using OpenSSL library hangs on exit with Cygwin but not Cygwin64
- From: "Mark Veneziano" <mark at alnmark dot com>
- To: <cygwin at cygwin dot com>
- Date: Sun, 13 Apr 2014 12:53:41 -0400
- Subject: mixed Ada-C program using OpenSSL library hangs on exit with Cygwin but not Cygwin64
- Authentication-results: sourceware.org; auth=none
I have a very simple mixed Ada and C language program. My eventual goal is
to make some OpenSSL calls from an Ada main program under Cygwin.
The Ada code (a.adb):
procedure a is
procedure junk (px : in system.address);
pragma import (c, junk);
x : aliased integer := 5;
ada.text_io.put_line (integer'image (x));
The C code (x.c):
void junk (int *px)
RSA *pRsa = RSA_new();
I use the following commands to build the executable (a.exe):
gcc -c a.adb
gcc -c x.c
gnatlink a x.o -lcrypto
When I build on Cygwin64 1.7.29(0.272/5/3) 2014-04-07 13:46 and run a.exe,
the program displays the result 6 and then drops back to the bash prompt as
expected. Same on Fedora 20.
When I build on Cygwin (32-bit) 1.7.29(0.272/5/3) 2014-04-07 13:44 and run
a.exe, the program displays the result 6 and then hangs consuming 100% of
one CPU core until I hit Ctrl-C.
If I remove the OpenSSL calls from x.c, the hang doesn't occur. If I
eliminate the Ada code and make the OpenSSL calls from a pure C program, the
hang doesn't occur.
GCC is version 4.8.2 and OpenSSL is version 1.0.1g under both Cygwin
environments. I have reproduced this behavior on XP, Win 7, and Win 8.1.
Any help is appreciated.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple