You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Andrew Black <ab...@roguewave.com> on 2007/08/03 17:36:14 UTC

Re: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Greetings Martin.

Something in this patch appears to cause the exec utility to hang on
Windows.  I haven't had much time to dig into the cause, but I thought
I'd give everyone a heads up.  Farid, if you have a chance, could you
look into this?

--Andrew Black

sebor@apache.org wrote:
> Author: sebor
> Date: Thu Aug  2 12:04:26 2007
> New Revision: 562224
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=562224
> Log:
> 2007-07-26  Martin Sebor  <se...@roguewave.com>
> 
> 	* display.h (print_footer): Added an argument for the total number
> 	of programs processed by the utility.
> 	* display.cpp (print_target_verbose): Print stdin, stdout, and stderr
> 	redirectiopn.
> 	(print_status_verbose): Justified output.
> 	(print_footer_plain): Printed the total number of programs processed
> 	by the utility and avoided printing assertion totals unless they're
> 	valid.
> 	(print_footer_verbose): Added an argument.
> 	* target.h (target_opts): Added infname and outfname members.
> 	* util.h (input_name): Declared.
> 	* util.cpp (input_name): Defined to parallel output_name().
> 	* exec.cpp (open_input): Removed.
> 	(exec_file): Used target_opts::infname and target_opts::outfname.
> 	* runall.cpp (run_target): Called input_name() and output_name()
> 	to set the names of files to redirect input and output from and
> 	to, respectively.
> 	Avoided printing out assertion totals when they're not valid.
> 
> Modified:
>     incubator/stdcxx/trunk/util/display.cpp
>     incubator/stdcxx/trunk/util/display.h
>     incubator/stdcxx/trunk/util/exec.cpp
>     incubator/stdcxx/trunk/util/runall.cpp
>     incubator/stdcxx/trunk/util/target.h
>     incubator/stdcxx/trunk/util/util.cpp
>     incubator/stdcxx/trunk/util/util.h
> 
[Change snipped]

RE: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Saturday, August 04, 2007 12:42 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r562224 - in 
> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
> runall.cpp target.h util.cpp util.h
> 
> Thanks! I went ahead and committed it myself to get the 
> builds going again but I forgot to attribute it to you -- 
> hope you're okay with it. 

  It's ok. No problem.

Farid.

Re: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Andrew Black [mailto:ablack@roguewave.com] 
>> Sent: Friday, August 03, 2007 6:36 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: svn commit: r562224 - in 
>> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
>> runall.cpp target.h util.cpp util.h
>>
>> Something in this patch appears to cause the exec utility to 
>> hang on Windows.  I haven't had much time to dig into the 
>> cause, but I thought I'd give everyone a heads up.  Farid, if 
>> you have a chance, could you look into this?
> 
>   The exec process deadlocked in (exec.cpp, line 1055):
> -----
> warn_last_error ("Opening child input stream");
> -----
>   after the CreateFile (options->infname) has failed (because
> options->infname == "/dev/null").
> 
>   The proposed fix below, but deadlocking is the another issue to be
> resolved:

Thanks! I went ahead and committed it myself to get the builds
going again but I forgot to attribute it to you -- hope you're
okay with it. http://svn.apache.org/viewvc?view=rev&rev=562580

Martin


> 
> Index: util.cpp
> ===================================================================
> --- util.cpp	(revision 562407)
> +++ util.cpp	(working copy)
> @@ -200,9 +200,15 @@
>          free (fname);
>      }
>  
> +#ifndef _WIN32
> +#define DEV_NULL "/dev/null"
> +#else
> +#define DEV_NULL "NUL"
> +#endif
> +
>      /* If we didn't find a source file, use /dev/null */
> -    fname = (char*)RW_MALLOC (sizeof "/dev/null");
> -    strcpy (fname, "/dev/null");
> +    fname = (char*)RW_MALLOC (sizeof DEV_NULL);
> +    strcpy (fname, DEV_NULL);
>      return fname;
>  }
>  
> 
> Farid.


Re: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Farid Zaripov [mailto:Farid_Zaripov@epam.com] 
>> Sent: Friday, August 03, 2007 7:53 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: RE: svn commit: r562224 - in 
>> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
>> runall.cpp target.h util.cpp util.h
>>
>>   The exec process deadlocked in (exec.cpp, line 1055):
>> -----
>> warn_last_error ("Opening child input stream");
>> -----
>>   after the CreateFile (options->infname) has failed (because
>> options->infname == "/dev/null").
>>
>>   The proposed fix below, but deadlocking is the another issue to be
>> resolved:
> 
>   The deadlock fixed thus:
> http://svn.apache.org/viewvc?view=rev&rev=562537

