gmzang / maczfs

Automatically exported from code.google.com/p/maczfs
Other
0 stars 0 forks source link

Kernel panic when unable to allocate enough memory #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I only use my ZFS pools for doing an rsync then a snapshot.  During the rsync I 
got a kernel panic.  Strangely it looks like a memory allocation failure, 
yet there was very little running on the system at the time as I was getting 
ready to reboot.  So there was plenty of system memory.  Here is the log if it 
helps:

macpro:~ sam$ cat 
/Library/Logs/DiagnosticReports/Kernel_2010-01-09-110035_macpro.panic 
Sat Jan  9 11:00:35 2010
panic(cpu 2 caller 0x83cca64c): "zfs: vmem_alloc couldn't alloc 131072 
bytes\n"@/Users/dustin/prog/eprojects/mac-
zfs/zfs_kext/zfs/zfs_context.c:700
Backtrace (CPU 2), Frame : Return Address (4 potential args on stack)
0x841f3a38 : 0x21b2bd (0x5cf868 0x841f3a6c 0x223719 0x0) 
0x841f3a88 : 0x83cca64c (0x83d1e838 0x20000 0x20000 0x83cca9ac) 
0x841f3ab8 : 0x83ce527d (0x83d32d94 0x20000 0x0 0x83c82dcb) 
0x841f3b08 : 0x83c81638 (0xe18d800 0x0 0x841f3b38 0x83cca9ac) 
0x841f3b28 : 0x83c8ae3b (0x20000 0x0 0x83d2b270 0x83ce5588) 
0x841f3b88 : 0x83c8b6c4 (0xe18d000 0x0 0x841f3bb8 0x83cca9ac) 
0x841f3bb8 : 0x83c91b44 (0xe89c000 0x20000 0xbf6d1030 0x0) 
0x841f3c08 : 0x83c98c15 (0xbf6d1030 0x13b8b780 0x20000 0x0) 
0x841f3c88 : 0x83c72208 (0xe923270 0x18a37c 0x0 0x841f3ec4) 
0x841f3dc8 : 0x2f98a5 (0x841f3dec 0x3 0x841f3e18 0x57c9b4) 
0x841f3e18 : 0x2ee798 (0x19e9dd7c 0x841f3ec4 0x1 0x841f3f54) 
0x841f3e78 : 0x49606e (0x10e4c9c0 0x841f3ec4 0x0 0x841f3f54) 
0x841f3f18 : 0x4961cc (0x841f3f54 0x10e4c9c0 0x1ad000 0x1) 
0x841f3f78 : 0x4ee947 (0x12b0a540 0xe172b88 0xefa6d54 0x1) 
0x841f3fc8 : 0x29e3fd (0xe172b84 0x0 0x10 0xceb2244) 
      Kernel Extensions in backtrace (with dependencies):
         com.apple.filesystems.zfs(8.0)@0x83c6e000->0x83d32fff

BSD process name corresponding to current thread: rsync

Mac OS version:
10C540

Kernel version:
Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; 
root:xnu-1486.2.11~1/RELEASE_I386
System model name: MacPro1,1 (Mac-F4208DC8)

System uptime in nanoseconds: 1807549187311526
unloaded kexts:
com.apple.filesystems.cd9660    1.4.0 (addr 0x82d49000, size 0x36864) - last 
unloaded 1807447274890616
loaded kexts:
com.parallels.kext.prl_vnic 5.0 9220.531002
com.vmware.kext.vmnet   3.0.0
com.parallels.kext.prl_netbridge    5.0 9220.531002
com.vmware.kext.vmioplug    3.0.0
com.parallels.kext.prl_usb_connect  5.0 9220.531002
com.vmware.kext.vmci    3.0.0
com.parallels.kext.prl_hid_hook 5.0 9220.531002
com.vmware.kext.vmx86   3.0.0
com.parallels.kext.prl_hypervisor   5.0 9220.531002
com.microsoft.driver.MicrosoftMouseUSB  7.0.0
com.microsoft.driver.MicrosoftMouse 7.0.0
com.highpoint-tech.kext.HighPointIOP    2.0.1
com.apple.filesystems.afpfs 9.6 - last loaded 1807345110030968
com.apple.nke.asp_tcp   5.0
com.apple.filesystems.webdav    1.8
com.apple.driver.AppleHWSensor  1.9.2d0
com.apple.filesystems.autofs    2.1.0
com.apple.Dont_Steal_Mac_OS_X   7.0.0
com.apple.iokit.CHUDUtils   201
com.apple.iokit.CHUDProf    212
com.apple.driver.AppleUpstreamUserClient    3.1.0
com.apple.GeForce   6.0.6
com.apple.driver.AudioIPCDriver 1.1.2
com.apple.driver.AppleHDA   1.7.9a4
com.apple.driver.AppleUSBDisplays   2.2
com.apple.driver.AppleIntel8254XEthernet    2.1.1b7
com.apple.driver.AirPortBrcm43xx    421.91.26
com.apple.driver.AppleIntelMeromProfile 19
com.apple.driver.AppleMCEDriver 1.1.9
com.apple.driver.ACPI_SMC_PlatformPlugin    4.0.1d0
com.apple.driver.AppleLPC   1.4.9
com.apple.filesystems.zfs   8.0
com.apple.iokit.SCSITaskUserClient  2.6.0
com.apple.BootCache 31
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.driver.AppleFWOHCI    4.4.0
com.apple.driver.AppleUSBHub    3.8.4
com.apple.driver.AppleIntelPIIXATA  2.5.0
com.apple.iokit.IOAHCIBlockStorage  1.6.0
com.apple.driver.AppleAHCIPort  2.0.1
com.apple.driver.AppleEFINVRAM  1.3.0
com.apple.driver.AppleUSBEHCI   3.7.5
com.apple.driver.AppleUSBUHCI   3.7.5
com.apple.driver.AppleACPIButtons   1.3
com.apple.driver.AppleRTC   1.3
com.apple.driver.AppleHPET  1.4
com.apple.driver.AppleSMBIOS    1.4
com.apple.driver.AppleACPIEC    1.3
com.apple.driver.AppleAPIC  1.4
com.apple.driver.AppleIntelCPUPowerManagementClient 96.0.0
com.apple.security.sandbox  0
com.apple.security.quarantine   0
com.apple.nke.applicationfirewall   2.1.11
com.apple.driver.AppleIntelCPUPowerManagement   96.0.0
com.apple.driver.AppleProfileReadCounterAction  17
com.apple.driver.AppleProfileTimestampAction    10
com.apple.driver.AppleProfileThreadInfoAction   14
com.apple.driver.AppleProfileRegisterStateAction    10
com.apple.driver.AppleProfileKEventAction   10
com.apple.driver.AppleProfileCallstackAction    20
com.apple.iokit.IOSurface   73.0
com.apple.iokit.IOBluetoothSerialManager    2.2.4f3
com.apple.iokit.IOSerialFamily  10.0.3
com.apple.iokit.CHUDKernLib 203
com.apple.driver.DspFuncLib 1.7.9a4
com.apple.driver.AppleUSBAudio  2.6.6b2
com.apple.iokit.IOAudioFamily   1.7.2fc1
com.apple.kext.OSvKernDSPLib    1.3
com.apple.nvidia.nv50hal    6.0.6
com.apple.NVDAResman    6.0.6
com.apple.iokit.IONDRVSupport   2.0
com.apple.iokit.IOFireWireIP    2.0.3
com.apple.iokit.IO80211Family   310.6
com.apple.iokit.IONetworkingFamily  1.9
com.apple.iokit.AppleProfileFamily  41
com.apple.driver.AppleHDAController 1.7.9a4
com.apple.iokit.IOGraphicsFamily    2.0
com.apple.iokit.IOHDAFamily 1.7.9a4
com.apple.driver.AppleSMC   3.0.1d2
com.apple.driver.IOPlatformPluginFamily 4.0.1d0
com.apple.driver.CSRUSBBluetoothHCIController   2.2.4f3
com.apple.driver.AppleUSBBluetoothHCIController 2.2.4f3
com.apple.iokit.IOBluetoothFamily   2.2.4f3
com.apple.iokit.IOSCSIBlockCommandsDevice   2.6.0
com.apple.iokit.IOUSBMassStorageClass   2.5.1
com.apple.iokit.IOUSBHIDDriver  3.8.4
com.apple.driver.AppleUSBMergeNub   3.8.5
com.apple.driver.AppleUSBComposite  3.7.5
com.apple.iokit.IOSCSIMultimediaCommandsDevice  2.6.0
com.apple.iokit.IOBDStorageFamily   1.6
com.apple.iokit.IODVDStorageFamily  1.6
com.apple.iokit.IOCDStorageFamily   1.6
com.apple.driver.XsanFilter 402.1
com.apple.iokit.IOATAPIProtocolTransport    2.5.0
com.apple.iokit.IOSCSIParallelFamily    2.0.0
com.apple.iokit.IOSCSIArchitectureModelFamily   2.6.0
com.apple.iokit.IOFireWireFamily    4.1.7
com.apple.iokit.IOUSBUserClient 3.8.5
com.apple.iokit.IOATAFamily 2.5.0
com.apple.iokit.IOAHCIFamily    2.0.2
com.apple.iokit.IOUSBFamily 3.8.5
com.apple.driver.AppleEFIRuntime    1.3.0
com.apple.iokit.IOHIDFamily 1.6.1
com.apple.iokit.IOSMBusFamily   1.1
com.apple.security.TMSafetyNet  6
com.apple.kext.AppleMatch   1.0.0d1
com.apple.driver.DiskImages 281
com.apple.iokit.IOStorageFamily 1.6
com.apple.driver.AppleACPIPlatform  1.3
com.apple.iokit.IOPCIFamily 2.6
com.apple.iokit.IOACPIFamily    1.3.0

Original issue reported on code.google.com by spull...@gmail.com on 9 Jan 2010 at 7:12

GoogleCodeExporter commented 8 years ago
What version of rsync were you using?

I seem to recall some versions (older than 3.0 maybe?) of rsync try to read the 
whole filesystem tree which 
causes the problem you saw, so if possible try building the current (stable) 
version of rsync and see if that 
eliminates the issue.

I hate the workaround, as this there never should never be a case where a 
userland program can cause a 
problem like this, but for now, I think it's all we've got.

Original comment by jason.richard.mcneil on 15 Jan 2010 at 5:34

GoogleCodeExporter commented 8 years ago
It doesn't occur every time, has only happened once out of like 100 backups.

macpro:~ sam$ rsync --version
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, file-flags

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.
macpro:~ sam$ 

Original comment by spull...@gmail.com on 15 Jan 2010 at 5:46

GoogleCodeExporter commented 8 years ago
Could you run zoink in another terminal window while doing these rsyncs and 
possibly take a photo of the 
zoink output if/when it kernel panics? I'm wondering if for some reason it's 
keeping around too many large 
zio_bufs, as that's the only thing I see right away that is the same size 
(131072 bytes).

If a panic isn't easy, or very undesired to cause, a dump of the a single zoink 
status window after your pool 
has been up for a while might also give me some ideas.

Sorry if it sounds like I'm guessing, but since I don't have anywhere else to 
start, that's the best I can do for 
now…

Original comment by jason.richard.mcneil on 16 Jan 2010 at 7:08

GoogleCodeExporter commented 8 years ago
I'll try and remember to do that each time I do a backup.  I can show you 
before, during 
and after but it didn't crash this time.

Original comment by spull...@gmail.com on 16 Jan 2010 at 8:40

Attachments:

GoogleCodeExporter commented 8 years ago
I know that RSync uses mmap for its calls; maybe that's implicated in the bug. 
In any case, it's certainly true 
that the code does have a panic() if the memory can't be allocated; there's a 
note in there to call 'kmem_reap' 
but that doesn't seem to be called. Ideally we shouldn't panic the system if we 
can't allocate memory, but will 
need to find out the call paths that can get to that point (and whether we can 
figure out a way of returning a 
non-panic error code instead).

Original comment by alex.ble...@gmail.com on 10 Mar 2010 at 8:02

GoogleCodeExporter commented 8 years ago
Maybe using 64-bit kernel (from your logs I see that you use 32-bit MacOS 
kernel) would help.

Original comment by numise...@gmail.com on 8 Sep 2010 at 3:04

GoogleCodeExporter commented 8 years ago
I was having the same problem, but then I forced my 10.6 server to use the 
64bit kernel instead of the 32bit kernel and the problem went away.

Thanks for the suggestion
-- Shaheen Ghiassy

Original comment by s.ghia...@gmail.com on 16 Sep 2012 at 9:49