Operating System - HP-UX
1821051 Members
2481 Online
109631 Solutions
New Discussion юеВ

lseek system call failure due to SIGSEGV

 
Pankaj Agrawal
Occasional Advisor

lseek system call failure due to SIGSEGV

The following lseek call in failing due to the receipt of SIGSEGV signal. Can someone comment on the possible cause.

lseek(10, 0, 0) = 0

The truss output of the process is as shown:

Incurred fault #6, FLTBOUNDS %pc = 0xBFFC9550
siginfo: SIGSEGV SEGV_ACCERR addr=0x00000000
Received signal #11, SIGSEGV [caught]
siginfo: SIGSEGV SEGV_ACCERR addr=0x00000000

The process is getting killed as a result
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: lseek system call failure due to SIGSEGV

I rather doubt that it is lseek() that is failing because all of the parameters are reasonable. This looks more like the actual failure occurred in a read() or write() and a NULL pointer was passed. It's possible for lseek() to give very strange results in some implementations if for example you attempt to lseek() on a file that does not support random access, e.g. a serial device.
If it ain't broke, I can fix that.
Pankaj Agrawal
Occasional Advisor

Re: lseek system call failure due to SIGSEGV

Clay, thanks for the info...
But still i am unable to figure out the actual cause. I am attaching a detailed truss output...

