So about that cleaner patch I mentioned...
Here's the relevant lines in the good old panic log:
Code:
panic(cpu 0 caller 0xffffff80033b3263): "kfree: size 18446743521917493256 > kalloc_largest_allocated 10534912"@/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-4903.200.274.31.2/osfmk/kern/kalloc.c:752
-- snip --
0xffffff8cd4a1bcb0 : 0xffffff80033b3263 mach_kernel : _kfree + 0x103
0xffffff8cd4a1bd00 : 0xffffff8003a101d6 mach_kernel : _IOFree + 0x16
0xffffff8cd4a1bd20 : 0xffffff7f869e0fa5 com.apple.GeForceTesla : __ZN26nvVirtualAddressSpaceTesla4freeEv + 0xbd
In my understanding, the function
nvVirtualAddressSpaceTesla::free() is calling
IOFree() which is calling
kfree(). And it's telling it to free 18446743521917493256 bytes (?) which is wayyyyy too much so it calls
panic().
My previous patch deleted (NOP'ed) the entirety of a function a few lines
below all this in the stack trace, a function
clientClose() which called a function, which called a function, which called the
nvVirtualAddressSpaceTesla::free() function above. Excessive.
My
new patch just NOP's a
single call statement at
nvVirtualAddressSpaceTesla::free() + 183. Seems like that's the call to
IOFree() that causes the panic, since it hasn't panicked yet!
Not sure if this'll fix some of the instability I saw earlier on my MacBook7,1. We'll have to wait and see. For anybody who's curious, replacement
GeForceTesla.kext is attached!
You are amazing, I have just checked you left all the
IONVGLContextTesla::clientClose() function
and his related assembler code memory addresses untouched inside the
GeforceTesla binary unix exec.
Infact looking back at my KP log with symlinks the CPU KP occurred exactly from this function calling
__ZN26nvVirtualAddressSpaceTesla4freeEv + 0xbd
And then followed by a waterfall errors of:
com.apple.GeForceTesla : __ZN18IONVGLContextTesla4stopEP9IOService + 0x1f6
As almost always the errors are upstream not downstream!!!
Thank you!!! Will give a try, I am confident you fixed it!
Well, for my test I am using a
Mojave beta 2 booting on a MB7,1 from an external USB 2.0 SSD with replaced
IOAccelerator from Mojave beta 1 (that I posted on thread page 88).
I'm stressing it right now, with all possible OpenGL native apps opened like: Maps (satellite 3d view), Chess, New App Store, Dashboard's Weather (has bad looking), FaceTime, and many many safari tabs opened with youtube HD music video playlist playback (I'm cheating a bit since I use Adblock), I have Console opened and almost every main MacOS's Dock processes in background opened with high louder speed fans. CPU/GPU temperatures constantly 90/80 °C but who cares this is for a noble cause.
And even with all these background processes on 8 GB RAM available memory used 5,26 GB.
I don't post live proof pictures I am shy, but you can trust what I writing.
edit:
In Console I see very often
spindump (ktrace) DBG_DYLD decode error (0: Undefined error: 0) or
DBG_DYLD decode error (3: No such process)
but it does not seem to give much trouble.
edit2:
And first 3/4 hour is gone, lets see...
More than 1h 30m gone, everything went fine until now.
Ok I'm going out, leaving a long yt video playlist running with mute and caffeine turned on. Will let know.
edit3:
Took a glance at Console app, there is no shadow of these messages:
Unable to create basic Accelerated OpenGL renderer.
Core Image is now using the software OpenGL renderer. This will be slow.
Passed 3h 15m now I begun closing Chess, FaceTime, Maps... need to lower CPU/GPU temperatures.
Ok, after 4 hours, I feel to say my stress test has succeeded, and this is the best less invasive GeforceTesla patch we can expect.
Congratulations ASentientBot, you did it!