Re: execvp and nvmatch () issue on solaris
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/29/05
- Next message: Marc Dansereau: "using rand to generate random point on a line"
- Previous message: Måns Rullgård: "Re: What directory is script in??? Bad description"
- In reply to: Shekar: "execvp and nvmatch () issue on solaris"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 28 Apr 2005 19:44:06 -0400
In article <1114720893.623716.124820@f14g2000cwb.googlegroups.com>,
"Shekar" <ctippur@msn.com> wrote:
> All,
>
> I am trying to execute a binary "mybinary" with arguments using
> execvp() system call as in:
> BTW: I can run "bin/mybinary hello" from command line and it returns
> the right value.
> char * const myargc[]={"bin/mybinary","hello",NULL};
> if (execvp(myargc[0],myargc) == -1)
> perror("execvp");
>
> I am getting SIGSEGV and this is what gdb shows:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xff2b9dd8 in nvmatch ()
> (gdb) bt
> #0 0xff2b9dd8 in nvmatch ()
> #1 0xff2b9e8c in getenv ()
> #2 0xff2b7fb4 in execvp ()
> #3 0x10dc4 in main (argc=3, argv=0xffbefdb4) at myhandler.c:154
>
> I would really appreciate if someone could put some light on to this
> issue.
My guess is something has corrupted your environment array. Perhaps you
have pointer problems, and earlier in the program something wrote
through a bad pointer that pointed into the environment.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Marc Dansereau: "using rand to generate random point on a line"
- Previous message: Måns Rullgård: "Re: What directory is script in??? Bad description"
- In reply to: Shekar: "execvp and nvmatch () issue on solaris"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|