Interrupt Handling Example doesn't compile on Windows/Cygwin
Brought to you by:
simonjwright
I just got ColdFrame set up on Windows/Cygwin [:)] and have noticed a Windows-specific problem in the examples build. Interrupt_Handling.Device.T tries to attach Ada.Interrupts.Names.SIGHUP which exists in the Linux version of GNAT Community Edition 2012 but not in the Windows version. The build fails. Is there a workround (perhaps using Ada.Interrupts.Names.SIGINT) which would allow the build to proceed and the House Management example to function as it does under Linux?
Sorry for the confusion. I see Interrupt Handling has nothing to do with House Management. I've just commented out the build of Interrupt Handling for now.
Last edit: Alex Proudfoot 2013-06-17
I guess SIGINT can be used if the test is performed with kill -s INT pid instead of kill -s HUP pid. I'll try it.
No. That kills the process. All the available alternatives kill the process. Either of the user defined signals USR1=30 and USR2=31 would be ideal but are not available. I guess this example can't function on Windows/Cygwin.
Last edit: Alex Proudfoot 2013-06-17
To use
SIGINTyou can either use a really antiquated Cygwin - from 2011 or so; I found this by installing the latest one :-) - or by runninginterrupt_handling-harnessfrom a Command Shell (cmd) that has been opened from the Windows Run prompt (rather than by typingcmdinto a Cygwinbashshell) and typing^C.OK. This works for me. Any ideas why the first line of text output is corrupted though?
Which version of Java are you using? I've got Oracle's Java 7, which doesn't understand Cygwin paths, so I can't check anything.
As well as SIGINT, you could try pragma Unreserve_All_Interrupts in case that allows the handler to catch the signal.
My problem is that I need to choose a signal that's available on Linux, Mac OS X, and Windows; Unreserve_All_Interrupts makes the example work with SIGINT on Mac OS X and should do on Linux.
On 16 Jun 2013, at 12:21, Alex Proudfoot alexproudfoot@users.sf.net wrote:
Related
Bugs:
#80I'm using Oracle's JDK 1.6 right now and had the same problem with Cygwin paths until I made some alterations to Makefile.inc, see attachment. The current alterations are only what was needed to get the builds to work so other stuff such as HTML documentation will still be broken. There were also problems related to ADA_PROJECT_PATH which needs to be a Windows path in my current Windows/Cygwin environment. For the ColdFrame tests and examples, the problems can be worked round with a minor hack to the Makefiles to avoid treating ADA_PROJECT_PATH as a Unix path. I'll try Unreserve_All_Interrupts and get back to you.
Last edit: Alex Proudfoot 2013-06-18
Using SIGINT and pragma Unreserve_All_Interrupts works on OpenSUSE 11.4 but not on Windows/Cygwin. The kill command still kills the process. I've been trying to get the same build to work using MinGW but I seem to have path problems where none existed under Cygwin.
On 21 Jun 2013, at 09:18, Alex Proudfoot alexproudfoot@users.sf.net wrote:
Because the first state machine transition (which causes a line of output) occurs at almost exactly the same time as the Device task starts running (and prints a line of output). I've added a delay, not ideal but avoids this particular regrettableness!
--S
Fixed at revision 677de98a6878.