How to find a process with a CPU time > 25%?

The difference between cladb.exe and cladbne.exe is that the first one is linked with the manifest (also, programs use different icons). I do use my own variant of the which has no links to CLARUN and CLAASL. I have no problems with debugging (almost) any program using that debugger.

1 Like

See an example program how to get process performance counters.

Is it a problem to have the debugger on the server and run it when the problem occurred?:

Thank you, that PDH_COUNTER_PATH_ELEMENTS will probably give what I am looking for. Unfortunate it is a bit beyond my skills to translate into Clarion and (I guess) using an API. Is there a more Clarion like example available?

Check your Task Manager and you may see an elevated antivirus, especially Windoze antivirus.

I don’t believe that Windows defender is the cause. I know this sometime happend with TPS files, but this is MS SQL and my application folders are excluded from scanning.
But it is worth a try, so I stopped Windows defender and we will see what happens. (And no I won’t stop the Windows firewall, that would be not a wise thing to do.

Sum up of some crossed-posts about this

wmic path Win32_PerfFormattedData_PerfProc_Process where “PercentProcessorTime > 25” get PercentProcessorTime, Name, IdProcess

(and the usual disclaimer about killing a process)

and this related thread:

Koem,

Just thought this would be useful info as it affects all programs, even when turned off. The Task Manager tells all.

Thanks, that solved it. I tried “PID” and “ProcessID” but not “IdProcess” :slight_smile:

What is your personal telephone number. If my users have complaints they can call you… :clown_face:
No of course, this is my own risk, but I am willing to take it.

Just to add, as the problem that causes the freezes seems the same as the problems related to Translator class in C10/11, and that debugging the program was suggested, back in the day, it was hard to reproduce, and I dedicated some time debugging that problem but couldn’t find anything usesful and ended up just disabling it. Clarion debugger had some trouble entering in some places when it pops up the message whex.cpp and it is difficult when the problem starts in a place and blows up in other place (something usual) and worse when debugging on internal parts of the RTL or Winapi without source or references.

What I could add that when this problem ocurred, it appeared some minimize, restore/or maximize cannot recall, and cross buttons duplicated, like this image (taken from SV comp.lang.clarion newsgroup recent thread “Mystery fields in a browse” 2023-05-21 by Anthony, but in that case it was about Clarion 6.2)
top_right

I utilized that FauxMax template on our C6 app to get around that multiple-button bug. It wasn’t ideal, but at least we didn’t have that particular bug anymore.

There are no ideal solution for this problem because this is the bug in Windows implementation of MDI. Windows uses a global structure to hold information about MDI (active child, max state, menu of opened MDI child windows, etc.). Windows stuff accesses this structure without any synchronization. As result, for example, if two MDI child windows from different threads are trying to activate, information in that structure can become broken. About 1/3 of the RTL stuff working with WINDOWs is targeting to struggle with this problem.

C12 implements MDI child WINDOWs differently and all kinds of problem related to MS bug with MDI have to go away.

Here is the ZIP with C++ source and VS compiled EXE. This is the test program demonstrating numerous MDI problems. It was sent to MS ~20 years ago. All reported problems were confirmed but with notice that MS were not going to correct anything in MDI code. You can look at how the problem with multiple caption buttons manifests itself without Clarion RTL efforts to eliminate it by selecting the Maximize Test menu item. And feel the difference.
MDI.zip (157.4 KB)

Thanks Alexey for the insights. But I wonder what could have changed on releases after Clarion 10.0.11897 that didn’t crashed according to Jack description.

I added steps to reproduce the problem or a similar one to PTSS 42978 on 2020-10-14.

Thanks Jeff, I saw Graham comments about that template too. Alexey confirms these problems are related (MDI).

And far as I can remember I didn’t have problems with freezing up my application in Clarion 9 build 10376. Once I upgraded to Clarion 11 build 13630 I got this issue (I think).

Tested it, didn’t solve the problem. But it was worth a try.

I use “AlwaysUp” from Core Technologies to run and monitor programs. I believe it has ability to “kill” an app if it hogs the CPU.

1 Like

I tried to work with the debugger. On my development machine it works fine and I was able to follow the directions you gave.

On the server however it doesn’t work yet. First I had to copy more Clarion DLL’s and I ended up by copying all Clarion DLL’s, but after that I was able to start the debugger.

But when I start with cladb -p <pid> I am not able to open the threads list. The D32.log gives an error, but no clue what this means. I noticed a redirection file was created when starting the debugger, but that makes no sense to me. What am I missing?

I figured it out. If I try to hook into a process I started my self it works and the threads list shows up. But when I hook into the process of another user there is no threads list. Ans I have administrator rights on this server.

How can I overcome this?

05 error is “Access denied” error.
Normally I would say right-click on the exe and say “Run as Administrator” but in this case you’re trying to run it from the cmd line.
Have you tried using RunAs cmd?