This is the mail archive of the cygwin 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]

seg-vios from gcc program at execv() on Windows XP

Hello Cygwiners,

I'm a long-time user of Cygwin - love it, depend on it... and rarely have
a problem, but I really need some help with this one particular problem.
I've already tapped into my other technical resources on this and haven't
gotten anywhere at all. It isn't clear this is a Cygwin problem, but then,
it isn't clear that it isn't, either. ...I really need some insight

A couple of weeks ago some skum-bag stole my laptop and my new one came
with Windows XP Professional. ...I now understand what XP stands for: XP
means eXtremely Painful. Anyway, I use the laptop for sales calls (I'm the
technical person) and it just _has_ to work. I've been having trouble
getting my company's software working on the system and my boss said,
"well, this is a good chance for you to make sure our stuff works on XP,
so, have fun!" - or words to that effect... But I am _not_ having fun.

The problem is that we've got a GCC based program that ends up calling
Java via execv(). It _always_ seg-vios when the GCC program itself
is called from another program (non-interactive) and it sometimes seg-vios
when run from an interactive Cygwin Bash prompt. Significant testing has
shown that the interactive failure seems to be associated with environment
variables. For example, the code uses an environment variable to determine
if it should output "verbose" statements to std-out (via printf), and if
this is set, the execv() always fails. However, it also fails sometimes
depending on other variables that should have _nothing_ to do with the

Here's an excerpt of the code in the vicinity of the exec:

      // make sure that argv0 is fully qualified so that java doesn't
      // default to a local binary
      //nargv[0]= "java";
      nargv[1]= "-classpath";
      nargv[2]= classpathenv;
      nargv[3]= std;
      nargv[4]= ck;
      nargv[5]= rus;
      nargv[6]= host;
      nargv[7]= stc;
      nargv[8]= stt;
      nargv[9]= dk;
      nargv[10]= cl;

      i = execv(program, nargv);

Note that the code is _rock_solid_ on Linux/Unix/Mac OSX, and on all
earlier versions of Windows we've ever tried it on. We've _never_ seen it
seg-vio before.

Also note that I recompiled the executable on the target system. I'm
wondering if there's something about the new installation of Cygwin on XP
that's changed something about how the binary runs...

In case it helps: cygcheck -s says we're running 1.5.10, and gcc is
3.3.1-3. It was a fresh, absolutely complete installation - even the stuff
I never need. (BTW ping and dig utilities would be nice!)


Thanks everyone,

Richard Troy, Chief Scientist
Science Tools Corporation, 510-567-9957,

Unsubscribe info:
Problem reports:

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