dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] [bugs #11070] w32 process spawning corrupts argument l


From: Carl-Adam Brengesjo
Subject: [Pnet-developers] [bugs #11070] w32 process spawning corrupts argument list
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.




/**************************************************************************/
[bugs #11070] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11070>
Project: DotGNU Portable.NET
Submitted by: Carl-Adam Brengesjo
On: Sat 11/20/2004 at 23:43

Category:  None
Severity:  3 - Ordinary
Item Group:  None
Resolution:  None
Privacy:  Public
Assigned to:  None
Status:  Open


Summary:  w32 process spawning corrupts argument list

Original Submission:  Discovered this while working with csant and MS.NET 2.0 
(beta), but as it's caused in support/spawn.c it affects the rest of pnet 
aswell.  However, I cannot explain why this hasn't showed up before (e.g. when 
I was using .net 1.1).

A simple testcase causes something simlar to:

fatal error CS2021: File name '"C:DOCUME~1ptahLOCALS~1TempCMD235.tmp"' is too 
long or invalid

I tried to run the commandline csant output to me, perfect result. no 
warnings/errors whatsoever, I couldn't get it what was causing the errors.

At first I thought it was .NET 2.0 which internally used temp files during 
comppile, but very soon I realized it was actually pnet which, for various 
reasons, rewrites the argument list and executes a complete different one from 
the one printed by csant.

Anyways, spawn.c writes "the options to a temporary file instead" and then 
append the arguments list with the filename of this temporary file instead. And 
it's that temp file csc is whining about.

I was able to work around the problem by increasing the maximum argument list 
length allowed on line 105 (and thus preventing pnet to use a temp file) but 
I'm not sure of the consequenses of this, and more permanent solution is 
required.

PS. Any idea why this havn't shown up before? I mean, we're using csant and 
that spawn function every time we compile pnetlib on cygwin/w32.

test.cs:
class Test
{
        static void Main()
        {
        }
}

test.csant:
<?xml version="1.0">
<project name="test" default="all">

        <target name="all">
        
                <compile
                        output="test.exe"
                        target="exe"
                        unsafe="true"
                        debug="true"
                        nostdlib="false"
                        optimize="false"
                        install="false"
                        installasdefault="false">

                        <sources>
                                <includes name="**/*.cs"/>
                        </sources>

                        <references>
                                <file name="System.dll"/>
                                <file name="System.Windows.Forms.dll"/>
                        </references>

                        <arg compiler="cscc" value="-flatin1-charset"/>
                        <arg compiler="csc" value="/nowarn:162"/>
                        <arg compiler="csc" value="/nowarn:164"/>
                        <arg compiler="csc" value="/nowarn:169"/>
                        <arg compiler="csc" value="/nowarn:219"/>
                        <arg compiler="csc" value="/nowarn:649"/>
                        <arg compiler="csc" value="/nowarn:414"/>
                </compile>

        </target>

        <target name="clean">
                <delete file="test.exe"/>
                <delete file="test.pdb"/>
        </target>
        
</project>

console.log:
address@hidden:~/dev/test]$ ls -la
total 2
drwxr-xr-x+   2 ptah     None            0 Nov 21 00:26 ./
drwxr-xr-x+   7 ptah     None            0 Nov 20 22:47 ../
-rwxr-xr-x    1 ptah     None           41 Nov 20 22:49 test.cs*
-rwxr-xr-x    1 ptah     None          894 Nov 20 22:49 test.csant*
address@hidden:~/dev/test]$ csant --compiler csc
Building project `test'
Building target `all' for project `test'
csc /nologo /debug+ /unsafe /optimize- /target:exe /out:test.exe 
/define:DEBUG;TRACE /reference:System.dll;System.Windows.Forms.dll /nowarn:162 
/nowarn:164 /nowarn:169 /nowarn:219 /nowarn:649 /nowarn:414 test.cs
fatal error CS2021: File name '"C:DOCUME~1ptahLOCALS~1TempCMD238.tmp"' is too 
long or invalid
*** Target `all' for project `test' failed ***
*** Project `test' build failed ***
address@hidden:~/dev/test]$ cd ../pnet/csant
address@hidden:~/dev/pnet/csant]$ cat ../support/spawn.c|grep -n 64
105:                    if(len >= 64)
address@hidden:~/dev/pnet/csant]$ scite ../support/spawn.c
address@hidden:~/dev/pnet/csant]$ cat ../support/spawn.c|grep -n 1024
105:                    if(len >= 1024)
address@hidden:~/dev/pnet/csant]$ cd ../support && make && cd ../csant && make 
&& make install
...snippet...
address@hidden:~/dev/pnet/csant]$ cd ../../test && csant --compiler csc
Building project `test'
Building target `all' for project `test'
csc /nologo /debug+ /unsafe /optimize- /target:exe /out:test.exe 
/define:DEBUG;TRACE /reference:System.dll;System.Windows.Forms.dl
l /nowarn:162 /nowarn:164 /nowarn:169 /nowarn:219 /nowarn:649 /nowarn:414 
test.cs
Leaving target `all' for project `test'
Ending project `test'
address@hidden:~/dev/test]$ ./test.exe
address@hidden:~/dev/test]$ 

(running Windows XP SP2 + up-to-date cygwin)











For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11070>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]