X-Recipient: archive-cygwin@delorie.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:mime-version:date:message-id:subject:from:to
	:content-type; q=dns; s=default; b=IMPihNxlMazBGJDGPw6gk1VtjwnZP
	UOQWbMIeCyyFnHMhSFpIq72xph5pjfcDRrItinScsBrIpzBTlJXBbLgonVjWx6Rr
	3DkpYsKBs6PKMlUBWjmxlRkD1lae/7r95OtSSy/VFXwB3/QNssSTUYE6U2mc51Fo
	jzjk3LpfUUtbRM=
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:mime-version:date:message-id:subject:from:to
	:content-type; s=default; bh=Hz/JDKS0YGf+gVq32iq0TAOutTo=; b=WkI
	HqHQ8yes2CLaa8scxwAiTZcgioeF2M/Rm2QzTNfvCDk4Iif3ybyDQpqDWA4ciF2F
	Mz4Yuibf5f0KrVOTxGAFib3oDT0k/zBTNrIZmWeQFZh1qpCNOUVUq6Yv61I7uWuf
	d5TnxSrCOo6GSLITMCnsYPY2C5ePrQF2XarIi63A=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM,NO_RELAYS autolearn=ham version=3.3.2
X-HELO: mail-ob0-f177.google.com
MIME-Version: 1.0
X-Received: by 10.182.113.195 with SMTP id ja3mr2369005obb.46.1379380102637; Mon, 16 Sep 2013 18:08:22 -0700 (PDT)
Date: Mon, 16 Sep 2013 21:08:22 -0400
Message-ID: <CACMdL5Lj9xszu_rtZ8-t7a-t9EQtEpv3ZxK73MQvOVueU_BbOQ@mail.gmail.com>
Subject: Gnat with sqlite Ada bindings - 100% CPU problem
From: Patrick Herbst <paherbst@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1

Hello,

I'm trying to write an Ada application that uses the Sqlite library.
The application will compile and run until the end of the application
where it will hang, using near 100% CPU.

When I cntrl+c it while running in GDB, it shows:
Program received signal SIGINT, Interrupt.
0x6e015096 in cyggcc_s-1!__deregister_frame_info_bases () from
/usr/bin/cyggcc_s-1.dll

The same application in C exits just fine.

I generated the Ada bindings using
> gcc -fdump-ada-spec /usr/include/sqlite3.h

and my application is as follows
-----------------------------
with sqlite3_h;
with system;
with text_io;
with Interfaces.C.Strings;

procedure test is

  Db : System.Address;
  Name : Interfaces.C.Strings.chars_ptr :=
      Interfaces.C.Strings.New_String ("./test.db");
  ret : interfaces.c.int;

begin

  ret := sqlite3_h.sqlite3_open (Name, Db'address);
  ret := sqlite3_h.sqlite3_close (Db);

  Interfaces.C.Strings.Free (Name);

  text_io.put_line ("Done");

end test;
-----------------------------

Compile using
> gnatmake ./test.adb -largs -lsqlite3

Running the application will print out "Done" and then hang with 100%
CPU.  Not sure if this is a bug with cygwin or gcc.

Any suggestions/help would be greatly appreciated!

--
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

