Bug 49425 - <javac> task hangs or crashes with SYS0008
Summary: <javac> task hangs or crashes with SYS0008
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.1
Hardware: PC OS/2
: P2 major (vote)
Target Milestone: 1.8.2
Assignee: Ant Notifications List
Depends on:
Reported: 2010-06-10 16:10 UTC by Dmitry A. Kuminov
Modified: 2010-06-11 07:21 UTC (History)
0 users

Fixes the issue mentioned in this ticket (754 bytes, patch)
2010-06-10 16:10 UTC, Dmitry A. Kuminov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry A. Kuminov 2010-06-10 16:10:41 UTC
Created attachment 25580 [details]
Fixes the issue mentioned in this ticket

If the 'fork' attribute of the <javac> task is set to 'true', the external javac executable gets started through CMD.EXE which will hang or crash with error SYS0008 if the resulting command line is too long. There is support for the limited command line length in Ant already but it assumes that this limit is 4096 characters on all platforms, while in the OS/2 version of CMD.EXE it is much less -- about 1023 characters. 

The supplied patch fixes this issue.
Comment 1 Stefan Bodewig 2010-06-11 00:32:16 UTC
The patch looks reasonable and I'll apply it later today even though I'll be unable to test it.

While we have the attention of somebody running OS/2 could I ask you to download http://people.apache.org/~bodewig/ant-env.zip extract the ZIP, run

java -jar ant-env.jar

and report your results to bug 49366

As background: we want to replace our platform specific environment variable system with System.getenv in the future and need to see whether both approaches yield the same result.
Comment 2 Stefan Bodewig 2010-06-11 03:34:21 UTC
applied your patch in svn revision 953594

Please try the ant-env.jar as described in comment #1
Comment 3 Dmitry A. Kuminov 2010-06-11 07:21:50 UTC
Thanks for promptness. Note that I checked the patch when building parts of OpenJDK that uses external javac a lot and supplies very long command lines, and it works on OS/2 as expected now.