Issue 85222 - Applications abort at startup
Summary: Applications abort at startup
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 680m242
Hardware: All All
: P1 (highest) Trivial (vote)
Target Milestone: OOo 2.4
Assignee: hennes.rohling
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-14 09:52 UTC by Joost Andrae
Modified: 2008-01-18 09:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Joost Andrae 2008-01-14 09:52:52 UTC
The applications abort directly at startup. As far as it has been debugged the
reason might be related with the locale configured (de_DE.UTF-8). When using
en_US.UTF-8 the application can start. The problem seems to be in lib-tools

Tested on Ubuntu Depperdrake
Comment 1 Stephan Bergmann 2008-01-14 10:33:55 UTC
Reproducible at least on a Linux box that does not have de locales in
/usr/lib/locale:

- set the locale to de_DE.UTF-8 when calling soffice

- _imp_getProcessLocale at sal/osl/unx/nlsupport.c:1.35 l. 640 determines only a
"C" locale

- osl_getThreadTextEncoding() therefor returns RTL_TEXTENCODING_DONTKNOW

- tools/source/misc/extendapplicationenvironment.cxx:1.1.6.2 l. 81 calls abort()
when rtl::OUString::convertToString fails, which it does when
osl_getThreadTextEncoding() returns RTL_TEXTENCODING_DONTKNOW

@hro:  Apart from clarifying if the behavior of _imp_getProcessLocale is
correctin the given environment, it would probably be useful to let
osl_getThreadTextEncoding return RTL_TEXTENCODING_ASCII_US when the locale is "C".
Comment 2 hennes.rohling 2008-01-14 17:52:06 UTC
For a not installed locale RTL_TEXT_ENCODING_ASCII_US is the most meaningful
default, I agree.
Comment 3 rt 2008-01-15 08:49:07 UTC
Got the following patch by hro and applied it as masterfix for OOH680 (m3) and
SRC680 (m243):

@@ -991,6 +991,15 @@
 		defaultEncoding = osl_getTextEncodingFromLocale(NULL);
 
 	OSL_ASSERT(defaultEncoding != RTL_TEXTENCODING_DONTKNOW);
+
+	/*
+	Tools string functions call abort() on an unknown encoding so ASCII
+	is a meaningfull fallback regardless wether the assertion makes sense.
+	*/
+
+	if ( RTL_TEXTENCODING_DONTKNOW == defaultEncoding )
+		defaultEncoding = RTL_TEXTENCODING_ASCII_US;
+
 	g_thread.m_textencoding.m_default = defaultEncoding;
 }
 
Comment 4 Joost Andrae 2008-01-16 14:46:52 UTC
Verified fix for OOH680_m3.
Comment 5 Joost Andrae 2008-01-18 09:59:05 UTC
verified in SRC680_m243 as well. Marking issue as verified.
Comment 6 Joost Andrae 2008-01-18 09:59:29 UTC
closing verified issue