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

Memory leak when doing a lot of iterations FBSVCMGR with action_trace_start, _list and _stop [CORE3969] #4302

Closed
firebird-issue-importer opened this issue Oct 29, 2012 · 15 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Attachments:
pslist_m.zip

Votes: 1

I run infinite loop with the following actions:
1) FBSVCMGR action_trace_start
2) connect to .fdb via ISQL and make a simplest query, e.g.: select current_connection from rdb$database; quit;
3) FBSVCMGR action_trace_list (obtain the ID of active trace sesssion)
4) FBSVCMGR action_trace_stop

Under such circumstances memory leak of process fb_inet_server (tested on SC) occurs.
The following batch file illustrate the problem (some 3rd part utilities need for this test: mtee.exe for duplicating output and psList by SysInternals to output memory consumprion by processes):

@echo off
cls
@Rem file = 'trc_toggle.bat'
@Rem restart FB for each trace session number will be always 1
@Rem net stop "Firebird Server - fb25_3050"
@Rem net start "Firebird Server - fb25_3050"
pslist -m | findstr /i /c:"name" | mtee /t pslist_m.log
pslist -m | findstr /i /c:"fb_inet_server" | mtee /t /+ pslist_m.log
set inp=.\tmp_sql.tmp
set out=.\tmp_log.tmp
set i=1
:beg
if exist %inp% del %inp%
if exist %out% del %out%

echo select current_connection,current_timestamp from rdb$database;>>%inp%
@Rem echo out nul; select * from rdb$fields,rdb$fields; out;>>%inp%
echo quit;>>%inp%
@echo off
@echo -----------------------
@echo Start of iter #⁠ %i%.
@echo on
start /min %FIREBIRD%\bin\fbsvcmgr localhost:service_mgr action_trace_start trc_cfg zaudit.conf 1>tmp_trace_start.tmp 2>&1
@echo off
ping -n 2 127.0.0.1 >nul

%FIREBIRD%\bin\isql localhost:test_alias -n -i %inp% -o %out% -m
ping -n 3 127.0.0.1 >nul

%FIREBIRD%\bin\fbsvcmgr localhost:service_mgr action_trace_list | findstr /i /c:"Session ID" 1>tmp_trace_list.tmp 2>&1
@Rem get content of file with trace id:
set /p trc_id=<tmp_trace_list.tmp
@Rem extract digits:
set trc_id=%trc_id:~12,5%
@echo on
%FIREBIRD%\bin\fbsvcmgr localhost:service_mgr action_trace_stop trc_id %trc_id% 1>tmp_trace_stop.tmp 2>&1
@Rem check that no trace sessions still alive:
%FIREBIRD%\bin\fbsvcmgr localhost:service_mgr action_trace_list
@echo off
@echo End of iter #⁠ %i%.
pslist -m | findstr /i /c:"fb_inet_server" | mtee /t /+ pslist_m.log
ping -n 2 127.0.0.1 >nul

set /a i=i+1
goto beg

The cumulative log of this batch (results of psList -m) is in attach.

Commits: c08c25a e1481ec

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 29, 2012

Modified by: @pavel-zotov

Attachment: pslist_m.zip [ 12249 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 30, 2012

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 1, 2012

Modified by: @hvlad

Version: 2.5.1 [ 10333 ]

Version: 2.5.0 [ 10221 ]

Fix Version: 2.5.2 [ 10450 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 1, 2012

Modified by: @hvlad

Version: 2.5.2 [ 10450 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 2.5.2 [ 10450 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 1, 2012

Commented by: @hvlad

Fix is committed. Please, test next snapshot build and confirm.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 2, 2012

Commented by: @pavel-zotov

> Please, test next snapshot build and confirm.

I've tested on build WI-2.5.3.26551 and all OK: no more memory leaks in columns VM and WS can be found (test was running over 1.5 hour).

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 2, 2012

Commented by: @hvlad

Thanks for the testing and confirmation !

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 2, 2012

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 19, 2012

Commented by: @hvlad

Fix was Windows only but should be platform independent. Reopen to complete fix.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 19, 2012

Modified by: @hvlad

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

resolution: Fixed [ 1 ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 20, 2012

Commented by: @pavel-zotov

Vlad,

I've tested build of 19-nov-2012 in LINUX environment and it seems that the problem is gone.
The test consisted of heavy load of single database by ~650 connects and huge amount of DML inside each of them.
Beside these connection there was a special `calibration test` script which did loop with starting and stopping trace via FBSVCMGR on each iteration multiple times.
Test has been run during ~3 hour - this time was more than enough to cause FB in crash with coredump earlier.

So, I can confirm that this bug was resolved. Thank you very much.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 20, 2012

Commented by: @hvlad

Pavel,

thank you for the reporting bugs, testing fixes and patience

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 20, 2012

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 23, 2013

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 15, 2015

Modified by: @pavel-zotov

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

QA Status: Cannot be tested

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

Successfully merging a pull request may close this issue.

None yet
2 participants