[330] in linux-net channel archive
Page Fault After Stree Test Linux (Ethernet Related)
daemon@ATHENA.MIT.EDU (jongjay (j.) liou)
Wed May 17 11:25:22 1995
Date: Wed, 17 May 1995 07:59:00 -0500
From: "jongjay (j.) liou" <jongjay@bnr.ca>
To: linux-net@vger.rutgers.edu
Hello Gurus:
While I stress test the Linux networking capability,
my program crashed. Have anyone seem this before?
My kernel is 1.2.0.
----------------------------------------------------------------------
Console: colour EGA+ 80x25, 1 virtual console (max 63)
Calibrating delay loop.. ok - 16.77 BogoMips
Serial driver version 4.11 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16450
tty01 at 0x02f8 (irq = 3) is a 16450
hda: ST3250A-XR, 204MB w/120KB Cache, CHS=1024/12/34, MaxMult=16
ide0: primary interface on irq 14
Floppy drive(s): fd0 is 1.44M
FDC 0 is a 8272A
Memory: 7004k/8192k available (628k kernel code, 384k reserved, 176k data)
This processor honours the WP bit even when in supervisor mode. Good.
Swansea University Computer Society NET3.019
Swansea University Computer Society TCP/IP for NET3.019
IP Protocols: ICMP, UDP, TCP
eth0: 3c509 at 0x340 tag 1, 10baseT port, address 00 20 af 9b e8 0c, IRQ 15.
3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov
eth1: 3c509 at 0x300 tag 2, 10baseT port, address 00 20 af d2 86 6f, IRQ 10.
3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov
Checking 'hlt' instruction... Ok.
Linux version 1.2.0 (root@mtx-r3) (gcc version 2.5.8) #6 Fri May 5 10:37:39 GMT 1995
Partition check:
hda: disabled multiple mode
hda: hda1 hda2 hda3
VFS: Mounted root (ext2 filesystem) readonly.
Adding Swap: 32840k swap-space
eth0: Setting Rx mode to -1 addresses.
Unable to handle kernel NULL pointer dereference at virtual address c0000048
current->tss.cr3 = 0056b000, %cr3 = 0056b000
*pde = 00102067
*pte = 00000027
Oops: 0002
EIP: 0010:00146104
EFLAGS: 00010046
eax: 00000000 ebx: 0047c018 ecx: ffffffff edx: 00000000
esi: 001c0008 edi: 001a0580 ebp: 00000008 esp: 00569f60
ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
Process ipclnpgw (pid: 69, process nr: 16, stackpage=00569000)
Stack: 0047c018 001cfd94 001a0580 00146b7b 00000008 0047c018 001a14a0 001cfd94
00000003 00000008 00133b6d 001cfd94 00000008 bffff524 0003752e 50023000
bffff530 001349a8 00000002 00000003 00000008 0056a000 001106b9 00000001
Call Trace: 00146b7b 00133b6d 001349a8 001106b9 0011002b 0011002b
Code: 89 5a 48 fb 5b 5e 5f c3 73 6f 63 6b 2e 63 3a 20 72 65 6d 6f
eth0: Transmitter access conflict.
eth0: Transmitter access conflict.
eth0: Missed interrupt, status then 2011 now 2000 Tx 00 Rx 8000.
eth0: Transmitter access conflict.
eth0: transmit timed out, tx_status 00 status 2000.
eth0: Missed interrupt, status then 2011 now 2000 Tx 00 Rx 821b.
----------------------------------------------------------------------
The program using SOCK_PACKET socket in receiving packets,
while stress testing Linux capability in "recvfrom()"
system call, the running program crashed. I found the
following mesages in the /usr/adm/syslog, it says:
____________________________________________________________________
kernel: Unable to handle kernel NULL Pointer dereference at C0000048
virtual address current->tss.cr3 = 002fb000, Yr3 = 002fb00
*pde = 00102667
*pte = 00000027
____________________________________________________________________
What has happen? something worng in my application or in the
Linux kernel.
The program crashes when Linux receives packets transmitting
to it by 3ms periodicity, the Linux can handle 5ms or greater
periodicity but went unstable if less than 5ms.
I have enclosed a portion of my code. Thank you for you help.
Regards,
Jongjay
The following is my code:
=====================================================================
/*
* pm.c
*/
/* timeout setup for select() */
timeout.tv_sec = 0;
timeout.tv_usec = 500; /* 500 micro second for time out */
/*----------------------------------------------------------------------------
* Binding of Ethernet Card
*---------------------------------------------------------------------------*/
ip_side.sa_family = AF_INET;
802_side.sa_family = AF_INET;
strcpy(ip_side.sa_data , DEVICE0);
strcpy(802_side.sa_data , DEVICE1);
main()
{
....
....
codes deleted
....
....
/*----------------------------------------------------------------------------
* CLNP Socket Initialization
*---------------------------------------------------------------------------*/
fd1 = socket(AF_INET, SOCK_PACKET, htons(ETH_P_802_2));
if(fd1 < 0) {
exit(0);
}
ioctl(fd1, FIOASYNC, &flag);
/*----------------------------------------------------------------------------
* IP Socket Initialization
*---------------------------------------------------------------------------*/
fd2 = socket(AF_INET, SOCK_PACKET, htons(ETH_P_IP));
if(fd2 < 0) {
exit(0);
}
ioctl(fd2, FIOASYNC, &flag);
/*----------------------------------------------------------------------------
* Set Ethernet Cards in Promiscuous Mode
*---------------------------------------------------------------------------*/
if( promiscuous_mode(DEVICE0, 1, fd2) < 0) {
exit(0);
}
if( promiscuous_mode(DEVICE1, 1, fd1) < 0) {
exit(0);
}
max_fd = max(fd1,fd2) + 1; /* check descriptors 0 .. fd2 */
for(;;)
{
/*----------------------------------------------------------------------------
* Event Notification
*---------------------------------------------------------------------------*/
FD_ZERO(&fdset);
FD_SET(fd1, &fdset);
FD_SET(fd2, &fdset);
select(max_fd, &fdset, (fd_set *)NULL, (fd_set *)NULL, &timeout);
if(FD_ISSET(fd1, &fdset) == 1)
{ fd = fd1;
packet_switch = CLNP;
/*----------------------------------------------------------------------------
* Receive 802 Packet
*---------------------------------------------------------------------------*/
len = recvfrom(fd, &my_ucarray, MAX_PACK_LEN, 0, &802_side, &from_len);
memcpy (&my_total_len,
&(my_ucarray [CLNP_TOTAL_LEN_INDEX]),
sizeof (int));
my_swapped_total_len = ntohs (my_total_len);
if(clnp_side.sa_data[3] == '1') /* Guarante to be eth1 */
{
if(len != -1) {
some_data_in = std_input_buffer;
BuffUsedSet (some_data_in, my_swapped_total_len);
/*-----------------------------------------------------------
* Process the received my_ucarray here
*----------------------------------------------------------*/
....
codes deleted
....
}
}
}
if (FD_ISSET(fd2, &fdset) == 1)
{ fd = fd2;
packet_switch = IP;
/*----------------------------------------------------------------------------
* Receive IP Packet
*---------------------------------------------------------------------------*/
len = recvfrom(fd, &my_ucarray, MAX_PACK_LEN, 0, &ip_side, &from_len);
memcpy (&my_total_len,
&(my_ucarray [IP_TOTAL_LEN_INDEX]),
sizeof (int));
my_swapped_total_len = ntohs (my_total_len);
if(ip_side.sa_data[3] == '0') /* Guarante to be eth0 */
{
if(len != -1) {
some_data_in = std_input_buffer;
BuffUsedSet (some_data_in, my_swapped_total_len);
memcpy(BuffData(some_data_in), &(my_ucarray [IP_START]),
my_swapped_total_len);
/*-----------------------------------------------------------
* Process the received my_ucarray here
*----------------------------------------------------------*/
....
codes deleted
....
}
}
}
} /* end forever loop */
} /* end main() */