Skip to contentSkip to conversation

0xffffe002 in ??

DISCUSSION KV Pavuram 3 participants 5 messages Jun 21, 2005 – Jun 23, 2005

lore
Share & tools
lore

KV Pavuram

author
#0 lore raw

I am running a multithreaded application on Linux 2.4 kernel (RedHat Linux 9).

At some point the program receives a seg. fault and if i check info threads, using gdb for debug, almost all the threads are at "0xffffe002 in ??"

When I switch to each of these tasks, and try x/i for 0xffffe002, cannot access address.

What could be the problem?

Please help.

Regards,
Pav.

__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com

#1 lore raw
Quoted 7 lines · KV Pavuram

I am running a multithreaded application on Linux 2.4 kernel (RedHat Linux 9).

At some point the program receives a seg. fault and if i check info threads, using gdb for debug, almost all the threads are at "0xffffe002 in ??"

If a number of threads arrive at the same bad address you should look for some common code that calls through a function pointer. If you don't have any calls through pointers, then you may have something corrupting the stack so that the return address of a called function gets corrupted. For instance, if the value 0x02e0 was written beyond array limits in local (stack) data, then when that function returned it could actually end up 'returning' to the bad address you discovered.

Although the kernel provided the seg-fault mechanism, this is not a kernel problem. This is a user-code problem.

Quoted 9 lines

When I switch to each of these tasks, and try x/i for 0xffffe002, cannot access address.

What could be the problem?

Please help.

Regards,
Pav.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.

author
#2 lore raw

Hi,

What about the webpage

https://bugzilla.redhat.com/bugzilla/long_list.cgi?buglist=104763

I am a kernel newbie, so I couldnt catch what is being explained in the page though. But i do have pthread_cond_wait in my code that are called too often.

Regards,
Pav.

--- "Richard B. Johnson" <[email protected]>

Quoted 45 lines · wrote:
Quoted 1 line · KV Pavuram

I am running a multithreaded application on Linux

2.4

Quoted 3 lines

kernel (RedHat Linux 9).

At some point the program receives a seg. fault

and if

Quoted 1 line

i check info threads, using gdb for debug, almost

all

Quoted 2 lines

the threads are at "0xffffe002 in ??"

If a number of threads arrive at the same bad address you
should look for some common code that calls through a function pointer. If you don't have any calls through
pointers, then you may have something corrupting the stack
so that the return address of a called function gets corrupted. For instance, if the value 0x02e0 was written
beyond array limits in local (stack) data, then when that
function returned it could actually end up 'returning'
to the bad address you discovered.

Although the kernel provided the seg-fault
mechanism, this
is not a kernel problem. This is a user-code
problem.

Quoted 1 line

When I switch to each of these tasks, and try x/i

for

Quoted 8 lines

0xffffe002, cannot access address.

What could be the problem?

Please help.

Regards,
Pav.

Quoted 9 lines

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by
Dictator Bush.
98.36% of all statistics are
fiction.

__________________________________________________________
Free antispam, antivirus and 1GB to save all your messages Only in Yahoo! Mail: http://in.mail.yahoo.com

#3 lore raw
In reply to Richard B. Johnson
Quoted 8 lines · Richard B. Johnson
Quoted 6 lines · KV Pavuram

I am running a multithreaded application on Linux 2.4 kernel (RedHat Linux 9).

At some point the program receives a seg. fault and if i check info threads, using gdb for debug, almost all the threads are at "0xffffe002 in ??"

It most likely is something in VDSO:

# pmap 1
1: init
Start         Size Perm Mapping
08048000      704K r-xp /app/bash-3.0-uc/bin/bash
080f8000       28K rwxp /app/bash-3.0-uc/bin/bash
080ff000       40K rwxp [heap]
b7f20000      272K r-xp /app/uclibc-0.9.26/lib/libuClibc-0.9.26.so
b7f64000        8K rwxp /app/uclibc-0.9.26/lib/libuClibc-0.9.26.so
b7f66000       16K rwxp [ anon ]
b7f6a000        8K r-xp /app/uclibc-0.9.26/lib/libdl-0.9.26.so
b7f6c000        4K rwxp /app/uclibc-0.9.26/lib/libdl-0.9.26.so
b7f6e000        4K rwxp [ anon ]
b7f6f000       16K r-xp /app/uclibc-0.9.26/lib/ld-uClibc-0.9.26.so
b7f73000        4K rwxp /app/uclibc-0.9.26/lib/ld-uClibc-0.9.26.so
bff5d000       88K rwxp [ stack ]
ffffe000        4K ---p [vdso]       <====================================
mapped: 1196K    writeable/private: 192K    shared: 0K
Quoted 10 lines

If a number of threads arrive at the same bad address you should look for some common code that calls through a function pointer. If you don't have any calls through pointers, then you may have something corrupting the stack so that the return address of a called function gets corrupted. For instance, if the value 0x02e0 was written beyond array limits in local (stack) data, then when that function returned it could actually end up 'returning' to the bad address you discovered.

Quoted 2 lines

Although the kernel provided the seg-fault mechanism, this is not a kernel problem. This is a user-code problem.

I'm not so sure.
--
vda

author
#4 lore raw

I think the threads are going into that strange address when they are waiting over an IPC object like semaphore or mutex. Atleast i saw a thread come out of that strange address immed. after another threads released a semaphore!!

Thanks for the inputs.

Pav.

Quoted 60 lines · --- Denis Vlasenko
Quoted 3 lines · Richard B. Johnson
Quoted 1 line · KV Pavuram

I am running a multithreaded application on

Linux 2.4

Quoted 3 lines
Quoted 3 lines

kernel (RedHat Linux 9).

At some point the program receives a seg. fault

and if

Quoted 1 line
Quoted 1 line

i check info threads, using gdb for debug,

almost all

Quoted 1 line
Quoted 1 line

the threads are at "0xffffe002 in ??"

It most likely is something in VDSO:

# pmap 1
1: init
Start         Size Perm Mapping
08048000      704K r-xp /app/bash-3.0-uc/bin/bash
080f8000       28K rwxp /app/bash-3.0-uc/bin/bash
080ff000       40K rwxp [heap]
b7f20000      272K r-xp
/app/uclibc-0.9.26/lib/libuClibc-0.9.26.so
b7f64000        8K rwxp
/app/uclibc-0.9.26/lib/libuClibc-0.9.26.so
b7f66000       16K rwxp [ anon ]
b7f6a000        8K r-xp
/app/uclibc-0.9.26/lib/libdl-0.9.26.so
b7f6c000        4K rwxp
/app/uclibc-0.9.26/lib/libdl-0.9.26.so
b7f6e000        4K rwxp [ anon ]
b7f6f000       16K r-xp
/app/uclibc-0.9.26/lib/ld-uClibc-0.9.26.so
b7f73000        4K rwxp
/app/uclibc-0.9.26/lib/ld-uClibc-0.9.26.so
bff5d000       88K rwxp [ stack ]
ffffe000        4K ---p [vdso]      
<====================================
mapped: 1196K    writeable/private: 192K    shared:
0K
Quoted 1 line

If a number of threads arrive at the same bad

address you

Quoted 1 line

should look for some common code that calls

through

Quoted 1 line

a function pointer. If you don't have any calls

through

Quoted 1 line

pointers, then you may have something corrupting

the stack

Quoted 1 line

so that the return address of a called function

gets

Quoted 1 line

corrupted. For instance, if the value 0x02e0 was

written

Quoted 1 line

beyond array limits in local (stack) data, then

when that

Quoted 1 line

function returned it could actually end up

'returning'

Quoted 1 line

to the bad address you discovered.

Quoted 10 lines
Quoted 1 line

Although the kernel provided the seg-fault

mechanism, this

Quoted 1 line

is not a kernel problem. This is a user-code

problem.

I'm not so sure.
--
vda

__________________________________________________________
Free antispam, antivirus and 1GB to save all your messages Only in Yahoo! Mail: http://in.mail.yahoo.com