Difference between revisions of "Money Sunset Import Bug Remediation"

From PalOMoney
Jump to navigation Jump to search
m
m
Line 59: Line 59:
 
== Ofx Crash Bug Remediation ==
 
== Ofx Crash Bug Remediation ==
  
The Money Sunset software can be patched to eliminate the first test that skips the hash table initialization by replacing the test and jump with NOPs (we regret not having a more elegant solution). The exact dll location has to be calculated, and will be published here when known.  
+
The Money Sunset software can be patched to eliminate the first test that skips the hash table initialization by replacing the test and jump with NOPs (we regret not having a more elegant solution). The exact dll location has to be calculated, and will be published along with a simple .exe file to apply the patches [[Money Sunset Patch Utility]] here when known.
 +
 
 +
The PalOMoney application cannot perform this function, because patching a program file requires elevated administrator privileges, and it is undesirable to run PalOMoney or any ordinary application with elevated privileges.  
  
 
PalOMoney is working on a patch utility, which will be made available on this site to anyone without charge. The utility will require administrator elevation to run. Whether the Money Sunset software is under Windows file protection is unknown, but Chen's article leads one to conclude that the software can be patched, and not automatically revert to an earlier version.
 
PalOMoney is working on a patch utility, which will be made available on this site to anyone without charge. The utility will require administrator elevation to run. Whether the Money Sunset software is under Windows file protection is unknown, but Chen's article leads one to conclude that the software can be patched, and not automatically revert to an earlier version.

Revision as of 22:43, 9 April 2013

Introduction

PalOMoney version 1.0.5 release candidate build 893 was being tested with Money Sunset on a 64 bit Windows 7 machine. While testing the Statement view Update Now function, it downloaded about a dozen statements, each time calling the (annoying) Money Shell Handler to queue them for processing in Money. After 12 Ok clicks, the downloaded and log files were examined and found to be Ok. However, when Money Sunset was launched, it crashed after a few seconds.

PalOMoney was used to repair the Money file outside of Money. Money was launched again, and suffered another crash. There was no way to prevent a crash. However, the Money file worked fine on another machine. After renaming the Money file, and opening an older file, the crash still occurred. The Money Sunset environment itself had become unstable.

This was not an auspicious beginning for PalOMoney version 1.0.5 release candidate build 893, and delayed the release of 1.0.5 pending a resolution of this issue. Ordinary users cannot tolerate this kind of performance.

This topic also has a blog entry version.

Research

It wasn't really a problem with PalOMoney. There is a known problem importing ofx files into Money. Referring to Microsoft's Raymond Chen's Microsoft Money crashes during import of account ... - MSDN Blogs and windows-8-64-bit-version-compatibility-with-sunset-money/. The 4 byte patch in the articles was applied, but Money still crashed. More research turns up MS Money Sunset+Windows 8, Crash when adding new Payee which has a similar problem.

In order for Microsoft Money Sunset to be viable for ongoing use, it will require patches to fix bugs possibly introduced when downgrading Money 2008 to produce Sunset. This task has been (reluctantly) added to the PalOMoney project, but it adds the task of reverse engineering to the project.

Reverse Engineering to Correct Bugs

In the words of commenter to Chen's blog entry above, "Reverse-engineering is a violation of the Microsoft Money EULA...," and PalOMoney.com does not want to run afoul of that issue. Another commenter wrote that "There are certain court rulings about warranty of merchantability that override the EULA in situations like this one." Although this comment is not a duly prepared legal memorandum that can be relied upon safely, PalOMoney.com has done the necessary examination and identified a bug and has developed workarounds and remediation.

Any readers with insight into this issue are encouraged to add it to the wiki topic or discussion, blog comments, or discuss it in the forums.

OFX Crash Bug Cause

The fault occurs when doing a string compare on uninitialized memory.

Apparently, the bug is caused several functions up the call stack by failing to initialize in all circumstances what seems to be an in-memory hash table. The initialization occurs in two phases. First the table is initialized with zeros to indicate no entries. Then an entry is made into the table. Each phase tests a pointer in a large object supplied by the calling function, and either skips or performs the initialization. When the system crashes, the first test skips the initialization. A call to the hash table find function then calls string compare on an entry in the uninitialized hash table, which causes the fault.

The crash occurs with OFX downloads from certain accounts at certain financial institutions. However, not all downloads of those accounts cause a crash. The cause of this is being investigated and will be reported here as answers are discovered.

Money Sunset crashes when processing the "Import Files" queue. This queue is not part of the Money file, so it will cause a crash when opening any Money file on that machine.

The "Payee Change" crash mentioned in the above blogs has not been investigated. It may be caused by the same problem.

OFX Crash Bug Workarounds

One workaround is to not import transactions from problem accounts at problem institutions, or to import them using Money's File Import, and NOT by double clicking them and NOT using the Shell Open method to process downloads via PalOMoney, both of which add the downloads to the Import Files queue. However, this does not help very much when a user's Money Sunset installation is unstable. So the first thing to do is to fix the installation, below.

The Money file is left with open objects by Money crashing. This is fixed either by opening it with Money (which repairs with a "Working..." progress bar, or by running the the PalOMoney File | Repair | Repair function.

The "Import Files" queue is saved in the registry under [HKEY_CURRENT_USER\Software\Microsoft\Money\17.0] "Import Files" key. The MULTI_SZ value contains the names of temporary files copied by the Money shell handler. The key is deleted (not there) when the queue is empty.

You can just delete the key, but PalOMoney adventuresome explorers are encouraged to rename the entry instead of deleting it.

  • Open RegEdit. You may not need administrative privilege to access HKCU. Try it. If you do, run RegEdit as administrator.
  • Locate the "Import Files" key, and press F2 to edit the key name.
  • Add a space and "00", "01", etc. to the key name (e.g., "Import Files 02").

This leaves the files in your TEMP folder (e.g., \users\UserName\AppDate\Local\Temp), which are names with a "~of" plus a random number then .tmp (e.g, ~of896.tmp). You can ignore them for now, and use them for testing the remediation, below.

PalOMoney is being enhanced to include these functions. Also, PalOMoney will offer a direct queue import method, which write to the registry key directly, bypassing the annoying Money Shell Handler with its "Launch Money Now?" nagging.

Finally, the investigation into why some downloads crash and others don't continues, and may result in PalOMoney being able to "filter" a download to add required or remove problematic OFX entries to prevent the crash in the first place. However, this would not fix the general problem of crashing when importing or changing payee names, etc. mentioned in the blog posts above.

Ofx Crash Bug Remediation

The Money Sunset software can be patched to eliminate the first test that skips the hash table initialization by replacing the test and jump with NOPs (we regret not having a more elegant solution). The exact dll location has to be calculated, and will be published along with a simple .exe file to apply the patches Money Sunset Patch Utility here when known.

The PalOMoney application cannot perform this function, because patching a program file requires elevated administrator privileges, and it is undesirable to run PalOMoney or any ordinary application with elevated privileges.

PalOMoney is working on a patch utility, which will be made available on this site to anyone without charge. The utility will require administrator elevation to run. Whether the Money Sunset software is under Windows file protection is unknown, but Chen's article leads one to conclude that the software can be patched, and not automatically revert to an earlier version.