Symptom: all of sudden, my Flash Builder 4 and Coldfusion Builder can not be started. They will crash during start. They are running on Eclipse 3.4.2, and 3.5.2 respectively.
Diagnostic: Coldfusion builder simply show me an error dialog without any useful information. It just generically states something like: Visual C++ request application to exit in abnormal way.
Of course, I tried to reset Eclipse and clear it's workspace to no avail.
However, luckily, Flash Builder 4 throws an exception. And I got a chance to start Visual Studio 2010 debugger session on it. Once in Visual Studio debugger, I saw exception type "bad_day_of_month" from boost library. Then I turn to "Stack Trace" tab, and saw callstack: Kernel32->atmlib.dll->UpdateNotifications.dll. A little Google on this end turned up a thread talking about similar problem from other Adobe users. So, I read the thread, it starts to mention how the "UpdateNotification" library will look at Windows Scheduled Tasks for Adobe updater. Then it occurs to me what might be, and later proven to actually be the root cause.
Cause: A few days earlier, in an effort to speed up my computer, I ran "AutoRuns" utility from "System Internals", and disabled a bunch of "Scheduled Tasks". Among them was a task named "AdobeAAMUpdater-1.0......".
Fix: using "AutoRuns" utilities, I turned the "AdobeAAMUpdater-1.0....." scheduled task back on. Then Flash Builder 4 and Coldfusion Builder are all back to normal.
Tips that make life of a software engineer easier. Well, not exactly. Some posts are open questions that I haven't found an answer ... yet
Showing posts with label gotcha. Show all posts
Showing posts with label gotcha. Show all posts
Saturday, September 03, 2011
Thursday, July 15, 2010
Coldfusion web services call return error: java.lang.NullPointerException
Turns out Coldfusion web services return data may contain pointer, and the receiving side will try to interpret that pointer. Once we commented out the offending data (a 2D array) in return, the error is gone.
Wednesday, June 23, 2010
SQL 2005 on Windows XP SP3 - MSXML6 Error
Problem:
With a fresh Windows XP SP3, I cannot install SQL 2005. The error message in log file is:
Luckily, I am not the first one who saw this problem. This problem seems to be around for a while now. There is a nice Microsoft KB article for this exact problem, and the solution is to use "Windows Installer CleanUp utility" to remove existing MSXML then install SQL 2005.
And, IT WORKS!!
Reference: MSKB 968749 http://support.microsoft.com/kb/968749
With a fresh Windows XP SP3, I cannot install SQL 2005. The error message in log file is:
Property(S): SupportedOSMessage = Installation of this product failed because it is not supported on this operating system. For information on supported configurations, see the product documentation....
Property(S): ShortCutText = MSXML 6 Service Pack 2 (KB973686)
Property(S): DialogTitle = MSXML 6 Service Pack 2 (KB973686) Setup
Property(S): ProductName = MSXML 6 Service Pack 2 (KB973686)
Property(S): ShortName = MSXML 6 Service Pack 2 (KB973686)
Property(S): WrongPackage = This MSXML6 Service Pack 2 (KB973686) package is not supported on the current processor type.
Property(S): DialogPatchTitle = MSXML 6 Service Pack 2 (KB973686) Patch
Property(S): SystemFolder = C:\WINDOWS\system32\
MSI (s) (04:A8) [09:38:47:725]: Product: MSXML 6 Service Pack 2 (KB973686) -- Configuration failed.Solution:
MSI (s) (04:A8) [09:38:47:725]: Windows Installer reconfigured the product. Product Name: MSXML 6 Service Pack 2 (KB973686). Product Version: 6.20.2003.0. Product Language: 1033. Reconfiguration success or error status: 1603.
Luckily, I am not the first one who saw this problem. This problem seems to be around for a while now. There is a nice Microsoft KB article for this exact problem, and the solution is to use "Windows Installer CleanUp utility" to remove existing MSXML then install SQL 2005.
And, IT WORKS!!
Reference: MSKB 968749 http://support.microsoft.com/kb/968749
Thursday, April 22, 2010
Windows XP "System Restore" and Subversion
Subversion users be aware: Windows XP "System Restore" will rollback your SVN working folder!
Just learned it the hardway. I did a system restore on my Windows XP box, and all of sudden all the projects are broken. It turned out that all my SVN working folders are rolled back too.
Solutions?
Just learned it the hardway. I did a system restore on my Windows XP box, and all of sudden all the projects are broken. It turned out that all my SVN working folders are rolled back too.
Solutions?
- Checkout "Head" from SVN repo again. Lucky for me, I do check-in frequently, and this solution works for me just fine;
- Start "System Restore", and this time select "Undo my last restoration";
Thursday, July 24, 2008
C++/CLI Gotchas
C++/CLI is a hybrid monster. I am very green in the world of C++/CLI. Below are a few very stupid problems I have met.
Example 1: If you are writing unsafe code in C++/CLI with mixed managed code and unmanaged code, it proved to be more dangerous than plain old C++. Here are a few examples of using System::String together with char (C native data type). Without thorough understanding of the new .NET String class will create code that compiles perfectly but return unexpected results to you in run time.
Example 2: Visual Studio 2005 Debugger is a liar
I agree that the code above is stupid which is an artifact from trying to correct old VC++ code. But Debugger giving a wrong answer wouldn't help!
Example 1: If you are writing unsafe code in C++/CLI with mixed managed code and unmanaged code, it proved to be more dangerous than plain old C++. Here are a few examples of using System::String together with char (C native data type). Without thorough understanding of the new .NET String class will create code that compiles perfectly but return unexpected results to you in run time.
String^ str = "";
char ch = 'a';
str += ch; //result: str="97", instead of "a", because it called ch.ToString()
str = gcnew String(&ch); //result: str="a@#!$%", because &ch is considered to be a string
str = gcnew String(&ch, 0, 1); //result: str="a" as expected.
Example 2: Visual Studio 2005 Debugger is a liar
int i;
i=1000;
... //all the code in between so that you forgot what is defined
for(int i=0; i < 3; i++)
{
...
}
int k = i++; //if you set a break here, Visual Studio Debugger will tell you i=4??!
I agree that the code above is stupid which is an artifact from trying to correct old VC++ code. But Debugger giving a wrong answer wouldn't help!
Friday, August 31, 2007
YUI widget "Dialog" now depends on "Button Control"
Environment: YUI 2.3, IE 7.0
This is another problem I discovered during update from YUI 0.12 to YUI 2.3. As always, when updating library, there are many surprises that you have to run into.
Problem: Error message: "Error: Function expected" appears when I call the "render" method of YUI "Dialog" control a second time on the web page. Turn out the offending line is here: container.js, line: 6373,
Why: The new "Dialog" implementation depends on the "Button" control now. Due to the above offending line, the dependency is not "optional" as stated in the documentation even if you don't use the new button control. If you don't include "button.js", you program will break at the above point.
Fix: If you are willing to change the source code, we can change the offending line to something like this:
So, the best bet is to include "Button.js" to my web page.
This is another problem I discovered during update from YUI 0.12 to YUI 2.3. As always, when updating library, there are many surprises that you have to run into.
Problem: Error message: "Error: Function expected" appears when I call the "render" method of YUI "Dialog" control a second time on the web page. Turn out the offending line is here: container.js, line: 6373,
if (oButton instanceof YAHOO.widget.Button) {
Why: The new "Dialog" implementation depends on the "Button" control now. Due to the above offending line, the dependency is not "optional" as stated in the documentation even if you don't use the new button control. If you don't include "button.js", you program will break at the above point.
Fix: If you are willing to change the source code, we can change the offending line to something like this:
if (YAHOO.widget.Button && oButton instanceof YAHOO.widget.Button) {BUT, I am 80% sure, at another line, or in another control, I may run into the same problem again.
So, the best bet is to include "Button.js" to my web page.
Thursday, July 19, 2007
Javascript "Empty Statement"
Spot anything wrong in the Javascript below?
Values in array
The semicolon at the end of the
var a=[];
//initialize array
for(int i = 0; i < 10; i++);
{
a[i] = 100;
}
Values in array
a will be:[undefined, undefined, 100]
The semicolon at the end of the
for loop forms an "Empty Statement". So a[i]=100; is actually outside of the for loop!
Wednesday, July 18, 2007
Reload Magellan MobileMapper CE OS Firmware
Where to download MobileMapper CE OS Firmware Image
Some Magellan official documentations have this out-dated information about location of MobileMapper CE OS firmware download location:
"The current version of MobileMapper CE Operating System (OS) firmware can be downloaded from ftp.magellangps.com in the /Mobile Mapping/MM CE/Firmware/OS Firmware/ folder."This turned out to be out-dated information. The above directory does not exist on the FTP server. After some digging, I found the OS firmware in this zip file: ftp://ftp.magellangps.com/Mobile%20Mapping/MM%20CE/Firmware/MMCE_Receiver_FW.zip
Notice: the above FTP location is accurate as 7/18/2007, may be changed by Magellan.
What Happened
I saw low battery warning on the device. Naturally, I select "Full Shut Down" to allow the system do a proper backup. This turned out to be a mistake. Apparently, battery was out before the device can fully shut-down, and the OS firmware image is corrupted. After this, upon each reboot, I am asked to calibrate stylus, then there are 2 dialogs:
Dialog 1: dialog title: "Warning", Text: "This is a Rescue Image! The
Main Image failed to start. Press "Cancel" to Retry Main Image. Press
"OK" to continue with Rescue Image."
After I press "OK" which is the only button on the dialog, I am lead to
the second dialog:
Dialog 2: dialog title "OS Loader", Text: "Please choose a new image
file. The image file cannot be in the MyDevice directory."
After I press "OK", an "Open File" dialog appears with option to load a
file type: Image Files (*.nbx).
Following the instruction in "Getting Started Guide", page 61 "Updating MobileMapper CE OS Firmware", I was able to load the OS image I downloaded from Magellan. The system seems to be back to proper working order afterwards.
Lesson Learned
When you have low battery warning, rather than to risk corrupt the OS firmware image, it is probably better to wait for the battery to die out or, if possible, recharge the battery immediately.
Thursday, July 12, 2007
Delay Load DLL and __HrLoadAllImportsForDll
Here are a few tips for delay loaded DLLs based on my experience with Visual Studio 2003 (Visual C++ 7.1)
- Delay load can be easily setup using the Visual Studio IDE by the following steps:
- Open project property page:
Linker > Input - In
Additional Dependencies, add library:delayimp.lib; - In
Delay Loaded DLLs, add all the DLLs you want to delay load.
TIP #1: if you have more than one DLLs, the file names must be separated by ";", e.g.:rapi.dll;ceutil.dll. If you forget this, and try something like:rapi.dll ceutil.dll, then the linker will treat the whole string as the file name of a single file and fail to find a file with that name. There will be a subtle warning during build:LINK : warning LNK4199: /DELAYLOAD:rapi.dll ceutil.dll ignored; no imports found from rapi.dll ceutil.dll, which most likely will be ignored. - Detect if the delay loaded DLLs exists on the host computer:
The whole purpose of delay loaded DLLs is to allow our program to be more flexible. It can be loaded on computers that do not have certain DLLs, and it can choose to use those DLLs when they are present. So, there is always a need to know if we can load the delay loaded DLLs on the host computer.__HrLoadAllImportsForDllis the recommended function by MSDN documentation to do the job.
TIP #2:Do not use__HrLoadAllImportsForDllbecause it usememcmpto compare DLL file names byte by byte which is too strict. File names in Windows system is not case sensitive, so the file names can be the same even ifmemcmpfails. This function will returnmodule not founderror code even when the DLL files are installed on host computer. I end up lift the implementation fromdelayhlp.cpp, and replacememcmpwith_tcsicollwhich is case insensitive.
Tuesday, July 03, 2007
CeCopyFile (RAPI) Requires Both Files on Remote Device
There is no mention of this restriction in MSDN documentation, but be aware that
Definition of CeCopyFile:
CeCopyFile requires both lpExistingFileName and lpNewFileName refer to files on remote device. If you want to copy files from PC to remote device or from remote device to PC, you can refer to samples: Pget, and Pput provided in Windows Mobile SDK (in Mobile 5.0 SDK, the samples are under: Samples\CPP\Win32\Rapi).Definition of CeCopyFile:
BOOL CeCopyFile(
LPCWSTR lpExistingFileName,
LPCWSTR lpNewFileName,
BOOL bFailIfExists
);
Friday, March 24, 2006
srand() and threads in MFC
This is an old problem I only run into recently: You should call
In its multi-thread version, the CRT implemenation in VC++6.0 will save seed to thread local storage. So, it is necessary to seed the
srand() for each and every thread that calls rand().In its multi-thread version, the CRT implemenation in VC++6.0 will save seed to thread local storage. So, it is necessary to seed the
rand() function in every new thread your program created. Otherwise, the random number sequence is same as if seeded by 1. This poses 2 serious questions:- How can I write a class that is thread safe, and caller won't have to worry about calling srand() whenever they create a new thread? I do not have a solution yet. The best I can think of is to ask callers, when not sure, always call
srand()whenever a new thread is created; - A second question is what if user creates multiple threads in a batch, this will make the recommended intialization code:
srand( (unsigned) time(NULL));fail, because the threads are created within 1 second, and you will get the same sequence in all your threads. After some searching, I found this discussion thread to be quite helpful: It proposed to multiply time by the thread ID to seedrand().
Subscribe to:
Posts (Atom)