vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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+0x98 () #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 nidappsrvd -g0 -AA +DAportable -L. -L/usr/lib -L<some of ours library path, including ../../thirdparty/Xerces2.7/hpux/lib> -mt <objects> -Wl,-a,shared -lpthread -lnsl -lxti -lm -lc -lxerces-c -Wl,-a,archive -<our libs> -lssl -lcrypto What is wrong? Thank you in advance Radu |
| |||
| r.darlea@gmail.com wrote: > 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+0x98 () > #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)); Check if you have the latest patch installed for libc. --vishwas. |
| |||
| r.darlea@gmail.com writes: > The linking command is: > aCC -Wl,+s -o nidappsrvd -g0 -AA +DAportable -L. -L/usr/lib -L<some of > ours library path, including ../../thirdparty/Xerces2.7/hpux/lib> -mt > <objects> -Wl,-a,shared -lpthread -lnsl -lxti -lm -lc -lxerces-c > -Wl,-a,archive -<our libs> -lssl -lcrypto This isn't a good link like -- it leaves "-a archive" hanging, so you link both libc.sl and libc.a (there is a final -lc added by the compiler driver). Also, linking system libraries before application ones is not very kosher. Try: aCC -Wl,+s -o nidappsrvd -g0 -AA +DAportable -L. \ -L<your-lib-dirs> \ -mt <objects> -lxerces-c \ -Wl,-a,archive -l<our libs> -lssl -lcrypto -Wl,-a,shared \ -lnsl -lxti # none of -lm, -lpthread, -lc are necessary here Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |
| |||
| r.darlea@gmail.com wrote: > crt_locale = strdup(setlocale(LC_CTYPE, NULL)); I cannot say I know anything about setlocale, but the HP-UX manpage says this: Setting the Locale of a Program To set the program's locale for category, setlocale() accepts one of the following values as the locale argument: locale name, C, POSIX, or "" (the empty string). The actions prescribed by these values are as follows: I don't see NULL in there. rick jones -- Process shall set you free from the need for rational thought. these opinions are mine, all mine; HP might not want them anyway... feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH... |
| |||
| Rick Jones wrote: > r.darlea@gmail.com wrote: >> crt_locale = strdup(setlocale(LC_CTYPE, NULL)); > > I cannot say I know anything about setlocale, but the HP-UX manpage > says this: > > Setting the Locale of a Program > To set the program's locale for category, setlocale() accepts > one of the following values as the locale argument: locale name, > C, POSIX, or "" (the empty string). The actions prescribed by > these values are as follows: > > I don't see NULL in there. Even though it is not explicit, it does mention the NULL usage. ! Querying the Locale of a Program ! setlocale() queries the current NLS environment pertaining to ! category, if the value of locale is NULL. The query operation ! does not change the environment. ! !... ! ! To query a user's locale: ! char *ch = setlocale(LC_ALL, NULL); --vishwas |
| |||
| r.darlea@gmail.com wrote: > Thx for the hint. Unfortunately, the result persists stubbornly. The > same crash occurs quite quickly. At least now it is rather > "reproducible" than intermittent. Why don't you file a bug report with HP ? --vishwas |