Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebird 5 hang after starting remote profiling session #8176

Closed
livius2 opened this issue Jul 9, 2024 · 9 comments · Fixed by #8177 or #8186
Closed

Firebird 5 hang after starting remote profiling session #8176

livius2 opened this issue Jul 9, 2024 · 9 comments · Fixed by #8177 or #8186

Comments

@livius2
Copy link

livius2 commented Jul 9, 2024

Starting RDB$PROFILER.START_SESSION hangs server completely. It stops responding to requests and new connections.

  1. To reproduce the problem, run Flamerobin twice and connect to probably any database (but the same database for both instances).
  2. In the first Flamerobin instance, go to the system tables, right-click on e.g., RDB$FIELDS, choose "Browse data," and leave the window open.
  3. In the second Flamerobin instance, execute the following query (adjust 79 to the connection ID from the first Flamerobin instance).
SELECT RDB$PROFILER.START_SESSION('Profile without "DETAILED_REQUESTS"', NULL, 79)
FROM RDB$DATABASE;

I tried above session on current Firebird 5 snapshot on Windows (5.0.1.1432) 64bit, and the server hung completely.
No new connections were allowed and current connections stopped responding.

@hvlad hvlad self-assigned this Jul 9, 2024
@hvlad hvlad added the type: bug label Jul 9, 2024
@hvlad
Copy link
Member

hvlad commented Jul 9, 2024

The more easy way to reproduce the issue.
Use database that has never run profiler session before - the problem happens when profiler creates its metadata.
Statements cache should be enabled (MaxStatementCacheSize <> 0)

  1. start 1st isql instance against test DB and run any query, I use select current_connection from rdb$database; as its result will be used in next step

  2. start 2nd isql instance against same DB and start profile session against attachment from 1st session:
    SELECT RDB$PROFILER.START_SESSION('Profile', NULL, <N>) FROM RDB$DATABASE;
    where is value from 1st session

Firebird is hung at this point.

hvlad added a commit that referenced this issue Jul 9, 2024
hvlad added a commit that referenced this issue Jul 10, 2024
Fixed bug #8176 : Firebird 5 hang after starting remote profiling session
hvlad added a commit that referenced this issue Jul 10, 2024
@hvlad hvlad closed this as completed Jul 10, 2024
@hvlad
Copy link
Member

hvlad commented Jul 10, 2024

Check next snapshot build, please

@pavel-zotov
Copy link

... QA notes ...
1. On CLASSIC problem still exists: firebird hangs, although new connections to test DB are allowed (found both on 5.x and 6.x).
One may even to run 'delete from mon$attachments' (using new ISQL session) but there is no effect: server does not perform that.
Because of this, test currently can be run only on Super.
2. It looks weird that user (NON-sysdba) who has necessary rights to start profiling, must be explicitly granted to access PLG* tables/views.

@pavel-zotov
Copy link

PS.
Link to FB 5.x and 6.x snapshots/dumps/traces when trying to run test under Classic:
https://drive.google.com/drive/folders/1rKtdjjrKGXuqbyldxbXUKtKvuYz086g0?usp=sharing

@hvlad
Copy link
Member

hvlad commented Jul 11, 2024

On CLASSIC problem still exists: firebird hangs

Could you test on Linux, please ? I suppose this is Windows-related and completely independent bug

@pavel-zotov
Copy link

pavel-zotov commented Jul 13, 2024

Checked on Linux, 5.0.1.1439-c7d5566 and 6.0.0.395-845f483, ServerMode = Classic: all fine, FB does not hang.
Used firebird.conf:

AuthServer = Srp, Win_Sspi, Legacy_Auth
BugCheckAbort = 1
ClearGTTAtRetaining = 0
ClientBatchBuffer = 131072
ConnectionIdleTimeout = 0
DefaultDBCachePages = 4K
ExtConnPoolLifeTime = 10
ExtConnPoolSize = 10
ExternalFileAccess = Full
InlineSortThreshold = 1000
IpcName = xnet_fb6x_cs
KeyHolderPlugin = fbSampleKeyHolder
MaxIdentifierByteLength = 252
MaxIdentifierCharLength = 63
MaxParallelWorkers = 8
MaxUnflushedWrites = -1
MaxUnflushedWriteTime = -1
ParallelWorkers = 1
ReadConsistency = 0
RemoteServicePort = 4700
ServerMode = Classic
SnapshotsMemSize = 64K
StatementTimeout = 300
TempCacheLimit = 128M
TempDirectories = /var/tmp/qa_2024b
TipCacheBlockSize = 4M
UseFileSystemCache = true
UserManager = Srp, Legacy_UserManager
WireCrypt = Enabled
WireCryptPlugin = ChaCha, Arc4

@hvlad
Copy link
Member

hvlad commented Jul 20, 2024

Reopened to fix more problems with profiler IPC

@hvlad hvlad reopened this Jul 20, 2024
@hvlad hvlad linked a pull request Jul 20, 2024 that will close this issue
@hvlad
Copy link
Member

hvlad commented Jul 24, 2024

Should be fixed now

@hvlad hvlad closed this as completed Jul 24, 2024
@livius2
Copy link
Author

livius2 commented Jul 29, 2024

Check next snapshot build, please

It is ok now, thanks

dyemanov pushed a commit that referenced this issue Nov 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…sion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment