Can't run app with remote desktop

B

Bob Altman

Hi all,

This is a long shot, but I figure it doesn't hurt to ask... I have some
applications that work fine when I run them on my PC at work, but "fail to
initialize (0x000005)" when I'm attached to that PC from home via Remote
Desktop.

These applications are all console apps written in native C++. The common
thread (at this point I've done no serious investigation) seems to be that
they all call into a C++/CLI library that, in turn, calls into other managed
assemblies. But that could have nothing to do with the problem.

Has anyone ever seen anything like this? Any suggestions on how to begin
debugging this?

TIA - Bob
 
J

Jeffrey Tan[MSFT]

Hi Bob,

Can you tell me your OS version? If it is Vista, do you enable UAC, do you
run your application elevated?

This sounds like an interesting issue. With current information, it is hard
for me to say the root cause, but I suspect it may has something to do with
the environment variables or user profile paths. When you login through
remote desktop, it may have different environment variables or profile
which may cause the application initialization failure. However, I am not
certain yet, we need to perform some troubleshooting to get close to the
root cause.

I assume you are getting a "The application failed to initialize
properly(0x0000005)" error dialog, yes? Based on my experience, the error
is usually caused by the initialization failure in DllMain of certain DLL
linked by your application directly or indirectly.

To troubleshoot this issue, we have several ideas. First, you may use the
Dependency Walker tool(depends.exe) to launch your application during
remote desktop logon. Try to find any dll that is reported as missing. This
may provide some useful information.

Second, you may use Process Explorer's "Find Window's Process" icon tool to
examine the owning process of the error dialog. We need to find out if the
error dialog is popped up by the failing application process or the
launching process(such as explorer.exe). I assume it is the failing process
first. Then, you may use the windbg to attach the failing process and
examine its stack trace. You may paste the stack trace here for analysis.

From kernel space perspective, the console&remote desktop are different
user sessions, so they will have different session view in kernel space.
The main difference are the GUI/GDI graphic functions. Is your application
very dependant on the GUI/GDI operations? Is it possible that the desktop
heap is exhausted? You may use "Desktop Heap Monitor tool" to check this.
See the article below for more details:
http://blogs.msdn.com/ntdebugging/archive/2007/01/04/desktop-heap-overview.a
spx

Finally, you may use Process Monitor to examine the file system&registry
activity of your application startup period. You may filter the "SUCCESS"
result and pay more attention to the "NOT FOUND" or other failure records.

I will wait for more information from you. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Bob Altman

Can you tell me your OS version? If it is Vista, do you enable UAC, do you
run your application elevated?

Hi Jeffrey! The work PC is XP Pro SP-3, joined to a domain, logged in as a
non-privileged domain user. The home PC is a virtual PC running XP Pro SP-3
with fast user switching enabled. (I need to use a virtual PC at home
because my home PC has Vista, and the corporate VPN doesn't work with Vista.
So I run a virtual PC with XP and it works like a champ.)
This sounds like an interesting issue. With current information, it is
hard
for me to say the root cause, but I suspect it may has something to do
with
the environment variables or user profile paths. When you login through
remote desktop, it may have different environment variables or profile
which may cause the application initialization failure. However, I am not
certain yet, we need to perform some troubleshooting to get close to the
root cause.

That makes me realize that I have a great tool at work for digging into this
problem. We have a tool called AppSight that, among other things, lets you
run an application and it logs all kinds of stuff, such as resource usage
and file and registry accesses. But it's real strength in this scenario is
that is can compare a successfull run with a failed run and very quickly
point out the differences between the two. I haven't used this tool in a
long time, so I need to set it up, but this could be just the sort of thing
that this tool excells in helping with. (Or not...)
I assume you are getting a "The application failed to initialize
properly (0x0000005)" error dialog, yes?
Yes

To troubleshoot this issue, we have several ideas...

Thanks. I'll start digging into your suggestions and I'll post the results
back to this NG. Who knows, maybe I've stumbled across a generic problem
that others may be interested in. If nothing else, someone may be
interested in following the detective novel as it unfolds.

Since this is a problem that only affects me when I work from home, it may
take me a while (a day or two) to get some time to try the things you've
suggested.

Bob
 
J

Jeffrey Tan[MSFT]

Hi Bob ,

Thanks for your feedback.

Oh, I have not heard about AppSight before; but based on your description,
it works very similar with Microsoft sysinternals Process Monitor tool,
which can also monitor the file system&registry activities:
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Anyway, you can choose either one that is convenient for you.

Sure, when you have time to check this issue again, please feel free to
post, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
B

Bob Altman

I finally got around to gathering some data and discovered that the problem
has mysteriously gone away. Oh well... if it comes back I'll try the things
you suggested to try to track it down.
Oh, I have not heard about AppSight before; but based on your description,
it works very similar with Microsoft sysinternals Process Monitor tool,
which can also monitor the file system&registry activities:

Actually, AppSight (www.identify.com) is much much more than Process
Monitor. It's a tool that monitors a running program and gathers all sorts
of information about it without the need to add instrumentation code of any
sort to it. AppSight includes a small program called "Black Box" that is
configured by a manifest of sorts that they call a profile. A profile can
instruct the Black Box to hang out in the background waiting for a specified
program to fail, at which time it uses debugger hooks to gather stack dump
and environment info. It can hook system calls and tell you when the
program called what. If you have a PDB file for the application, you can
tell it to watch specific lines of code and gather specific variables each
time the line of code is executed. It can watch the display and grab a
screen snapshot each time a significant event occurs. As I mentioned
previously, it can monitor system resources. All of this info is gathered
on a customer computer and the results are stored automagically in a file
that can be sent back to the shop for detailed analysis. Basically, it's a
souped up debugger that gives you a post-mortem history of what the
application and its environment did leading up to an interesting event
(typically a program failure).

It's also gawdawful expensive, and, at least as of a year ago when I last
used it for anything, the analysis tool was annoyingly buggy. They target
large customers with equally large IT budgets. But it's very impressive, as
is their customer support.

Bob
 
J

Jeffrey Tan[MSFT]

Hi Bob ,

Thank you for sharing the story of AppSight. Oh, I was not aware it before.
It seems that this commercial tool extends the idea of profiling and
instrument to a higher level.

Anyway, if you can reproduce this issue again, please feel free to post,
thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=========================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top