Possible server/utilities hang because of infinity loop in
AbstractString::vprintf
----------------------------------------------------------------------------------
Key: CORE-6012
URL: http://tracker.firebirdsql.org/browse/CORE-6012
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 4.0 Beta 1, 3.0.4, 3.0.3, 4.0 Alpha 1, 3.0.2, 3.0.1,
3.0.0, 4.0 Initial, 3.0.5, 4.0 Beta 2, 3.0.6
Reporter: Artyom Smirnov
The problem is because only result of vsnprintf checked, but not cause of this
result (e.g. errno).
One of case with this issue I've got and reproduced is hanging gsec on CentOS 6
which have bug in glibc (https://sourceware.org/bugzilla/show_bug.cgi?id=6530)
For example simple reproduction for FB 3.x/4.x: shutdown server, create system
audit file with service auditing and add it to firebird.conf:
services
{
enabled = true
log_filename = /tmp/log
log_services = true
log_service_query = false
}
Run gsec with locale which is not POSIX or C:
LANG=en_US.utf8 bin/gsec -user SYSDBA -password masterkey -add test -pw test
vprintf will get string like "-user SYSDBA -ADD \377TEST\377 -PW \377test\377"
and will hang on it, because vsnprintf result always be -1 and errno always be
84.
All versions affected by infinity loop hang, because this part of code is same,
but this particular case of course will hang only on 3.x/4.x.
What about:
1. Checking errno in vprintf and at least throw exception instead hang?
2. Cleanup service terminal symbols in TracePluginImpl::log_event_service_start
before passing it to vprintf?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel