Re: execvp and nvmatch () issue on solaris

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/29/05


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 ***


Relevant Pages

  • Panic on CURRENT
    ... GNU gdb 6.1.1 ... page fault while in kernel mode ... instruction pointer = 0x20:0xc0716dd2 ... frame pointer = 0x28:0xf8d80bc4 ...
    (freebsd-current)
  • Re: Shellcode itself segfaults
    ... a pointer to the string '/bin/sh' in the ... ebx register, a pointer to a pointer to char, however this ... You have an option to go with a managed service or an enterprise software. ...
    (Pen-Test)
  • Re: kernel problem
    ... > i have done a kgdb on the dumps it gave out here is the output ... > Unread portion of the kernel message buffer: ... GNU gdb 6.1.1 ... instruction pointer = 0x20:0xc08badd7 ...
    (freebsd-stable)
  • Re: panic: in pf_reassemble() ?
    ... general protection fault while in kernel mode ... instruction pointer = 0x20:0xffffffff801bc111 ... GDB is free software, covered by the GNU General Public License, and you ... Attempt to extract a component of a value that is not a structure ...
    (freebsd-current)
  • Re: signal.h
    ... now i know when i'm in gdb i can catch bugs but is there ... with gdb. ... could help in the general case of a SIGSEGV signal. ... saying that "implementation-specific extensions" could help ...
    (comp.lang.c)