Great! I'm working on resolving the regression in exec.cpp.

Martin

RE: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Farid Zaripov [mailto:Farid_Zaripov@epam.com] 
> Sent: Friday, August 03, 2007 7:53 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: svn commit: r562224 - in 
> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
> runall.cpp target.h util.cpp util.h
> 
>   The exec process deadlocked in (exec.cpp, line 1055):
> -----
> warn_last_error ("Opening child input stream");
> -----
>   after the CreateFile (options->infname) has failed (because
> options->infname == "/dev/null").
> 
>   The proposed fix below, but deadlocking is the another issue to be
> resolved:

  The deadlock fixed thus:
http://svn.apache.org/viewvc?view=rev&rev=562537

Farid.

RE: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Andrew Black [mailto:ablack@roguewave.com] 
> Sent: Friday, August 03, 2007 6:36 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r562224 - in 
> /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp 
> runall.cpp target.h util.cpp util.h
> 
> Something in this patch appears to cause the exec utility to 
> hang on Windows.  I haven't had much time to dig into the 
> cause, but I thought I'd give everyone a heads up.  Farid, if 
> you have a chance, could you look into this?

  The exec process deadlocked in (exec.cpp, line 1055):
-----
warn_last_error ("Opening child input stream");
-----
  after the CreateFile (options->infname) has failed (because
options->infname == "/dev/null").

  The proposed fix below, but deadlocking is the another issue to be
resolved:

Index: util.cpp
===================================================================
--- util.cpp	(revision 562407)
+++ util.cpp	(working copy)
@@ -200,9 +200,15 @@
         free (fname);
     }
 
+#ifndef _WIN32
+#define DEV_NULL "/dev/null"
+#else
+#define DEV_NULL "NUL"
+#endif
+
     /* If we didn't find a source file, use /dev/null */
-    fname = (char*)RW_MALLOC (sizeof "/dev/null");
-    strcpy (fname, "/dev/null");
+    fname = (char*)RW_MALLOC (sizeof DEV_NULL);
+    strcpy (fname, DEV_NULL);
     return fname;
 }
 

Farid.

Re: svn commit: r562224 - in /incubator/stdcxx/trunk/util: display.cpp display.h exec.cpp runall.cpp target.h util.cpp util.h

Posted by Martin Sebor <se...@roguewave.com>.
Andrew Black wrote:
> Greetings Martin.
> 
> Something in this patch appears to cause the exec utility to hang on
> Windows.  I haven't had much time to dig into the cause, but I thought
> I'd give everyone a heads up.  Farid, if you have a chance, could you
> look into this?

Aww, crap! Windows strikes again. We really need to minimize
the amount of platform-specific code here. Let me do a build
and see what's going on.

Thanks
Martin

> 
> --Andrew Black
> 
> sebor@apache.org wrote:
>> Author: sebor
>> Date: Thu Aug  2 12:04:26 2007
>> New Revision: 562224
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=562224
>> Log:
>> 2007-07-26  Martin Sebor  <se...@roguewave.com>
>>
>> 	* display.h (print_footer): Added an argument for the total number
>> 	of programs processed by the utility.
>> 	* display.cpp (print_target_verbose): Print stdin, stdout, and stderr
>> 	redirectiopn.
>> 	(print_status_verbose): Justified output.
>> 	(print_footer_plain): Printed the total number of programs processed
>> 	by the utility and avoided printing assertion totals unless they're
>> 	valid.
>> 	(print_footer_verbose): Added an argument.
>> 	* target.h (target_opts): Added infname and outfname members.
>> 	* util.h (input_name): Declared.
>> 	* util.cpp (input_name): Defined to parallel output_name().
>> 	* exec.cpp (open_input): Removed.
>> 	(exec_file): Used target_opts::infname and target_opts::outfname.
>> 	* runall.cpp (run_target): Called input_name() and output_name()
>> 	to set the names of files to redirect input and output from and
>> 	to, respectively.
>> 	Avoided printing out assertion totals when they're not valid.
>>
>> Modified:
>>     incubator/stdcxx/trunk/util/display.cpp
>>     incubator/stdcxx/trunk/util/display.h
>>     incubator/stdcxx/trunk/util/exec.cpp
>>     incubator/stdcxx/trunk/util/runall.cpp
>>     incubator/stdcxx/trunk/util/target.h
>>     incubator/stdcxx/trunk/util/util.cpp
>>     incubator/stdcxx/trunk/util/util.h
>>
> [Change snipped]