X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=O+x B6wld8Dss1kSZd//6fc2A8SB/UkRmExo1c05S6CWllhuO0ltK+Vd9F+XKx/MisLq J513HVnDSZ1fNB21xLit7MgpVdT8kOyGy5ceyiTasbyLAVCcIsICOJ70n5Lbsoxs 2W4Ijf74zpiHGXiZ7GBW13/S4h6jZhuaEyXioZmI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=qJQ76005V MKBAeCWvOa0xXFa1MQ=; b=S3L3nzeOwlwxaOkURHu9RERUHj6G69Ea0MmVJ22yq bo9AoV3fIEdFQeBk4A/eySMhPWTnbevYW2uIkT8b2EFYvtT3J8E49PLUUcndlC/t IzFF67rSvfT9SSVFJPjmk1xk8zTJC7NdPJkaN/MBfSUpE+oShQZfk4iCvv7qeMfL JM= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.4 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,T_HDRS_LCASE,T_MANY_HDRS_LCASE autolearn=ham version=3.3.2 X-HELO: vms173001pub.verizon.net From: "Mark Veneziano" To: Subject: mixed Ada-C program using OpenSSL library hangs on exit with Cygwin but not Cygwin64 Date: Sun, 13 Apr 2014 12:53:41 -0400 Message-id: <0dab01cf5738$ed71d880$c8558980$@alnmark.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-IsSubscribed: yes Hello, 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): with ada.text_io; with system; procedure a is procedure junk (px : in system.address); pragma import (c, junk); x : aliased integer := 5; begin junk (x'address); ada.text_io.put_line (integer'image (x)); end a; The C code (x.c): #include void junk (int *px) { RSA *pRsa = RSA_new(); (*px)++; RSA_free (pRsa); } I use the following commands to build the executable (a.exe): gcc -c a.adb gcc -c x.c gnatbind a 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. Thanks, Mark -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple