dbeaver / dbeaver

Free universal database tool and SQL client
https://dbeaver.io
Apache License 2.0
40.07k stars 3.45k forks source link

Sometimes DBeaver starts consuming CPU heavily using one of its threads in an infinite loop #35301

Open ask9 opened 1 month ago

ask9 commented 1 month ago

Description

It leads to the call from the system library: ucrtbase.dll!configthreadlocale+0x50 At that moment, I do nothing in DBeaver. This thread will never end (looks like it is an infinite loop, I waited more than a hour and it was still in progress) Here is what I see in ProcExp:

https://github.com/user-attachments/assets/5a7cdd1d-a177-4f6a-b87c-2467836353b3

Here is thread dump:

dbeaver-thread-dump.txt

DBeaver Version

Community Edition 24.1.5-202408122322

Operating System

Windows 10

Database and driver

PostgreSQL 16 PostgreSQL JDBC Driver 42.7.2

Steps to reproduce

Additional context

I found something interesting in log-files located in the folder: C:\Users\user\AppData\Roaming\DBeaverData\workspace6.metadata\

See how much events Datasource <*> not found in project General generated every millisecond. Could you please examine the possibility of an infinite loop over there in code?

dbeaver-debug-1724276504022.zip

E1izabeth commented 1 month ago

See how much events Datasource <*> not found in project General generated every millisecond. Could you please examine the possibility of an infinite loop over there in code?

This message is sent, when you open DBeaver and have script for some deleted connection. Have you moved your connections to some folders or deleted them?

E1izabeth commented 1 month ago

For now we can't reproduce the issue. We would appreciate to any clue how to reproduce it. Unfortunately, neither logs not thread dump contain something specific.

ask9 commented 1 month ago

See how much events Datasource <*> not found in project General generated every millisecond. Could you please examine the possibility of an infinite loop over there in code?

This message is sent, when you open DBeaver and have script for some deleted connection. Have you moved your connections to some folders or deleted them?

Yes, I delete/recreate my connections frequently. No problem if the connections will be disconnected in this case.

ask9 commented 1 month ago

For now we can't reproduce the issue. We would appreciate to any clue how to reproduce it. Unfortunately, neither logs not thread dump contain something specific.

I tried to find the steps.. I think it will not be possible to find out the certain steps to reproduce it. It happens rarely and without any certain action from my side.

E1izabeth commented 1 month ago

I see, thank you

ask9 commented 1 month ago

I suspect the issue is only reproducible on Windows OS because the system library involved. If someone will decide to investigate it, first of all try it on Windows (not Linux/MacOS). Ideally - on the same version as on my side: Windows 10 Pro 22H2 19045.4780

And check also the version of this suspicious system file: C:\Windows\System32\ucrtbase.dll

0000003495 0000003496 0000003497

arhayka commented 1 month ago

Could you please try to generate a thread dump and attach it here? Important: you should do it at the very moment when it happens. Here is the instruction: https://dbeaver.com/docs/wiki/Making-a-thread-dump/ Thank you.

ask9 commented 1 month ago

@arhayka I've already done it (see the txt-file attached to my first message in this thread, right after the video).

Destrolaric commented 1 month ago

Just for now, could you try sfc /scannow in administrator CMD terminal. Just to be sure that it's not corrupted library issue.

ask9 commented 1 month ago

@Destrolaric OK. I've done it. One component was repaired (not related to our issue) and some warnings are also presented in the log.

CBS.log