7-Zip exposes a bug in Windows's large memory pages. Causes data corruption and crashes in Windows and other programs.

6 years ago
ian $I9xuH7PGU4 3

https://sourceforge.net/p/sevenzip/discussion/45797/thread/e730c709/

This message contains information about very critical problem in some versions of Windows.

If you have any contacts with Microsoft, please notify them about this problem. Also ask Microsoft to provide information what versions affetced by that BUG, and

Now we have the following information about different Windows 10 versions:

1511 - maybe OK
1607 - maybe OK
1703 - ERROR
1709 - ERROR - including latest version 16299.371 - April 2018 Cumulative
1803 - maybe OK - but we need more tests
1809 - maybe OK
These results are not final. And we need more tests in different versions of Windows, including version 1803 (17133/17134) - Windows 10 Spring Creators Update - Redstone 4.

Description of problem

Windows supports small (4 KB) pages and large (2 MB) memory pages.

Most of programs use only 4 KB pages. And it works correctly. So there is no any problem for most programs.

But there is Windows API that allows to use 2 MB pages. And 7-Zip uses that API, if special "Large pages mode" option is enabled in 7-Zip settings.

When 7-Zip uses 2 MB pages, 7-Zip can work incorrectly, or Windows system can crash.

$How to reproduce the problem

NOTE:

If you use "Large Pages" now, your system can work incorrectly and you can lose some data.

DON'T TRY IT, if you don't want to take these RISKS.

If you use "Large Pages", your system can be in CORRUPTED STATE, and you MUST REBOOT after each experiment to reduce the risk to lose your data.

  • "Large Pages" feature requires special "LockMemory" privilege.

So you need to run 7-Zip File Manager with administrator rights at least once and reboot system after that. Then you can use "large pages" without administrator rights in Windows 10.

But some previous versions of Windows require administrator rights also for programs that just use "large pages".

  • The commands with "Large Pages" for crash:

7-Zip 18.01 (x86 or x64):
7zG b -mmt1 -slp -md21
7z b -mmt1 -slp -md19 -bt 10 >19.txt 2>19_2.txt
7z b -mmt1 -slp -md22 -bt 10 >22.txt 2>22_2.txt
If you use Windows 7, you must call these commands with administator rights. So create bat files and run them with administator rights.

If 7-Zip benchmark works incorrectly with large pages, you can get

  • "Decoder error" message

  • 7-Zip program crash

  • Windows system crash

When you run these benchmark commands, you can see "LP" string in "Memory usage" values.

It means that 7-Zip uses "Large Pages".

If you don't see "LP", then probably you have no rights to use "Large Pages".

For 7-Zip users:

If you are ready to test it, please call those benchmark commands and write report here in this forum thread:

  • Exact windows version. You can call "Run" (Windows+R): "winver" to get version number.

  • Exact name of CPU

  • If there are no errors for commands, then show 22.txt

  • If there is any error/crash, write about that error

  • REBOOT YOUR SYSTEM after commands to flush possible system corruptions.

We need to get answers for the following questions:

  • what Windows versions (and revisions) are affected with that problem?

  • what Windows versions allow to use "Large Pages" without administrator rights?

  • what another programs also use "Large Pages"? And are there any reports about problems with these programs?