1. Pierre DETE
  2. PowerBuilder
  3. Friday, 19 February 2021 11:03 AM UTC

Hi PB users,

We are facing a difficult issue with one client which sometimes, get the deployed EXE process not closing, and he must kill by himself the process. It's a batch process running on a Windows server 2012 without display.

We have asked for the display information, but it's difficult for him and we have no return for now.

Historically we leave our PB application by a global function which destroy last instantiated objects, COMMIT and DESTROY all transactions and finishes by a HALT.

Of course, we can't reproduce, and the client send us some information each time the problem occurs. The process run every day and the issue occurs one or two times by week. I attached the last screenshots we received.

We have traced the code, and now we are sure the process reach the HALT instruction. We suspect an exception message blocking the exit process. I join some screenshots sent by the client.

We can see some strange lines about ntdl.dll :

ntdl.dll!RtIinitializeExceptionChain...

We tried unsuccessfully to TRY CATCH the HALT.

Is there a way to exit even an exception occurs or redirect any windows blocking messages?

Any suggestion to deal properly with this problem ?

Thank you in advance.

Pierre

 

Attachments (2)
Accepted Answer
Pierre DETE Accepted Answer Pending Moderation
  1. Friday, 16 April 2021 09:44 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi All,

We finally asked Microsoft for help with this problem, they noticed that we are using the HALT command on a Windows server scheduler without a display. They said that HALT is waiting for the display response and cannot be used without a display.

They suggest us to use :

MSDN on the ExitProcess function:
http://msdn.microsoft.com/en-us/library/ms682658(VS.85).aspx                  

With this code : 

SUBROUTINE ExitProcess(ulong uExitCode) LIBRARY "kernel32.dll"

GarbageCollect()
ExitProcess(0)

We are going to test.

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 16 April 2021 12:08 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Pierre DETE Accepted Answer Pending Moderation
  1. Tuesday, 4 May 2021 13:55 PM UTC
  2. PowerBuilder
  3. # 1

Hello,

I confirm that the ExitProcess function of the windows api was the solution. 

This problem happens with the checkbox 'Run whether user is logged or not' in the Windows Server task scheduler. When you check it, the process starts without user interface and the HALT function of Powerbuilder does not terminate.

Maybe we could have a Powerbuilder 'HALT EXIT' or something like that to force the process to end..

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Wednesday, 3 March 2021 15:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi

The only time we have experienced a PB exe not closing is when we have been interecting with 3rd party objects or DLLs. The problem in our case lay in the 3rd party object, once we removed that the problem stopped. It appeared that the 3rd party object was not closing properly and holding the PB exe in memory.

Food for thought.

David

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 3 March 2021 13:55 PM UTC
  2. PowerBuilder
  3. # 3

Hi Pierre;

Do you use Shared Objects?

Do you use Windows API to create Mutex?

Comment
There are no comments made yet.
Pierre DETE Accepted Answer Pending Moderation
  1. Wednesday, 3 March 2021 13:40 PM UTC
  2. PowerBuilder
  3. # 4

Hello,

Still trying to understand the remaining PB exe process on the client site.

We still suspect an exception message to block the end of the process, but they mysteriously can't provide UI display on their batch server. 

With process explorer they have monitored the process named : cfmarche.exe.

There is 3 threads attached to it. (I join a screenshot)

 Here is the stacks of of the 3 threads :

 

7640

0             ntoskrnl.exe!KeSynchronizeExecution+0x2106

1             ntoskrnl.exe!KeWaitForMultipleObjects+0x135e

2             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

3             ntoskrnl.exe!KeWaitForMutexObject+0x373

4             ntoskrnl.exe!KeStallWhileFrozen+0x1feb

5             ntoskrnl.exe!__misaligned_access+0x13fd

6             ntoskrnl.exe!KeWaitForMultipleObjects+0x152f

7             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

8             ntoskrnl.exe!KeWaitForMultipleObjects+0x9a5

9             ntoskrnl.exe!ObWaitForMultipleObjects+0x289

10          ntoskrnl.exe!PsResumeProcess+0x292

11          ntoskrnl.exe!_setjmpex+0x6553

12          wow64cpu.dll!TurboDispatchJumpAddressEnd+0x598

13          wow64cpu.dll!TurboDispatchJumpAddressEnd+0xac

14          wow64.dll!Wow64LdrpInitialize+0x23a

15          wow64.dll!Wow64LdrpInitialize+0x172

16          ntdll.dll!LdrInitializeThunk+0x12b

17          ntdll.dll!LdrInitializeThunk+0xe

18          ntdll.dll!ZwWaitForMultipleObjects+0xc

19          USER32.dll!MsgWaitForMultipleObjectsEx+0x163

20          USER32.dll!MsgWaitForMultipleObjects+0x1f

21          gdiplus.dll+0x33ba

22          gdiplus.dll!GdipAlloc+0x14f5

23          ntdll.dll!RtlInitializeExceptionChain+0x8f

24          ntdll.dll!RtlInitializeExceptionChain+0x5a

 

7740

0             ntoskrnl.exe!KeSynchronizeExecution+0x2106

1             ntoskrnl.exe!KeWaitForMultipleObjects+0x135e

2             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

3             ntoskrnl.exe!KeWaitForMutexObject+0x373

4             ntoskrnl.exe!KeStallWhileFrozen+0x1feb

5             ntoskrnl.exe!__misaligned_access+0x13fd

6             ntoskrnl.exe!KeWaitForMultipleObjects+0x152f

7             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

8             ntoskrnl.exe!KeWaitForMultipleObjects+0x9a5

9             ntoskrnl.exe!ObWaitForMultipleObjects+0x289

10          ntoskrnl.exe!PsResumeProcess+0x292

11          ntoskrnl.exe!_setjmpex+0x6553

12          wow64cpu.dll!TurboDispatchJumpAddressEnd+0x598

13          wow64cpu.dll!TurboDispatchJumpAddressEnd+0xac

14          wow64.dll!Wow64LdrpInitialize+0x23a

15          wow64.dll!Wow64LdrpInitialize+0x172

16          ntdll.dll!LdrInitShimEngineDynamic+0x23d5

17          ntdll.dll!memset+0xde9e

18          ntdll.dll!LdrInitializeThunk+0xe

19          ntdll.dll!ZwWaitForMultipleObjects+0xc

20          USER32.dll!MsgWaitForMultipleObjectsEx+0x163

21          USER32.dll!MsgWaitForMultipleObjects+0x1f

22          PBVM170.dll!ob_set_external_message_loop+0xbc1

23          PBVM170.dll!ob_run_dispatch_loop+0xc3

24          PBVM170.dll!FN_PluginPollLoop+0x1a2

25          PBVM170.dll!FN_RunExecutableEx+0x3fa

26          PBVM170.dll!FN_RunExecutable+0x5c

27          cfmarche.exe+0x1080

28          cfmarche.exe+0x11f6

29          ntdll.dll!RtlInitializeExceptionChain+0x8f

30          ntdll.dll!RtlInitializeExceptionChain+0x5a

 

8724

0             ntoskrnl.exe!KeSynchronizeExecution+0x2106

1             ntoskrnl.exe!KeWaitForMultipleObjects+0x135e

2             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

3             ntoskrnl.exe!KeWaitForMutexObject+0x373

4             ntoskrnl.exe!KeStallWhileFrozen+0x1feb

5             ntoskrnl.exe!__misaligned_access+0x13fd

6             ntoskrnl.exe!KeWaitForMultipleObjects+0x152f

7             ntoskrnl.exe!KeWaitForMultipleObjects+0xdd9

8             ntoskrnl.exe!KeWaitForMutexObject+0x373

9             ntoskrnl.exe!NtWaitForSingleObject+0xb2

10          ntoskrnl.exe!_setjmpex+0x6553

11          wow64cpu.dll!TurboDispatchJumpAddressEnd+0x598

12          wow64cpu.dll!TurboDispatchJumpAddressEnd+0x3e4

13          wow64.dll!Wow64LdrpInitialize+0x23a

14          wow64.dll!Wow64LdrpInitialize+0x172

15          ntdll.dll!LdrInitializeThunk+0x12b

16          ntdll.dll!LdrInitializeThunk+0xe

17          KERNEL32.DLL!BaseThreadInitThunk+0x24

18          ntdll.dll!RtlInitializeExceptionChain+0x8f

19          ntdll.dll!RtlInitializeExceptionChain+0x5a

 

 

 

 

 

 

Attachments (1)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 February 2021 17:38 PM UTC
  2. PowerBuilder
  3. # 5

Hi Pierre;

  Can you tell us ...

  1. Does the App use a hidden Window?
  2. Does the App use DataStores?
  3. Does the App use DW Controls?
  4. Does the App use MS-Windows SDK API calls?
  5. Does the App run as O/S Service (If so, how is that supported)?

Regards ... Chris

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 19 February 2021 13:25 PM UTC
  2. PowerBuilder
  3. # 6

Try HALT CLOSE

Comment
  1. Chris Pollach @Appeon
  2. Friday, 19 February 2021 17:35 PM UTC
Hi Kevin ... FWIW: If HALT does work, then a HALT CLOSE would be unlikely to succeed (IMHO).
  1. Helpful
  1. Olan Knight
  2. Friday, 19 February 2021 20:05 PM UTC
Probably, but hey...ya never know until you try. :)

  1. Helpful
  1. Kevin Ridley
  2. Friday, 19 February 2021 22:16 PM UTC
That's my point, worth a shot!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.