@srs5694 Rod rEFInd version 0.12.0 broke with the Apple firmware version 429.0.0.0.0. rEFInd 0.12.0 does not boot on that firmware revision.
Tested version 0.11.5 and it is booting without a problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well done. As it is a fairly large commit, you need to move on to Stage 2 ... finding the breaking item(s).
Looking at the commit, the breaking item is likely to be one of the 'egFreeImage' or 'MyFreePool' calls ... with the later much more likely than the former.
Unless you can tell from just looking at the code, you will need to comment out all the 'MyFreePool' instances and test. If it works, you are on the right track and just have to slug through by removing the commenting and testing one by one until you stumble on the offending line.
When you find a 'bad' item, comment it out again, uncomment the others and test in case there is more than one problem line. If it fails, comment them out again and continue the process.
When you find a 'bad' item, rinse and repeat until you are done.
The 'bad' item(s) can then be examined. Most likely need to be deleted but could be they need to move up or down nesting order or something else done as would have gone in to plug a leak in the first place and this would still be there if deleted.
If commenting all the committed 'MyFreePool' instances out does not work, do the same for 'egFreeImage' and run the same process.
If fails with 'egFreeImage' commented out, then only a few items to examine which can be done manually. Could also mean this was not the breaking commit.
Last edit: dakanji 2021-01-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wonder if there's a good memory leaks library for EFI? Or you could make one. Need to override the boot services Memory Services functions. Would also require a stack trace ability if you want to find out what code is responsible for a leak (or if you want to get crazy - what code is responsible for the first free of a double free).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
memwatch is an ANSI C fault tolerant memory leak and corruption detection tool. Basically, you add a header file to your souce code files, and compile with MEMWATCH defined or not https://sourceforge.net/projects/memwatch/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wonder if there's a good memory leaks library for EFI? Or you could make one.
memwatch is an ANSI C fault tolerant memory leak and corruption detection tool. Basically, you add a header file to your souce code files, and compile with MEMWATCH defined or not. Check the README and USING files for more instructions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@joevt I wish actually someone really moderated this forum. If I post something with links I get this:
Post awaiting moderation.
I have seen this message in posts dating back in 2014. This forum is really awful. I am not even sure why people still keep their projects in SVN instead of moving them to GIT.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Fixes a dangling pointer (which can be expected to result in Segfaults).
Already applied to RefindPlus.
If it doesn't fix this one (don't have the affected Mac to test) certainly would be fixing other issues. Pretty sure it is responsible for this though as only example of improper memory management in the specified commit.
Patch file for rEFInd attached to the Merge Request.
EDIT: Deleted the MR as appears Invalid
Last edit: dakanji 2021-01-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@srs5694 Rod rEFInd version 0.12.0 broke with the Apple firmware version 429.0.0.0.0. rEFInd 0.12.0 does not boot on that firmware revision.
Tested version 0.11.5 and it is booting without a problem.
According to https://eclecticlight.co/2020/11/16/which-firmware-should-your-mac-be-using-version-5/ 429.0.0.0.0 is a Big Sur or Catalina firmware update used by many Macs that don't have a T2 chip. Which one do you have?
A found a similar report at https://egpu.io/forums/bootcamp/problems-with-the-new-boot-rom-version-429-0-0-0-0-macbook-pro-a1398/
I have a MacBookPro11,2. This is a late 2014 Haswell model. I also found where the code is broken.
https://github.com/startergo/refind-code/commit/df5e38aac2a0478d147597934ee80ca279b775c4
All commits prior to that one work.
Well done. As it is a fairly large commit, you need to move on to Stage 2 ... finding the breaking item(s).
Looking at the commit, the breaking item is likely to be one of the 'egFreeImage' or 'MyFreePool' calls ... with the later much more likely than the former.
Unless you can tell from just looking at the code, you will need to comment out all the 'MyFreePool' instances and test. If it works, you are on the right track and just have to slug through by removing the commenting and testing one by one until you stumble on the offending line.
When you find a 'bad' item, comment it out again, uncomment the others and test in case there is more than one problem line. If it fails, comment them out again and continue the process.
When you find a 'bad' item, rinse and repeat until you are done.
The 'bad' item(s) can then be examined. Most likely need to be deleted but could be they need to move up or down nesting order or something else done as would have gone in to plug a leak in the first place and this would still be there if deleted.
If commenting all the committed 'MyFreePool' instances out does not work, do the same for 'egFreeImage' and run the same process.
If fails with 'egFreeImage' commented out, then only a few items to examine which can be done manually. Could also mean this was not the breaking commit.
Last edit: dakanji 2021-01-21
I wonder if there's a good memory leaks library for EFI? Or you could make one. Need to override the boot services Memory Services functions. Would also require a stack trace ability if you want to find out what code is responsible for a leak (or if you want to get crazy - what code is responsible for the first free of a double free).
This should help:
https://docs.microsoft.com/en-us/visualstudio/debugger/finding-memory-leaks-using-the-crt-library?view=vs-2019#:~:text=Find%20memory%20leaks%20with%20the%20CRT%20library%201,Compare%20memory%20states.%20...%205%20False%20positives.
https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/5_uefi_services/51_services_that_uefi_drivers_commonly_use/511_memory_allocation_services
https://medium.com/swlh/finding-memory-leaks-in-c-de1aa8c5f0fb
https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html
https://www.codeguru.com/cpp/misc/misc/memory/article.php/c3745/Detecting-Memory-Leaks-in-C.htm
This includes a header to import in the project:
@joevt I wish actually someone really moderated this forum. If I post something with links I get this:
I have seen this message in posts dating back in 2014. This forum is really awful. I am not even sure why people still keep their projects in SVN instead of moving them to GIT.
This Merge Request should fix the issue: DELETED
Fixes a dangling pointer (which can be expected to result in Segfaults).
Already applied to RefindPlus.
If it doesn't fix this one (don't have the affected Mac to test) certainly would be fixing other issues. Pretty sure it is responsible for this though as only example of improper memory management in the specified commit.
Patch file for rEFInd attached to the Merge Request.
EDIT: Deleted the MR as appears Invalid
Last edit: dakanji 2021-01-29
unfortunately still does not work
Are you sure you used the updated version after changes were forced pushed?
Although names are the same, some changes were made.
EDIT: Deleted the MR as appears Invalid
Last edit: dakanji 2021-01-29
Latest firmware update 430.0.0.0.0 corrected the issue. rEFInd boots again on MacBookPro11,2 and 11,3.