This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

BUG [cygwin(cvs)]: Segfault in fhandler_base when attempting to calculatemaximum open files on WinME&2000


There seems to be a nasty autoconf macro in coreutils (open-max.m4*) which attempts to compile and execute the following the code for the purpose of determining the system's simultaneous open file maximum:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
    main ()
      FILE *result = fopen ("conftest.omax", "w");
      int i = 1;
      /* Impose an arbitrary limit, in case some system has no
	 effective limit on the number of simultaneously open files.  */
      while (i < 30000)
	  FILE *s = fopen ("conftest.op", "w");
	  if (!s)
      fprintf (result, "%d\n", i);
      exit (fclose (result) == EOF);

Executing the code segfaults with the following messages:

   5 [main] foo 1008 cmalloc: cmalloc returned NULL
5004 [main] foo 1008 fhandler_base::set_name: fatal error. strdup failed

Examining the binary in gdb reveals that it dies at line 1198 of This is 100% reproducable on a machine running WinME & another running Win2k SP4. The dll being used was built from cvs sources checked out today. Of course the test works fine on linux. Since this should be readily reproducable on any Cygwin platform running the most current sources & packages, I'm not going to flood the list with cygcheck.


* You can also get it in m4 form from here:*checkout*/coreutils/coreutils/m4/open-max.m4?rev=HEAD&content-type=text/plain

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]