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

Server hangs when compiling big package with error [CORE6068] #6318

Closed
firebird-issue-importer opened this issue May 24, 2019 · 11 comments
Closed

Comments

@firebird-issue-importer

Submitted by: Maxim Kuzmin (cybermax)

Attachments:
database.zip

We have a package with several procedures and functions. If text of body have a problem (in my case no END), Firebird utilize 100% CPU and hangs for many minutes. If step by step to empty body of procedures and functions, time of hangs decreased down to instant response.
If in another connection execute SELECT * FROM MON$ATTACHMENTS, connection also hangs, and server never again normal work.
In attachment - script for create database with example of hangs.

Commits: 04deca3 8e228e9

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 24, 2019

Commented by: Maxim Kuzmin (cybermax)

Package for test case - PKG$PAYMENT$BANK_STTM.
If mark as comment line #⁠1731 of body, server hangs.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 24, 2019

Modified by: Maxim Kuzmin (cybermax)

Attachment: database.zip [ 13352 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 25, 2019

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 27, 2019

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 4, 2019

Commented by: @pavel-zotov

I can not confirm that problem was fixed; rather, it still exists (just checked on WI-V3.0.5.33139 Firebird 3.0).

Please download results from here:

https://drive.google.com/drive/u/2/folders/1se_wkUh90_sX7lkyIqBIOeJCWwrLiOII

There are following files:

1) c6068-database.sql.check_commented_line_No_3359.7z -- .SQL script which was provided by ticket author and adapted by me for running in ISQL. One need to adjust path to test DB in this script:

SET SQL DIALECT 3;
set names win1251;
create database 'localhost:C:\FBTESTING\qa\misc\c6068.fdb'; <<<<<<<<<< CHANGE THIS TO YOUR ENV.
show version;

2) launch cmd.exe, change there chcp to 1251 and run isql from FB 3.0.

C:\FBTESTING\qa\misc>chcp 1251
Active code page: 1251

C:\FBTESTING\qa\misc>C:\FB\30SS\isql -q -i c6068-database.sql 2>&1

3) this script execution will hang at these lines:

PROCEDURE SEND\_NOTIFY\_ERROR\_DETECT\_SOURCE
AS
BEGIN
    EXECUTE PROCEDURE PKG$SEND\_EMAIL\.SEND\_TO\_EMAILS\('kuzmin@gazdv\.ru,ryazanov@gazdv\.ru', 'ulezlova@gazdv\.ru,kuzmina2@gazdv\.ru,muratova@gazdv\.ru,smirinskayaea@gazdv\.ru', 'Ошибка при поиске источников о

латы в выписке', 'Загружал пользователь: ' || PKG$CONNECT.CURRENT_USER_SURNAME_NP());
END

PROCEDURE SEND\_NOTIFY\_ERROR\_CREATE\_ALL\_RE
AS
BEGIN
    EXECUTE PROCEDURE PKG$SEND\_EMAIL\.SEND\_TO\_EMAILS\('kuzmin@gazdv\.ru,ryazanov@gazdv\.ru', 'ulezlova@gazdv\.ru,kuzmina2@gazdv\.ru,muratova@gazdv\.ru,smirinskayaea@gazdv\.ru', 'Ошибка при создании квитанций

о выписке', 'Загружал пользователь: ' || PKG$CONNECT.CURRENT_USER_SURNAME_NP());
END
END^

4) Special batch scenario was applied after this to firebird.exe. This batch created FB dump and stack trace for it, and also it invoked fb_lock_print -c -a <database_i> from WinSDK cdb.exe, where:
<database_i> is every database file which is opened by investigated firebird.exe process.

So, above mentioned files are following:

firebird.3460.20190604_160808.mem.dmp.7z -- full memory dump of hanging FB process
firebird.3460.20190604_160808.trc.txt.7z -- stack trace for it
firebird.3460.20190604_160808.lkt.001.security3.7z -- result of fb_lock_print -c -a -c security3.fdb
firebird.3460.20190604_160808.lkt.002.C6068.7z -- result of fb_lock_print -c -a -c <test_database> // C:\FBTESTING\qa\misc\c6068.fdb in my case.

If we try to connect to <test_database> at this moment - no problem:

C:\FBTESTING\qa\misc>C:\FB\30SS\isql localhost:C:\FBTESTING\qa\misc\c6068.fdb
Database: localhost:C:\FBTESTING\qa\misc\c6068.fdb, User: SYSDBA

-- but:

SQL> set list on;
SQL> select * from mon$attachments where mon$system_flag is distinct from 1;

-- will hang infinitely (i.e. the same as stated by Maksim in the starting message).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 4, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Deferred

Test Details: Checked on WI-V3.0.5.33139 Firebird 3.0 -- bug was not fixed.
Waiting for reply, see message here, 04.06.2019 16:24

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 4, 2019

Commented by: @asfernandes

> Fix Version/s: 4.0 Beta 2

You tested master or v3? From your path, v3.

I said in fb-devel that backport will be done later.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 4, 2019

Commented by: @pavel-zotov

Ooops... :-[

Sorry for noise. Yes - i did use 3.x and did not pay attention that it was not fixed yet.
On 4.0 all fine: script completes with error.

===
PROCEDURE SEND_NOTIFY_ERROR_CREATE_ALL_RE
AS
BEGIN
EXECUTE PROCEDURE PKG$SEND_EMAIL.SEND_TO_EMAILS('kuzmin@gaz
о выписке', 'Загружал пользователь: ' || PKG$CONNECT.CURRENT_USER_S
END
END^
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1735, column 9
-IF
At line 3361 in file C:\FBTESTING\qa\misc\c6068-database.sql

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 4, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred => Done successfully

Test Details: Checked on WI-V3.0.5.33139 Firebird 3.0 -- bug was not fixed.
Waiting for reply, see message here, 04.06.2019 16:24

=>

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 3, 2019

Modified by: @asfernandes

Fix Version: 3.0.5 [ 10885 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 5, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants