<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pthread_create fails with error 12 in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088161#M92178</link>
    <description>No, +q3p should have no effect on cpu activity. It only tells VM (that's Virtual Memory not Java Virtual Machine, mind you) to put Q3 in a private space and allow private objects there. From an application point of view, the only difference is higher addresses from MAP_PRIVATE mmap(), malloc(), etc. From a kernel point of view, this is just a matter of the space portion of the Global Virtual Address, the address map (or lack thereof) used for new allocations, etc. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Have you tried attaching a debugger to the application to see where the presumed looping activity is?</description>
    <pubDate>Fri, 19 Oct 2007 06:49:48 GMT</pubDate>
    <dc:creator>Don Morris_1</dc:creator>
    <dc:date>2007-10-19T06:49:48Z</dc:date>
    <item>
      <title>pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088155#M92172</link>
      <description>In our application(32-bit) I'm facing problem with pthread_create(), which says the error as 12. Application is running without any problem when the memory size is below 2004M (Monitored using top), once the memory reaches 2004M then the application is failing. So I looked into kernel parameter maxdsiz which was 0X80000000, I raised the maxdsiz to 0XC0000000 then also the application failed once it reaches 2004M.&lt;BR /&gt;&lt;BR /&gt;I gone through this thread also "&lt;A href="https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1158774" target="_blank"&gt;https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1158774&lt;/A&gt;".&lt;BR /&gt;&lt;BR /&gt;These are some of the informations:&lt;BR /&gt;&lt;BR /&gt;max_thread_proc = 1024&lt;BR /&gt;Machine information: "HP-UX B.11.11 U 9000/800"&lt;BR /&gt;aCC -V "aCC: HP ANSI C++ B3910B A.03.37"&lt;BR /&gt;what libpthread.sl&lt;BR /&gt;libpthread.sl:&lt;BR /&gt;        Pthread Interfaces&lt;BR /&gt;         $Revision: libpthread.1:    @(#) depot-32pa CUP11.11_BL2001_1023_2 PATCH_11.11 PHCO_25226 Tue Oct 23 14:00:09 PDT 2001 $&lt;BR /&gt;&lt;BR /&gt;Linker options: -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_C_SOURCE=199506L -mt -lpthread -lm&lt;BR /&gt;&lt;BR /&gt;Suggestions Please.</description>
      <pubDate>Thu, 18 Oct 2007 08:05:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088155#M92172</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-10-18T08:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088156#M92173</link>
      <description>Your current pthread revision dates from 2001.&lt;BR /&gt;&lt;BR /&gt;Please install a more recent version PHCO_36229</description>
      <pubDate>Thu, 18 Oct 2007 08:34:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088156#M92173</guid>
      <dc:creator>Luk Vandenbussche</dc:creator>
      <dc:date>2007-10-18T08:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088157#M92174</link>
      <description>maxdsiz can't help you when you hit the architected quadrant boundaries.&lt;BR /&gt;&lt;BR /&gt;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].&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 18 Oct 2007 09:39:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088157#M92174</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2007-10-18T09:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088158#M92175</link>
      <description>And in some cases it may be necessary to compile the 32-bit application with (IIRC) -N or something to allow using some of those other spaces for data/heap/whatnot.  (I'm networking not compilers, so my dimm memory will be slightly off on the syntax, but I think the gist of it is accurate)&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 18 Oct 2007 19:35:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088158#M92175</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2007-10-18T19:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088159#M92176</link>
      <description>That link was for EAGAIN not ENOMEM.&lt;BR /&gt;I don't see you using -N as a linker option?&lt;BR /&gt;You must also compile with -mt.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Rick: there are options to the compiler (perhaps even one as old as yours :) to at least give 64-bit compatibility warnings.&lt;BR /&gt;&lt;BR /&gt;Probably not that old.  +M2 needs A.03.52.&lt;BR /&gt;I suppose you could use this instead:&lt;BR /&gt;+Ww818,819,887,863,1036,1037,1038&lt;BR /&gt;&lt;BR /&gt;Or better yet, download cadvise and use +w64bit:&lt;BR /&gt;&lt;A href="http://www.hp.com/go/cadvise" target="_blank"&gt;http://www.hp.com/go/cadvise&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Oct 2007 20:04:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088159#M92176</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-18T20:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088160#M92177</link>
      <description>Luk&amp;gt; Thanks for your valuable suggestion, we are looking into that.&lt;BR /&gt;&lt;BR /&gt;Don&amp;gt; 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?.&lt;BR /&gt; Our application is a multiplatform tool, so it requires a architectural change in order to go for 64 bit.&lt;BR /&gt;&lt;BR /&gt;Rick&amp;gt; We are linking with -N option. What would be the difference if we add this as the compiler option?&lt;BR /&gt;&lt;BR /&gt;Dennis&amp;gt; I'm sorry. I forgot to mention about the -N option in the linker options which i already mentioned. Below is some information.&lt;BR /&gt;&lt;BR /&gt;CPPFLAGS = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_HPUX_SOURCE -D_HP_UNIX_ -D_HP_UNIX_ACC_ -D_POSIX_C_SOURCE=199506L&lt;BR /&gt;&lt;BR /&gt;CXXFLAGS = -mt -AA +Z +eh +DAportable -w -Wc,-ansi_for_scope,off&lt;BR /&gt;&lt;BR /&gt;MAKEDEPEND_FLAGS = +M&lt;BR /&gt;&lt;BR /&gt;LDFLAGS = -Wl,+s -b -mt &lt;BR /&gt;&lt;BR /&gt;LINKOPTS = -AA -Wl,-N -Wl,+s +eh -lpthread -lm</description>
      <pubDate>Fri, 19 Oct 2007 05:03:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088160#M92177</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-10-19T05:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088161#M92178</link>
      <description>No, +q3p should have no effect on cpu activity. It only tells VM (that's Virtual Memory not Java Virtual Machine, mind you) to put Q3 in a private space and allow private objects there. From an application point of view, the only difference is higher addresses from MAP_PRIVATE mmap(), malloc(), etc. From a kernel point of view, this is just a matter of the space portion of the Global Virtual Address, the address map (or lack thereof) used for new allocations, etc. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Have you tried attaching a debugger to the application to see where the presumed looping activity is?</description>
      <pubDate>Fri, 19 Oct 2007 06:49:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088161#M92178</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2007-10-19T06:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088162#M92179</link>
      <description>Don&amp;gt; I'm yet to try cadvise suggested by Dennis, i attached the process to wdb and trying to find the loop.&lt;BR /&gt;&lt;BR /&gt;Below is the information of the application taken using chatr.&lt;BR /&gt; normal executable&lt;BR /&gt;          shared library dynamic path search:&lt;BR /&gt;              SHLIB_PATH     enabled   first&lt;BR /&gt;              embedded path  disabled  second Not Defined&lt;BR /&gt;          shared library list:&lt;BR /&gt;              .&lt;BR /&gt;              .&lt;BR /&gt;              . (our application libraries)&lt;BR /&gt;              .&lt;BR /&gt;              .&lt;BR /&gt;              dynamic   /usr/lib/libpthread.1&lt;BR /&gt;              dynamic   /usr/lib/libm.2&lt;BR /&gt;              dynamic   /usr/lib/libstd_v2.2&lt;BR /&gt;              dynamic   /usr/lib/libCsup_v2.2&lt;BR /&gt;              dynamic   /usr/lib/libcl.2&lt;BR /&gt;              dynamic   /usr/lib/libc.2&lt;BR /&gt;              static    /usr/lib/libdld.2&lt;BR /&gt;         shared library binding:&lt;BR /&gt;             deferred&lt;BR /&gt;         global hash table disabled&lt;BR /&gt;         plabel caching disabled&lt;BR /&gt;         global hash array size:1103&lt;BR /&gt;         global hash array nbuckets:3&lt;BR /&gt;         shared vtable support disabled&lt;BR /&gt;         static branch prediction disabled&lt;BR /&gt;         executable from stack: D (default)&lt;BR /&gt;         kernel assisted branch prediction enabled&lt;BR /&gt;         lazy swap allocation disabled&lt;BR /&gt;         text segment locking disabled&lt;BR /&gt;         data segment locking disabled&lt;BR /&gt;         third quadrant private data space disabled&lt;BR /&gt;         fourth quadrant private data space disabled&lt;BR /&gt;         data page size: D (default)&lt;BR /&gt;         instruction page size: D (default)</description>
      <pubDate>Fri, 19 Oct 2007 07:28:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088162#M92179</guid>
      <dc:creator>rymani</dc:creator>
      <dc:date>2007-10-19T07:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create fails with error 12</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088163#M92180</link>
      <description>&amp;gt;Don: 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.&lt;BR /&gt;&lt;BR /&gt;That won't happen in 32 bit mode.  But a signed vs unsigned compare would go wrong.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Don: Have you tried attaching a debugger to the application to see where the presumed looping activity is?&lt;BR /&gt;&lt;BR /&gt;Right, that's a good idea.  You can also try attaching tusc to see if any syscalls are being done.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;i attached the process to wdb and trying to find the loop.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Below is the information of the application taken using chatr.  normal executable&lt;BR /&gt;&lt;BR /&gt;I guess that's EXEC_MAGIC.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;CXXFLAGS = -mt -AA +Z +eh ... -w -Wc,-ansi_for_scope,off&lt;BR /&gt;&lt;BR /&gt;Since +eh is the default, remove it.&lt;BR /&gt;Also, using -w isn't a good idea.  Better to use +W### to suppress specific warnings.&lt;BR /&gt;Any reason you need &lt;BR /&gt;-ansi_for_scope,off?  You should really fix your code.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;LINKOPTS = -AA -Wl,-N -Wl,+s +eh -lpthread -lm&lt;BR /&gt;&lt;BR /&gt;You don't need -lm or +eh.  Also -N is a driver option so you don't need "-Wl,".</description>
      <pubDate>Fri, 19 Oct 2007 16:49:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-create-fails-with-error-12/m-p/4088163#M92180</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-10-19T16:49:04Z</dc:date>
    </item>
  </channel>
</rss>

