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

Engine crashes when trace config contains line "connection_id=NN" and we attempt to connect to non-existent database/alias [CORE4319] #4642

Closed
firebird-automations opened this issue Jan 19, 2014 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
gdb-firebird.140119_115916.1.zip

LI-T3.0.0.30824

Scenario:
1. Window #⁠1.
Running trace:

/opt/fb30trnk/bin/fbtracemgr -sta -c ztrace.conf -se localhost/3333:service_mgr
Trace session ID 1 started

2. Window #⁠2.
$ /opt/fb30trnk/bin/isql -q
-- now trying to connect to alias that doesn`t present in databases.conf:
SQL> connect 'localhost/3333:nosuchdatabase';

Output in ISQL:
Statement failed, SQLSTATE = 08006
Error reading data from the connection.

Output in trace:
Error reading data from the connection.

After that coredump file is created, stacktrace for it see in attach.

PS-1. Trace config contains the following lines:

$ cat ztrace.conf
database = #⁠
{
enabled = true
log_filename = /opt/fb30cs/ztrace.log
log_sweep = true
log_errors = true

#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠ A C H T U N G #⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠
time_threshold = 0
connection_id=84
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

log_connections = true
log_transactions = true

#⁠log_statement_prepare = true
#⁠log_statement_start = true
#⁠log_statement_free = true

log_trigger_start = true
log_procedure_start = true

log_statement_finish = true
log_procedure_finish = true
log_trigger_finish = true

print_plan = true
print_perf = true
max_sql_length = 8192
max_log_size = 5000000
}

Please note that line with 'connection_id=84' is erroneously UNcommented.

PS-2. I have several instances of FB on that machine but currently only one is running:
$ ps aux|grep fir|grep -v grep
firebird 6030 0.0 0.0 28200 940 ? S 11:53 0:00 /opt/fb30trnk/bin/fbguard -pidfile /var/run/fb30trnk/fb30trnk.pid -daemon -forever
firebird 6237 0.0 0.0 300328 7012 ? Sl 11:59 0:00 /opt/fb30trnk/bin/firebird

Commits: 12f2a54 57b5681 FirebirdSQL/fbt-repository@256175e FirebirdSQL/fbt-repository@3dd8f68

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: gdb-firebird.140119_115916.1.zip [ 12412 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS.
There is no crash when I comment line "connection_id=84" in trace.conf, I get in SQL common message for such action:

Statement failed, SQLSTATE = 08001
I/O error during "open" operation for file "nosuchdatabase"
-Error while trying to open file
-No such file or directory

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

summary: Engine crashes when trace session is opened and we try to connect to non-existent database/alias => Engine crashes when trace config contains line "connection_id=NN" we try to connect to non-existent database/alias

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

description: Scenario:
1. Window #⁠1.
Running trace:

/opt/fb30trnk/bin/fbtracemgr -sta -c ztrace.conf -se localhost/3333:service_mgr
Trace session ID 1 started

2. Window #⁠2.
$ /opt/fb30trnk/bin/isql -q
-- now trying to connect to alias that doesn`t present in databases.conf:
SQL> connect 'localhost/3333:nosuchdatabase';

Output in ISQL:
Statement failed, SQLSTATE = 08006
Error reading data from the connection.

Output in trace:
Error reading data from the connection.

After that coredump file is created, stacktrace for it see in attach.

PS-1. Trace config contains the following lines:

$ cat ztrace.conf
database = #⁠
{
enabled = true
log_filename = /opt/fb30cs/ztrace.log
log_sweep = true
log_errors = true

#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠ A C H T U N G #⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠
time_threshold = 0
connection_id=84
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

log_connections = true
log_transactions = true

#⁠log_statement_prepare = true
#⁠log_statement_start = true
#⁠log_statement_free = true

log_trigger_start = true
log_procedure_start = true

log_statement_finish = true
log_procedure_finish = true
log_trigger_finish = true

print_plan = true
print_perf = true
max_sql_length = 8192
max_log_size = 5000000
}

Please note that line with 'connection_id=84' is erroneously UNcommented.

PS-2. I have several instances of FB on that machine but currently only one is running:
$ ps aux|grep fir|grep -v grep
firebird 6030 0.0 0.0 28200 940 ? S 11:53 0:00 /opt/fb30trnk/bin/fbguard -pidfile /var/run/fb30trnk/fb30trnk.pid -daemon -forever
firebird 6237 0.0 0.0 300328 7012 ? Sl 11:59 0:00 /opt/fb30trnk/bin/firebird

=>

LI-T3.0.0.30824

Scenario:
1. Window #⁠1.
Running trace:

/opt/fb30trnk/bin/fbtracemgr -sta -c ztrace.conf -se localhost/3333:service_mgr
Trace session ID 1 started

2. Window #⁠2.
$ /opt/fb30trnk/bin/isql -q
-- now trying to connect to alias that doesn`t present in databases.conf:
SQL> connect 'localhost/3333:nosuchdatabase';

Output in ISQL:
Statement failed, SQLSTATE = 08006
Error reading data from the connection.

Output in trace:
Error reading data from the connection.

After that coredump file is created, stacktrace for it see in attach.

PS-1. Trace config contains the following lines:

$ cat ztrace.conf
database = #⁠
{
enabled = true
log_filename = /opt/fb30cs/ztrace.log
log_sweep = true
log_errors = true

#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠ A C H T U N G #⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠
time_threshold = 0
connection_id=84
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

log_connections = true
log_transactions = true

#⁠log_statement_prepare = true
#⁠log_statement_start = true
#⁠log_statement_free = true

log_trigger_start = true
log_procedure_start = true

log_statement_finish = true
log_procedure_finish = true
log_trigger_finish = true

print_plan = true
print_perf = true
max_sql_length = 8192
max_log_size = 5000000
}

Please note that line with 'connection_id=84' is erroneously UNcommented.

PS-2. I have several instances of FB on that machine but currently only one is running:
$ ps aux|grep fir|grep -v grep
firebird 6030 0.0 0.0 28200 940 ? S 11:53 0:00 /opt/fb30trnk/bin/fbguard -pidfile /var/run/fb30trnk/fb30trnk.pid -daemon -forever
firebird 6237 0.0 0.0 300328 7012 ? Sl 11:59 0:00 /opt/fb30trnk/bin/firebird

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Component: Engine [ 10000 ]

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

summary: Engine crashes when trace config contains line "connection_id=NN" we try to connect to non-existent database/alias => Engine crashes when trace config contains line "connection_id=NN" and we attempt to connect to non-existent database/alias

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Version: 3.0 Alpha 1 [ 10331 ]

Version: 2.5.2 Update 1 [ 10521 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

Component: TRACEMGR [ 10140 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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