- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- pthread_create fails with error 12
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
Discussions
Discussions
Forums
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
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
тАО10-18-2007 01:05 AM
тАО10-18-2007 01:05 AM
pthread_create fails with error 12
I gone through this thread also "https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1158774".
These are some of the informations:
max_thread_proc = 1024
Machine information: "HP-UX B.11.11 U 9000/800"
aCC -V "aCC: HP ANSI C++ B3910B A.03.37"
what libpthread.sl
libpthread.sl:
Pthread Interfaces
$Revision: libpthread.1: @(#) depot-32pa CUP11.11_BL2001_1023_2 PATCH_11.11 PHCO_25226 Tue Oct 23 14:00:09 PDT 2001 $
Linker options: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_C_SOURCE=199506L -mt -lpthread -lm
Suggestions Please.
- Tags:
- pthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 01:34 AM
тАО10-18-2007 01:34 AM
Re: pthread_create fails with error 12
Please install a more recent version PHCO_36229
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 02:39 AM
тАО10-18-2007 02:39 AM
Re: pthread_create fails with error 12
top isn't a precise tool -- but I'm assuming your binary is set to EXEC_MAGIC (normal executable).. hence you have 2Gb of space for your private objects, and 2Gb of space for shared objects [keeping in mind that 11.11 PA reserves .25Gb of that global shared space for Memory Mapped I/O objects, so in practice 1.75Gb for non-MMIO shared objects].
If you want more than 2Gb of private space (which is where your pthreads are trying to go), you'll need to chatr your application with +q3p at least (and eventually go to q4p). Note that this trades off private for shared space -- and will mean that any Shared libraries you have must fit in the Fourth Quadrant, which is normally preferred for system libraries / libraries which are Global across Memory Windows. There may not be enough room in q4 for your libraries that will be moving from q3, so consider yourself warned.
The real solution, of course -- is to get out of the limitations of the 32-bit addressing model and recompile 64-bit. That's not often quick and cheap (though it can be), so I understand if you dislike the idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 12:35 PM
тАО10-18-2007 12:35 PM
Re: pthread_create fails with error 12
Given that 64-bit has been possible with HP-UX for a decade now (11.0 FCS was November of 1997) it might not be a bad time to consider a 64-bit upgrade of your application(s)... if nothing else, there are options to the compiler (perhaps even one as old as yours :) to at least give 64-bit compatability warnings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 01:04 PM
тАО10-18-2007 01:04 PM
Re: pthread_create fails with error 12
I don't see you using -N as a linker option?
You must also compile with -mt.
>Rick: there are options to the compiler (perhaps even one as old as yours :) to at least give 64-bit compatibility warnings.
Probably not that old. +M2 needs A.03.52.
I suppose you could use this instead:
+Ww818,819,887,863,1036,1037,1038
Or better yet, download cadvise and use +w64bit:
http://www.hp.com/go/cadvise
- Tags:
- -mt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 10:03 PM
тАО10-18-2007 10:03 PM
Re: pthread_create fails with error 12
Don> Yes, our application is EXEC_MAGIC. We tried with the +q3p enable option and we could see the difference, in terms of memory usage. Previously the application failed at 2004M and now it is not failing but it is hanging at 2098M, where the CPU% is showing as 99.9%. Is this option(+q3p) is having any relevance with CPU utilization?.
Our application is a multiplatform tool, so it requires a architectural change in order to go for 64 bit.
Rick> We are linking with -N option. What would be the difference if we add this as the compiler option?
Dennis> I'm sorry. I forgot to mention about the -N option in the linker options which i already mentioned. Below is some information.
CPPFLAGS = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_HPUX_SOURCE -D_HP_UNIX_ -D_HP_UNIX_ACC_ -D_POSIX_C_SOURCE=199506L
CXXFLAGS = -mt -AA +Z +eh +DAportable -w -Wc,-ansi_for_scope,off
MAKEDEPEND_FLAGS = +M
LDFLAGS = -Wl,+s -b -mt
LINKOPTS = -AA -Wl,-N -Wl,+s +eh -lpthread -lm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 11:49 PM
тАО10-18-2007 11:49 PM
Re: pthread_create fails with error 12
This is pure speculation - but I'm suspicious that you crossed the 2048Mb boundary for a private pointer (i.e. pointer from malloc() / mmap(), etc.) and started looping. That makes me think there's a cast (implicit or explicit) of a pointer to a signed 32-bit integer in there somewhere... causing your private address to get truncated. Then you could be trying to step through what's now a negative loop state, etc. Running cadvise from Dennis's link is probably a good idea in general.
Have you tried attaching a debugger to the application to see where the presumed looping activity is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 12:28 AM
тАО10-19-2007 12:28 AM
Re: pthread_create fails with error 12
Below is the information of the application taken using chatr.
normal executable
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path disabled second Not Defined
shared library list:
.
.
. (our application libraries)
.
.
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libm.2
dynamic /usr/lib/libstd_v2.2
dynamic /usr/lib/libCsup_v2.2
dynamic /usr/lib/libcl.2
dynamic /usr/lib/libc.2
static /usr/lib/libdld.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 09:49 AM
тАО10-19-2007 09:49 AM
Re: pthread_create fails with error 12
That won't happen in 32 bit mode. But a signed vs unsigned compare would go wrong.
>Don: Have you tried attaching a debugger to the application to see where the presumed looping activity is?
Right, that's a good idea. You can also try attaching tusc to see if any syscalls are being done.
>i attached the process to wdb and trying to find the loop.
Did you find anything? You could just hit control-C every so often and get stack traces. Or use the "finish" command to see if you return. Then do that again for each frame.
>Below is the information of the application taken using chatr. normal executable
I guess that's EXEC_MAGIC.
>CXXFLAGS = -mt -AA +Z +eh ... -w -Wc,-ansi_for_scope,off
Since +eh is the default, remove it.
Also, using -w isn't a good idea. Better to use +W### to suppress specific warnings.
Any reason you need
-ansi_for_scope,off? You should really fix your code.
>LINKOPTS = -AA -Wl,-N -Wl,+s +eh -lpthread -lm
You don't need -lm or +eh. Also -N is a driver option so you don't need "-Wl,".