Skip to contentSkip to conversation

gcc 3.2 is available for RedHat 7.3/mips/mipsel

DISCUSSION H. J. Lu 5 participants 11 messages Oct 5, 2002 – Nov 14, 2002 MIPS

lore
Share & tools
lore

H. J. Lu

author
#0 lore raw

The gcc 3.2 mips/mipsel binary rpms for RedHat 7.3 are at

ftp://ftp.linux-mips.org/pub/linux/mips/redhat/7.3/test/

They come from my RedHat 8.0 MIPS port. The simple install instructions are in INSTALL. I am interested in any feedbacks.

H.J.

#1 lore raw

explain to me how this works...

I have a 64-bit kernel and O32 userland.

I notice that arping gets confused because the syscall socket() is returning 4183 instead of a reasonable value like 3... if strace() isn't lying to me.

How do I debug this? The O32 userland calls through the socketcall() syscall. It looks OK.

greg

#2 lore raw

Re: explain to me how this works...

see arch/mips64/kernel/linux32.c

Quoted 13 lines · Greg Lindahl

I have a 64-bit kernel and O32 userland.

I notice that arping gets confused because the syscall socket() is returning 4183 instead of a reasonable value like 3... if strace() isn't lying to me.

How do I debug this? The O32 userland calls through the socketcall() syscall. It looks OK.

greg

#3 lore raw

Re: explain to me how this works...

I saw that a long time ago. sys_socket and sys_socketcall seem to be written just like all the other syscalls that return an int.

Quoted 16 lines

see arch/mips64/kernel/linux32.c

Quoted 13 lines · Greg Lindahl

I have a 64-bit kernel and O32 userland.

I notice that arping gets confused because the syscall socket() is returning 4183 instead of a reasonable value like 3... if strace() isn't lying to me.

How do I debug this? The O32 userland calls through the socketcall() syscall. It looks OK.

greg

#4 lore raw

Re: explain to me how this works...

In reply to Greg Lindahl
Quoted 8 lines · Greg Lindahl

I have a 64-bit kernel and O32 userland.

I notice that arping gets confused because the syscall socket() is returning 4183 instead of a reasonable value like 3... if strace() isn't lying to me.

How do I debug this? The O32 userland calls through the socketcall() syscall. It looks OK.

Eh? Nothing on MIPS should use socketcall(2); we have all the calls like socket(2), bind(2), connect(2) etc. directly in our syscall table unlike x86 which uses this pointless wrapper for historical reasons. We only have socketcall(2) in the o32 syscall interface but it's a candidate for removal as nothing we still do support and that's glibc 2.0 and higher binaries uses it.

Ralf

#5 lore raw

Re: explain to me how this works...

Quoted 1 line · Ralf Baechle

Eh? Nothing on MIPS should use socketcall(2);

OK, so let's say it's using socket(). How do I go about debugging this? I mean, I can start sprinkling printks all over the place, but is there a more clever way?

greg

#6 lore raw

Re: explain to me how this works...

Look like a good case for using kgdb....

Jun

Quoted 10 lines · Greg Lindahl
Quoted 1 line · Ralf Baechle

Eh? Nothing on MIPS should use socketcall(2);

OK, so let's say it's using socket(). How do I go about debugging this? I mean, I can start sprinkling printks all over the place, but is there a more clever way?

greg

#7 lore raw

Re: explain to me how this works...

Quoted 1 line · Jun Sun

Look like a good case for using kgdb....

Unlikely to help him. The return value 4183 of socket that he's observing is the syscall number of socket(2). That's making scall_o32.S the first suspect to look at.

Greg, could this be a case of syscall restarting that you're observing?

Ralf

#8 lore raw

Re: explain to me how this works...

Quoted 2 lines · Ralf Baechle

Unlikely to help him. The return value 4183 of socket that he's observing is the syscall number of socket(2).

Thank you, I should have noticed that one right off.

My sprinkle of printks already tells me that strace is a liar - no surprise there.

strace says:

socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = -1 EAFNOSUPPORT (Address family not supported by protocol)

printk says:

sys_socket returning 0
sys32_socket returning 0
sys_socket returning -124
sys32_socket returning -124

Note strace sees 3 syscalls. I only printk at the return statement, and there are 2 of those. I'll add more printks...

-- greg

#9 lore raw

Re: explain to me how this works...

Quoted 3 lines · Greg Lindahl
socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = -1 EAFNOSUPPORT (Address family not supported by protocol)

strace is useless.

My problem was that CONFIG_PACKET was not set in my .config, which causes EAFNOSUPPORT.

-- greg

#10 lore raw

Re: explain to me how this works...

In reply to Greg Lindahl
Quoted 8 lines · Greg Lindahl

strace says:

socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = 4183
socket(PF_PACKET, SOCK_DGRAM, 0)        = -1 EAFNOSUPPORT (Address family not supported by protocol)

printk says:

Quoted 7 lines

sys_socket returning 0
sys32_socket returning 0
sys_socket returning -124
sys32_socket returning -124

Note strace sees 3 syscalls. I only printk at the return statement, and there are 2 of those. I'll add more printks...

This smells alot like syscall restarting. The first two times the syscall fails with one of ERESTARTNOHAND, ERESTARTSYS or ERESTARTNOINTR, then the third time is fails with EAFNOSUPPORT.

Enable CONFIG_PACKET and CONFIG_NETLINK_DEV.

The only bug here is strace being to stupid to filter out syscall restarts.

Ralf