sigsuspend(0x080475CC) (sleeping...)
Received signal #14, SIGALRM, in sigsuspend) [caught]
sigsuspend(0x080475CC) Err#4 EINTR
setcontext(0x080473A4)
alarm(0) = 0
sigprocmask(SIG_UNBLOCK, 0x080475DC, 0x00000000) = 0
sigaction(SIGALRM, 0x08047574, 0x00000000) = 0
getpid() = 15237 [ 7000 ]
time() = 1121145011
xstat(2, "xui5001A.trace", 0x080475A0) = 0
fxstat(2, 7, 0x080474C4) = 0
write(7, " T R A C E 1 : C N C".., 113) = 113
fcntl(9, F_SETLK, 0x080476AC) = 0
getpid() = 15237 [ 7000 ]
time() = 1121145011
xstat(2, "xui5001A.trace", 0x08047478) = 0
fxstat(2, 7, 0x0804739C) = 0
write(7, " T R A C E 1 : C N C".., 105) = 105
ioctl(9, TCGETA, 0x080473FC) Err#25 ENOTTY
fxstat(2, 9, 0x08047430) = 0
read(9, " U s e r I D = 0 0 4 5 6".., 8192) = 16
getpid() = 15237 [ 7000 ]
time() = 1121145011
xstat(2, "xui5001A.trace", 0x08047478) = 0
fxstat(2, 7, 0x0804739C) = 0
write(7, " T R A C E 1 : C N C".., 105) = 105
lseek(9, 0, 0) = 0
Incurred fault #6, FLTBOUNDS %pc = 0xBFFC9550
siginfo: SIGSEGV SEGV_ACCERR addr=0x00000000
Received signal #11, SIGSEGV [caught]
siginfo: SIGSEGV SEGV_ACCERR addr=0x00000000
sigaction(SIGSEGV, 0x08047304, 0x00000000) = 0
sigrelse(SIGSEGV) = SIG_DFL
umask(0) = 0
open("/opt/topenddir/logs/tp_err", O_RDWR|O_APPEND|O_CREAT, 0666) = 10
umask(0) = 0
time() = 1121145011
fcntl(4, F_SETLKW, 0x08046424) = 0
fcntl(4, F_SETLKW, 0x08046424) = 0
fcntl(4, F_SETLK, 0x0804655C) = 0
fcntl(4, F_SETLK, 0x0804655C) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
fcntl(10, F_SETLKW, 0x0804655C) = 0
fcntl(10, F_SETLKW, 0x0804655C) = 0
xstat(2, "/opt/topenddir/logs/tp_err_init", 0x08046954) = 0
xstat(2, "/opt/topenddir/logs/tp_err", 0x080468CC) = 0
ioctl(10, TCGETA, 0x080464B0) Err#25 ENOTTY
fxstat(2, 10, 0x080464E4) = 0
fcntl(10, F_SETLK, 0x08046554) = 0
fcntl(10, F_SETLK, 0x08046554) = 0
msgsnd(3, 0x08046D70, 146, IPC_NOWAIT) = 0
write(10, " 0 7 / 1 2 / 0 5 | 0 5 :".., 141) = 141
close(10) = 0
fcntl(4, F_SETLKW, 0x08046424) = 0
fcntl(4, F_SETLKW, 0x08046424) = 0
write(4, "\n # #\n 4 | 0 7 / 1 2 /".., 145) = 145
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046520) = 0
fxstat(2, 4, 0x08046498) = 0
fcntl(4, F_SETLK, 0x0804655C) = 0
fcntl(4, F_SETLK, 0x0804655C) = 0
fcntl(4, F_SETLKW, 0x08046E0C) = 0
fcntl(4, F_SETLKW, 0x08046E0C) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
write(4, "\n # #\n 1 | 0 7 / 1 2 /".., 129) = 129
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046F08) = 0
fxstat(2, 4, 0x08046E80) = 0
fcntl(4, F_SETLK, 0x08046F44) = 0
fcntl(4, F_SETLK, 0x08046F44) = 0
fcntl(4, F_SETLKW, 0x08046DDC) = 0
fcntl(4, F_SETLKW, 0x08046DDC) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
write(4, "\n # #\n 1 | 0 7 / 1 2 /".., 133) = 133
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046ED8) = 0
fxstat(2, 4, 0x08046E50) = 0
fcntl(4, F_SETLK, 0x08046F14) = 0
fcntl(4, F_SETLK, 0x08046F14) = 0
fcntl(4, F_SETLKW, 0x08046DD8) = 0
fcntl(4, F_SETLKW, 0x08046DD8) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
write(4, "\n # #\n 1 | 0 7 / 1 2 /".., 163) = 163
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046ED4) = 0
fxstat(2, 4, 0x08046E4C) = 0
fcntl(4, F_SETLK, 0x08046F10) = 0
fcntl(4, F_SETLK, 0x08046F10) = 0
fcntl(4, F_SETLKW, 0x08046DD4) = 0
fcntl(4, F_SETLKW, 0x08046DD4) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
write(4, "\n # #\n 2 | 0 7 / 1 2 /".., 8153) = 8153
write(4, "\n 0 8 0 7 8 7 4 4 1 3".., 7823) = 7823
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046ED0) = 0
fxstat(2, 4, 0x08046E48) = 0
fcntl(4, F_SETLK, 0x08046F0C) = 0
fcntl(4, F_SETLK, 0x08046F0C) = 0
fcntl(4, F_SETLKW, 0x08046DD4) = 0
fcntl(4, F_SETLKW, 0x08046DD4) = 0
time() = 1121145011
getpid() = 15237 [ 7000 ]
write(4, "\n # #\n 2 | 0 7 / 1 2 /".., 8192) = 8192
write(4, "\n 0 8 0 8 6 a 3 8 0 6".., 7937) = 7937
xstat(2, "/opt/topenddir/rdba/ac/xui5001/tp_logfile", 0x08046ED0) = 0
fxstat(2, 4, 0x08046E48) = 0
fcntl(4, F_SETLK, 0x08046F0C) = 0
fcntl(4, F_SETLK, 0x08046F0C) = 0
sighold(SIGSEGV) = SIG_DFL
getpid() = 15237 [ 7000 ]
kill(15237, SIGSEGV) = 0
setcontext(0x08047434)
Received signal #11, SIGSEGV [default]
siginfo: SIGSEGV pid=15237 uid=201
*** process killed ***


Lemme know if u have some suggestion...