programs linked against libcarob.so segfault if the hardcoded local is not 
installed
------------------------------------------------------------------------------------

         Key: CAROB-74
         URL: https://forge.continuent.org/jira/browse/CAROB-74
     Project: Carob
        Type: Bug
  Components: C++ API  
    Versions: V1.0 - full version    
 Environment: Debian stable.
    Reporter: Simon Csaba Endre
 Assigned to: Marc Herbert 
     Fix For: V1.0 - full version


If the en_US.utf8 locale is not installed the program linked agains libcarob.so 
will segfault. Here is the debugger output:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 2462)]
0x403dfb07 in std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>::in () 
from /usr/lib/libcarob.so
(gdb) bt
#0  0x403dfb07 in std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>::in 
() from /usr/lib/libcarob.so
#1  0x403df6aa in CarobNS::MBSCodec::decode () from /usr/lib/libcarob.so
#2  0x403ad6b2 in CarobNS::StaticCodecs::fromString () from /usr/lib/libcarob.so
#3  0x403ad354 in CarobNS::fromString () from /usr/lib/libcarob.so
#4  0x403deee0 in (anonymous namespace)::exception_message () from 
/usr/lib/libcarob.so
#5  0x403df180 in CarobNS::trylocale () from /usr/lib/libcarob.so
#6  0x403a79ab in CarobNS::replaceAll () from /usr/lib/libcarob.so
#7  0x403a7ab0 in CarobNS::replaceAll () from /usr/lib/libcarob.so
#8  0x403dfbc5 in CarobNS::CodecException::CodecException () from 
/usr/lib/libcarob.so
#9  0x403a7369 in _init () from /usr/lib/libcarob.so
#10 0x4000c1ce in _dl_catch_error () from /lib/ld-linux.so.2
#11 0x4000c2ba in _dl_init () from /lib/ld-linux.so.2
#12 0x40000c5d in ?? () from /lib/ld-linux.so.2

This happen before the main() function of the program is reached.

What the user see:
$ ./user_program
Segmentation fault

No error message, no explanation.

Fix: installing the en_US.utf8 locale package. But why?

Why the character conversion is depending on the locale settings? And why on 
the en_US.utf8 locale?

I understood that LC_CTYPE is needed by some functions (isupper(), isspace()..) 
but as I know Carob is doing just the conversion between normal characters to 
wide characters and not doing any operation on the character string.

IMHO no need for the locales. Even worst on Debian the en_US.utf8 is not 
installed by default.

If cannot be fixed then please make it configurable at least the locale 
settings and mention it in the README file so the user can install/configure 
the needed locales.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


_______________________________________________
Carob mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob

Reply via email to