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

Regression: engine may throw transliteration errors when running from non-ASCII system path [CORE5159] #5442

Closed
firebird-issue-importer opened this issue Mar 20, 2016 · 7 comments

Comments

@firebird-issue-importer

Submitted by: @dyemanov

Unpack Firebird into some non-ASCII directory and try to create some ICU collation (or restore a backup with ICU attributes), for example:

c:\тест\firebird>gbak -r -v -p 8192 c:\firebird\test.fbk c:\firebird\test.fdb
gbak:opened file c:\firebird\test.fbk
gbak:transportable backup -- data in XDR format
gbak: backup file is compressed
gbak:backup version is 9
gbak: ERROR:arithmetic exception, numeric overflow, or string truncation
gbak: ERROR: Cannot transliterate character between character sets
gbak: ERROR:failed to create database c:\firebird\test.fdb
gbak:Exiting before completion due to errors

It works fine with FB 2.5. Stack trace for error:

fbintl\.dll\!Jrd::CsConvert::convert\(\)
fbintl\.dll\!Firebird::IntlUtil::parseSpecificAttributes\(\)
fbintl\.dll\!Jrd::getVersions\(\)
fbintl\.dll\!Jrd::UnicodeUtil::loadICU\(\)
fbintl\.dll\!Jrd::UnicodeUtil::getCollVersion\(\)
fbintl\.dll\!Firebird::IntlUtil::setupIcuAttributes\(\)
fbintl\.dll\!LCICU\_setup\_attributes\(\)
fbintl\.dll\!LD\_setup\_attributes\(\)
engine12\.dll\!Jrd::IntlManager::setupCollationAttributes\(\)
engine12\.dll\!setupSpecificCollationAttributes\(\)
engine12\.dll\!create\_collation\(\)
engine12\.dll\!DFW\_perform\_work\(\)
engine12\.dll\!DFW\_perform\_system\_work\(\)
engine12\.dll\!INI\_format\(\)
engine12\.dll\!Jrd::JProvider::createDatabase\(\)

Transliteration error happens because attributes are treated as ASCII:

charset cs;
IntlUtil::initAsciiCharset\(&cs\);

AutoPtr<CharSet\> ascii\(Jrd::CharSet::createInstance\(\*getDefaultMemoryPool\(\), 0, &cs\)\);

IntlUtil::SpecificAttributesMap config;
IntlUtil::parseSpecificAttributes\(ascii, configInfo\.length\(\),
	\(const UCHAR\*\) configInfo\.c\_str\(\), &config\);

but in fact it includes a "filename" attribute containing ANSI characters:

p = 0x00000000004a0dab "c:\тест\firebird\intl\fbintl;icu_versions=default"

Commits: 08746df 5100c80

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 20, 2016

Modified by: @dyemanov

Fix Version: 3.0.0 [ 10740 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 20, 2016

Commented by: @aafemt

Wasn't decided that configs have to be utf-8 only?..

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 20, 2016

Commented by: @dyemanov

"filename" in config does not include the path, the problem is with runtime expansion of $(this). And for v3.0, I doubt it should be in UTF8, I foresee lots of troubles due to this (all I/O is ANSI based).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 21, 2016

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 21, 2016

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 23, 2016

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: Waiting for reply on letter 2016-03-23 1827 (2 dimitr).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 23, 2016

Modified by: @pavel-zotov

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

QA Status: Deferred => Cannot be tested

Test Details: Waiting for reply on letter 2016-03-23 1827 (2 dimitr). =>

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