Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x64-build crash with NoRecentDocsHistory enabled in registry #243

Closed
eugene-s-nesdev opened this issue Nov 28, 2023 · 8 comments · Fixed by #214
Closed

x64-build crash with NoRecentDocsHistory enabled in registry #243

eugene-s-nesdev opened this issue Nov 28, 2023 · 8 comments · Fixed by #214

Comments

@eugene-s-nesdev
Copy link

Step-by-step:

  • download lastest 0.5.0.1 x64 release
  • start famitracker and select "file->recent files"
  • program will be crash immediately:
    crash

Minidump:
MiniDump_20231128-1705-v0_5_0_1.dmp

Same bug happens on j0cc-famitracker 0.6.3 x64 bit

@Gumball2415
Copy link
Collaborator

Gumball2415 commented Nov 28, 2023

this is what's executed when you select File->Recent files

void CFamiTrackerApp::OnUpdateRecentFiles(CCmdUI *pCmdUI)		// // //
{
	// https://www.codeguru.com/cpp/controls/menu/miscellaneous/article.php/c167
	// updating a submenu?
	if (pCmdUI->m_pSubMenu != NULL) return;

	m_pRecentFileList->UpdateMenu(pCmdUI);		// access violation here!!
}

edit: i think i've located exactly where the error might've occured

@Gumball2415
Copy link
Collaborator

can you try to replicate this bug in Debug builds?

@eugene-s-nesdev
Copy link
Author

eugene-s-nesdev commented Nov 28, 2023

Yes, i've replicated it on two laptops and one desktop machines. Debug build crashed without any warning messages. Only x64 affected.

@eugene-s-nesdev
Copy link
Author

Fixed with your commit!


Another bug on windows 7 not related to the previous one (0.5.0.1 x86 official, and lastest x64 build):

  1. start famitracker
  2. load song, then another song, then third song, etc
  3. "recent" list still empty
  4. clear list manually
  5. repeat step 2
  6. recent list working until next famitracker reboot.

catch.mp4

@Gumball2415
Copy link
Collaborator

Gumball2415 commented Nov 28, 2023

please list this as a separate issue so the changelog won't get cluttered
nvm, this is also part of the bug apparently

@nyanpasu64
Copy link
Collaborator

nyanpasu64 commented Nov 29, 2023

works on my machine
Dn-FamiTracker_7ncT9ioYB6

m_pRecentFileList is defined by MFC rather than FT, and is normally initialized by MFC itself. We only touch it in CFamiTrackerApp::OnRecentFilesClear(), which explains why clearing recents makes it work again. I have not finished reading the MFC code (eg. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\atlmfc\src\mfc\appcore.cpp) to see why the variable is not initialized.

My initial guess is the recent apps list is not saved properly into the registry? Can you check that registry key HKEY_CURRENT_USER\Software\Dn-FamiTracker\Recent File List is present, and you can use Regedit to edit the File# strings inside? If that works the problem may be permissions, or something else.


EDIT: I think you've set registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsHistory. I don't know how you did that. We will have to find a workaround for that (either changing the code to stop assuming the recent file list exists, or initializing it manually but just not saving the files to disk).

I can reproduce this crash by creating that value as a REG_DWORD and setting to 1.

@nyanpasu64 nyanpasu64 changed the title x64-build crash on Windows7 x64-build crash with NoRecentDocsHistory enabled in registry Nov 29, 2023
@eugene-s-nesdev
Copy link
Author

eugene-s-nesdev commented Nov 29, 2023

You're absolutely right.

I set "0" to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsHistory
Recent-list is working now.
x64-version crash is gone also.

I have no idea why it was set to "1", maybe third-party software triggered it.

@Gumball2415
Copy link
Collaborator

recent list working until next famitracker reboot.

when HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoRecentDocsHistory is enabled, Recent Files will no longer work for all applications. To fix this, you should disable it (REG_DWORD 0x00000000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants