Discussion:
init: can't exec /bin/sh for /etc/rc: Cannot allocate memory
Sebastian Stark
2003-03-25 17:29:07 UTC
Permalink
I'm having this problem and want to know the reason.

After the kernel has started up and init tries to execute /etc/rc, the
following happens:


[...] (kernel messages)
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
Mar 25 16:59:27 init: can't exec /bin/sh for /etc/rc: Cannot allocate memory

Then I press ctrl-c:

^CMar 25 16:59:36 init: /bin/sh on /etc/rc terminated abnormally, going to
single user mode
Enter pathname of shell or RETURN for sh:
[return]
Terminal type? wsvt25
# mount /
# sh /etc/rc
[...]

Now I have a single user shell. I can mount / rw and exec "sh /etc/rc" by hand
and the system works without problems! (works = runs a whole day and does
packetfiltering, database serving und web serving)

My first guess was memory so I pulled off half of it, tried again, pulled off
the other half, tried again, put in completely different memory, tried again.
Always the same. This is 100% reproduceable.

Could the processor be broken? Something on the board?

I'm just interested in what's going on here, maybe someone can tell me.
This is an i386 snapshot from Mar 6 which ran just fine since two weeks ago so
I *bet* it's the hardware.

Full dmesg:

OpenBSD 3.3 (GENERIC) #19: Thu Mar 6 18:43:26 MST 2003
***@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: F00F bug workaround installed
cpu0: Intel Pentium/MMX ("GenuineIntel" 586-class) 232 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,MMX
real mem = 33140736 (32364K)
avail mem = 25174016 (24584K)
using 430 buffers containing 1761280 bytes (1720K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(d4) BIOS, date 07/14/97, BIOS32 rev. 0 @ 0xfafc0
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
pcibios0 at bios0: rev. 2.1 @ 0xf0000/0xb484
pcibios0: PCI BIOS has 6 Interrupt Routing table entries
pcibios0: PCI Interrupt Router at 000:07:0 ("Intel 82371SB PCI-ISA" rev 0x00)
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xc0000/0x8000
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82437VX" rev 0x02
pcib0 at pci0 dev 7 function 0 "Intel 82371SB PCI-ISA" rev 0x01
pciide0 at pci0 dev 7 function 1 "Intel 82371SB IDE" rev 0x00: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <IBM-DHEA-36481>
wd0: 16-sector PIO, LBA, 6197MB, 12592 cyl, 16 head, 63 sec, 12692736 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <SONY, CD-ROM CDU55E, 1.0u> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 0
vga1 at pci0 dev 9 function 0 "S3 Trio32/64" rev 0x54
wsdisplay0 at vga1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
rl0 at pci0 dev 10 function 0 "Realtek 8139" rev 0x10: irq 10 address 00:e0:7d:74:94:f2
rlphy0 at rl0 phy 0: RTL internal phy
rl1 at pci0 dev 11 function 0 "Realtek 8139" rev 0x10: irq 9 address 00:30:84:26:23:35
rlphy1 at rl1 phy 0: RTL internal phy
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask c040 netmask c640 ttymask c6c2
pctr: 586-class performance counters and user-level cycle counter enabled
dkcsum: wd0 matched BIOS disk 80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
--
Free your mind and your ass will follow -- http://www.funkaffair.de
Sebastian Stark
2003-03-30 13:18:30 UTC
Permalink
Post by Sebastian Stark
[...] (kernel messages)
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
Mar 25 16:59:27 init: can't exec /bin/sh for /etc/rc: Cannot allocate memory
^CMar 25 16:59:36 init: /bin/sh on /etc/rc terminated abnormally, going to
single user mode
[return]
Terminal type? wsvt25
# mount /
# sh /etc/rc
[...]
Now I have a single user shell. I can mount / rw and exec "sh /etc/rc" by hand
and the system works without problems! (works = runs a whole day and does
packetfiltering, database serving und web serving)
grumble... typo in /etc/login.conf...
--
Free your mind and your ass will follow -- http://www.funkaffair.de
Loading...