Unix Technical Forum

SIGSEGV error on execve system call

This is a discussion on SIGSEGV error on execve system call within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> I write a code with indirecting execve() system call as below.. OS : HP-UX 11.11i, (64-bit Kernel) Memory : ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 05:06 PM
ujoo
 
Posts: n/a
Default SIGSEGV error on execve system call

I write a code with indirecting execve() system call as below..
OS : HP-UX 11.11i, (64-bit Kernel)
Memory : 512 MB

int my_execve(char *path, char *argv[], char *envp[])
{
/* call original system call */
return execve(path, argv, envp);
}

After loading a module, telnet to system which load my module from remote.
Then, fail to prompt a shell...error occurred as below...
---------------------------
login: root
Password:
Please wait...checking for disk quotas

Pid 4025 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
No shell
----------------------------

So, Reconfigure Kernel parameters, maxdsiz, maxtsiz, maxssiz, nfile, nproc, etc.
But....I have the same result....
Belows are truss text for inetd...(only catching for execve)

HELP ME....!!!!

( Attached to process 516 ("/usr/sbin/inetd") [32-bit] )
516: select(31, 0x7aff0390, NULL, NULL, NULL) [sleeping]
4024: execve("/usr/lbin/telnetd", 0x4000a8a8, 0x7aff017c) [entry]
argv[0] @ 0x4000a898: "telnetd"
env[0] @ 0x7aff0044: "LANG=ko_KR.eucKR"
env[1] @ 0x7aff0140: "TZ=KST-9"
4024: execve("/usr/lbin/telnetd", 0x4000a8a8, 0x7aff017c) = 0 [32-bit]
4025: execve("/usr/bin/login", 0x7aff0808, 0x40004d60) [entry]
argv[0] @ 0x40001cf8: "login"
argv[1] @ 0x40001d00: "-h"
argv[2] @ 0x7aff0238: "192.168.1.68"
argv[3] @ 0x40001d08: "-p"
env[0] @ 0x40002270: "TERM=vt100"
4025: execve("/usr/bin/login", 0x7aff0808, 0x40004d60) = 0 [32-bit]
4025: In user-mode [running]
4026: execve("/usr/bin/sh", 0x7aff0418, 0x400010e0) [entry]
argv[0] @ 0xffffffffc01402b8:
argv[1] @ 0xffffffffc01402c0:
argv[2] @ 0x7aff01b8: "/usr/bin/quota root"
env[0] @ 0x40001690: "HOME=/"
env[1] @ 0x40002550: "PATH=:/usr/sbin:/usr/bin:/sbin"
env[2] @ 0x40001670: "LOGNAME=root"
env[3] @ 0x40001630: "TERM=vt100"
env[4] @ 0x40001a98: "SHELL=/sbin/sh"
env[5] @ 0x400011f8: "MAIL=/var/mail/root"
4026: execve("/usr/bin/sh", 0x7aff0418, 0x400010e0) = 0 [32-bit]
4027: execve("/usr/bin/quota", 0x400128e8, 0x40012928) [entry]
argv[0] @ 0x40012900: "/usr/bin/quota"
argv[1] @ 0x40012918: "root"
env[0] @ 0x40012960: "_=/usr/bin/quota"
env[1] @ 0x40012980: "PATH=:/usr/sbin:/usr/bin:/sbin"
env[2] @ 0x400129a8: "COLUMNS=122"
env[3] @ 0x400129c0: "LOGNAME=root"
env[4] @ 0x400129d8: "MAIL=/var/mail/root"
env[5] @ 0x400129f8: "SHELL=/sbin/sh"
env[6] @ 0x40012a10: "HOME=/"
env[7] @ 0x40012a20: "TERM=vt100"
env[8] @ 0x40012a38: "PWD=/"
env[9] @ 0x40012a48: "LINES=31"
4027: execve("/usr/bin/quota", 0x400128e8, 0x40012928) = 0 [32-bit]
4025: execve("/sbin/sh", 0x400038907aff01c8, 0x400010e0) [entry]
env[0] @ 0x40001690: "HOME=/"
env[1] @ 0x40002550: "PATH=:/usr/sbin:/usr/bin:/sbin"
env[2] @ 0x40001670: "LOGNAME=root"
env[3] @ 0x40001630: "TERM=vt100"
env[4] @ 0x40001a98: "SHELL=/sbin/sh"
env[5] @ 0x400011f8: "MAIL=/var/mail/root"
4025: execve("/sbin/sh", 0x400038907aff01c8, 0x400010e0) ERR#14 EFAULT
4024: Received signal 18, SIGCLD, in getmsg(), [caught], no siginfo
516: Received signal 18, SIGCLD, in select(), [caught], no siginfo
516: select(31, 0x7aff0390, NULL, NULL, NULL) [sleeping]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 05:06 PM
all mail refused
 
Posts: n/a
Default Re: SIGSEGV error on execve system call

In article <9e1964cc.0309080143.35be3987@posting.google.com >, ujoo wrote:

>int my_execve(char *path, char *argv[], char *envp[])
>{
> /* call original system call */
> return execve(path, argv, envp);
>}


I suspect you may not have terminated argv[] and envp[] with (char *)0.
Why do this anyway ? You don't get a return from a successful execve().

--
<rosannetuerlk@ifrance.com> http://www.ulikeit.biz/promo.php?id=
<joy_edit@mail.online.sh.cn> is over quota
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com