Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLL loaded from wrong drive when app. run from ICA desktop

Status
Not open for further replies.

BryonB

Programmer
Jun 19, 2002
47
US
I have a Visual Foxpro application that crashes with a fatal exception error when run from the ICA desktop.

The unhandled exception seems to occur in RPCRT4.DLL (the runtime for Remote Procedure Calls). What's odd is that when I look at the list of loaded DLLs from the debugger, it shows this DLL being loaded from the C:\WINNT\System32 folder.

When I installed Citrix, I let it remap the local drives on the server, so they won't conflict with local drives on the client PC. This is the ONLY DLL being referenced from the C: drive. All others are correctly loaded from the local drive on the server.

When I run the application from the system console, it runs fine.

I tried re-registering this DLL with RegSvr32 but this didn't seem to help.

I've run this application on two different Citrix servers now, the first one was running Metaframe 1.8, and I'm now running it on a test server with Metaframe XP with the same result.

Does anyone have any ideas?
 
Alas, it doesn't seem to be the location of the DLL that's the problem.

I created a redirection file (i.e. appname.exe.local) in the folder where the .EXE resides, and copied the RPCRT4.DLL file to that folder.

When the app runs, it now loads it from that location, but it still crashes.

The code that is executing looks very similar to code referenced in an old fix for Windows NT 4.0 (1999) that caused fatal exceptions in the same DLL.

I'm not sure what else to try.
 
Can you tell us the error codes that are generated....????

Is the .dll replaced by the Foxpro install or are you still running with the Windows version....???? What permissions are on your system32 folders....???

 
The .DLL is a 12/13/2001 version that was installed by Microsoft COM+ patch (Q313582). I tried uninstalling this patch, but it didn't make any difference, so I applied it again.

The permissions on the System32 folder give Read, Execute, and List rights to the Users group, with Modify and Write rights added for Power Users, and Full Control added for Administrators. I haven't changed any of these rights. I'm logging in as a user with Administrator rights though, so permissions shouldn't be a problem.

When I open the .EXE from within the debugger, and let it run until it crashes, it appears that the first error to appear is an Access violation - code c0000005 in ntdll!RtlFreeHeap. The call stack at that point looks like:

ntdll!RtlFreeHeap+0x40
rpcrt4_18b0000!operator delete+0x12
rpcrt4_18b0000!InitializeDLL+0x34
ntdll!LdrpCallInitRoutine+0x14
ntdll!LdrShutdownThread+0xa3
KERNEL32!ExitThread+0x53
KERNEL32!BaseThreadStart+0x81

It doesn't seem to make any difference what the user is doing in the application, the error happens within about 90 seconds of the application starting up.
 
That document refers to Visual Studio 6.0. We're using Visual Foxpro version 7.0 SP1. We can't go back to VFP 6.0, as our application already makes extensive use of VFP 7 language enhancements. Thanks though.
 
I just tried running the application from the Terminal Services Client, rather than the ICA client. It runs fine that way. So it appears that Citrix is doing something different to the application that is causing it to crash.

I'm running Metaframe XP 1.0, with SP1, Feature Release 1, and the latest version of the 32-bit Windows ICA client.
 
Have you had a read through the following thread.....???

thread48-91199


 
Yes. This is a different error. That thread refers to a problem in which the Windows 2000 server drops connections to external network shares, and the Foxpro application gets an error 1104 trying to access tables.

This is a fatal error.

Since it only happens with the Citrix ICA client, and not the Terminal Services client, I must assume that it may be a problem with Citrix.

Anyone have any ideas?
 
Well, I've tried upgrading to Citrix Metaframe XPe (Feature Release 2, SP2). That didn't help.

I've tried installing Windows 2000 SP3 on my test server. That didn't help.

I did discover one thing that works. If I run the application embedded in a browser window via NFUse 1.7, with the Active-X web client, it seems to run OK. If I bring up a direct ICA connection, however, the application blows up within a few minutes.

This isn't making a lot of sense to me though - and it make me think that it must be a Citrix bug causing the problem with the ICA client.
 
Well, we finally found and solved this problem. It turns out that a programmer who used to work here wrote code in one procedure that declared the RPCRT4.DLL with a hard-coded path (C:\WINNT\SYSTEM32...). Once I removed this, and recompiled the application, it runs fine with either version of the Citrix client.

Why it only blew up when running under the Citrix client, and not under the web client, I don't understand.

To those of you who responded with ideas, THANK YOU!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top