- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SIGBUS in setlocale()
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2006 01:07 AM
04-06-2006 01:07 AM
SIGBUS in setlocale()
I have an application ported on Windows (2k, 2003), Solaris (9,10) and HPUX (11.i). The application crashes only on HPUX in setlocale() with SIGBUS.
The stack looks like:
#0 0x425160 in setlocale+0x84 ()
#1 0x2e52ac in get_charset (_charset=0x79c7c6a8
"\303z4\037\306\016\203c") at i18n.c:330
#2 0x478ff0 in CLIServer:mlch2ch::get_XMLTranscoder (this=0x79c7460c) at xmlch2ch.h:39
........................................................................................................
Of course, the higher frames than #0 are inside our code. The last code line is
crt_locale = strdup(setlocale(LC_CTYPE, NULL));
The linking command is:
aCC -Wl,+s -o
I have PHCO_33711 applied. Machine is
HP-UX hpux B.11.11 U 9000/785 2011252307 unlimited-user license
What is wrong?
Thank you in advance
Radu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2006 01:38 AM
04-06-2006 01:38 AM
Re: SIGBUS in setlocale()
please seperate the commands, which will give you a better idea exactly which one is failing (setlocale or strdup). I assume you have included the definitions for LC_CTYPE and NULL. crt_locale should be able to hold a pointer. Also, you didn't notice any memory problems, as malloc is being used by strdup?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2006 02:00 AM
04-06-2006 02:00 AM
Re: SIGBUS in setlocale()
No, I see no memory stress; the application is taking under 30MB in that moment.
The crash is not always reproducible, but always the stack is the same. Otherwise I would suppose a memory corruption somewhere.
I suspect that is also related to the build system. Building the application on other machine, it seems not to crash, although because it is intermittent I couldn't guarranty that.
Radu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2006 02:37 AM
04-06-2006 02:37 AM
Re: SIGBUS in setlocale()
from nman environ:
"For example, when invoked as
setlocale(LC_CTYPE, ""), setlocale() will query the
LC_CTYPE environment variable first to see if it is
set and non-null. If LC_CTYPE is not set or null, then
setlocale() will check the LANG environment variable
to see if it is set and non-null. If both LANG and
LC_CTYPE are unset or NULL, the default "C" locale
will be used to set the LC_CTYPE category."
Although this error is not always repeatable, it may be worthwhile checking your environment definitions ,such as LC_CTYPE, NULL etc. Are you getting clean compiles/links?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2006 05:18 AM
04-07-2006 05:18 AM
Re: SIGBUS in setlocale()
Radu
p.s. about compiling, yes it is clear, except the horde of "Future Error" specific to aCC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2006 10:49 AM
04-07-2006 10:49 AM
Re: SIGBUS in setlocale()
Change the call to setlocale and then re-compile:
FROM...
crt_locale = strdup(setlocale(LC_CTYPE, NULL));
TO...
crt_locale = strdup(setlocale(LC_CTYPE, ""));
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 10:07 PM
04-10-2006 10:07 PM
Re: SIGBUS in setlocale()
I need to stick with NULL usage because it is returning locales set on process (these ones I need), not on system as using "". Am I wrong?
Radu