Hi, again. If you've seen my other post I just found out using xwpe
and stepping thru the program that the segmentation fault occurs when
I use the strlen() function it recieves the SIGSEGV signal.
/lib/ld-linux.so.1 dl_boot:mmap of /dev/zero failed!
Any knowledgeable programmers out there got an answer for a newbie?
There are 3 causes I've seen for this behavior of strlen.
1. Passing a NULL pointer to strlen.
2. Passing an uninitialized pointer to strlen.
3. Passing a pointer to a character array that's not nul terminated.
In particular, I saw case 1 several times in code I ported from HP-UX
to Solaris. HP-UX evidently puts something at address 0, whereas
Solaris makes sure 0 is an invalid address. This lead to code that
seemed to work right for HP-UX that broke when ported to Solaris.
In reality, it was also broken for HP-UX, relying on what the ANSI C
standard says is "undefined behavior".
J. P. Schoonover
> What gives?
Software: Slackware 3.1
Hardware: AMD K5 75 MHz, Triton motherboard, NE 2000 clone, IDE
Problem: Networking works fine for everything from ping to httpd server;
however, after a period of inactivity of somewhere from 1 hour to
days every networking function stops working, even ping, and produces a
divide by zero / segmentation fault error. Killing inetd and restarting
it does not solve the problem.
Here is the entry the kernel writes to syslog after an error:
divide error: 0000
eax: 00000000 ebx: 0f6bdee9 ecx: 00001e5a edx: 000026f8
esi: 9728c179 edi: 00000000 ebp: 00000604 esp: 001ac61c
ds: 0018 es: 0018 fs: 002b gs: 0018 ss: 0018
Process swapper (pid: 0, process nr: 0, stackpage=001aa79c)
Stack: 001ac660 00000246 00252e30 0010ed56 01b0dc00 00252e14
0014378e 001ac660 001af128 00252e00 00252e30
00000000 00252df2 00002e34 00196552 b3bafdcc 00250018 32a200ff
000927d9 0013ce77 00252e30 001b9260 00000000 b3bafdcc
Call Trace: [get_cpuinfo+434/440] [tcp_connect+742/1072]
[do_signal+95/612] [init+416/828] [do_signal+214/612]
Code: f7 f1 a3 bc a0 1a 00 89 c3 0f 31 31 d2 29 f0 f7 e3 81 fa f7
Aiee, killing interrupt handler
kfree of non-kmalloced memory: 001ac7e4, next=00000000, order=0
kfree of non-kmalloced memory: 001ac7d4, next=00000000, order=0
kfree of non-kmalloced memory: 001acc08, next=00000000, order=0
idle task may not sleep
The segmentation fault message does not appear in the syslog but does
appear on the screen.
I turned off all power management features in the BIOS and used
setterm -blank 0 to turn off screen saving, however that did not solve
Another poster experienced a similar problem, and the only apparent
similarities are Slackware and AMD K5 CPU.
Any of you gurus have any suggestions for fixes or even further
diagnosis? I'm stuck.