Home > pthread attr getstacksize example > pthread_attr_setstacksize error code 22

Pthread_attr_setstacksize Error Code 22

Contents

Resolved bugs Rejected bugs Report a new bug This queue is for tickets about the threads CPAN pthread get stack size distribution. Report information The Basics Id: 18419 Status: resolved Priority: pthread_attr_getstacksize example code 0/ Queue: threads People Owner: Nobody in particular Requestors: jdhedden [...] cpan.org Cc: AdminCc: Bug Information pthread_stack_min value Severity: Important Broken in: 1.19 Fixed in: (no value) History Show all quoted text — Show full headers # TueMar2815:45:552006 jdhedden [...] cpan.org - Ticket https://www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.bpxbd00/ptasets.htm created Subject: pthread_attr_setstacksize failures under Linux Download (untitled) / with headers text/plain 2k There have been a number of failed test reports with the following error message: Thread creation failed: pthread_attr_setstacksize(2097152) returned 22 (Note: The error message is descriptive - the actual function call is below). This shows that the https://rt.cpan.org/Ticket/Display.html?id=18419 pthread_attr_setstacksize function was called with the stack size of 2MB (2*1024*1024), and that the function returned EINVAL. The architectures (and failure reports) under which this has been reported so far include: linux lappy 2.4.22 (Perl 5.8.7 with use64bitint=define) http://www.nntp.perl.org/group/perl.cpan.testers/302925 linux penguin 2.4.26 (Perl 5.8.6 and 5.9.3 with use64bitint=define) http://www.nntp.perl.org/group/perl.cpan.testers/302934 http://www.nntp.perl.org/group/perl.cpan.testers/302459 linux promomail 2.4.27-2-386 (Perl 5.8.8 with use64bitint=undef) debian 3.1 stable Checking the source code for the pthread_attr_setstacksize function in glibc shows that the only cause for the EINVAL error code is too small of a stack size: /* Catch invalid sizes. */ if (stacksize < PTHREAD_STACK_MIN) return EINVAL; Usually that minimum is 16K, however, the threads module code checks against whatever PTHREAD_STACK_MIN is set to, so 2MB should be valid. Within the threads module code, stack size is carried as an IV (64-bit int): typedef struct ithread_s { ... IV stack_size; } ithread; IV stack_size; And the call to pthread_a

*attr, size_t stacksize); int pthread_attr_getstacksize(const http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_attr_setstacksize.html pthread_attr_t *attr, size_t *stacksize); DESCRIPTION The https://bugzilla.redhat.com/show_bug.cgi?id=111920 functions pthread_attr_setstacksize() and pthread_attr_getstacksize(), respectively, set and get the thread creation stacksize attribute in the attr object. The stacksize attribute defines the minimum stack size (in pthread_attr_getstacksize example bytes) allocated for the created threads stack. RETURN VALUE Upon successful completion, pthread_attr_setstacksize() and pthread_attr_getstacksize() return a value of 0. Otherwise, an error number is returned to indicate the error. The pthread_attr_getstacksize() pthread_attr_setstacksize error code function stores the stacksize attribute value in stacksize if successful. ERRORS The pthread_attr_setstacksize() function will fail if: [EINVAL] The value of stacksize is less than PTHREAD_STACK_MIN or exceeds a system-imposed limit. These functions will not return an error code of [EINTR]. EXAMPLES None. APPLICATION USAGE None. FUTURE DIRECTIONS None. SEE ALSO pthread_attr_init(), pthread_attr_setstackaddr(), pthread_attr_setdetachstate(), pthread_create(), , . DERIVATION Derived from the POSIX Threads Extension (1003.1c-1995) UNIX is a registered Trademark of The Open Group. Copyright © 1997 The Open Group [ Main Index | XSH | XCU | XBD | XCURSES | XNS ]

-Clone This Bug -Last Comment First Last Prev Next This bug is not in your last search results. Bug111920 - pthread_attr_setstacksize failure. Summary: pthread_attr_setstacksize failure. Status: CLOSED NOTABUG Aliases: None Product: Red Hat Enterprise Linux 3 Classification: Red Hat Component: glibc (Show other bugs) Sub Component: --- Version: 3.0 Hardware: ia64 Linux Priority medium Severity high TargetMilestone: --- TargetRelease: --- Assigned To: Jakub Jelinek QA Contact: Brian Brock Docs Contact: URL: Whiteboard: Keywords: Depends On: Blocks: Show dependency tree /graph Reported: 2003-12-11 11:27 EST by Brett Johnson Modified: 2007-11-30 17:06 EST (History) CC List: 2 users (show) charline.polifka tao See Also: Fixed In Version: Doc Type: Bug Fix Doc Text: Story Points: --- Clone Of: Environment: Last Closed: 2003-12-14 14:27:48 EST Type: --- Regression: --- Mount Type: --- Documentation: --- CRM: Verified Versions: Category: --- oVirt Team: --- RHEL 7.3 requirements from Atomic Host: Cloudforms Team: --- Attachments (Terms of Use) Program to reproduce the problem (677 bytes, text/plain) 2003-12-11 11:28 EST, Brett Johnson no flags Details Add an attachment (proposed patch, testcase, etc.) Groups: None (edit) Description Brett Johnson 2003-12-11 11:27:16 EST Description of problem: When the attached program is compiled and run on rhel3, it fails with a "Error on pthread_attr_setstacksize: 22". If it is compiled on another platform (i.e. debian or SuSe), it runs fine on that platform, and on rhel3. If the executable is compiled on rhel3, and executed on any other platform, it fails with "./stacksize: /lib/libpthread.so.0: version `GLIBC_2.3.3' not found (required by ./stacksize)" (Even though the rhel3 version of glibc reported by rpm is 2.3.2). Version-Release number of selected component (if applicable): 2.3.2 or 2.3.3, it's not clear what version rhel3 ships... How re

 

Related content

pthread_attr_setstacksize error

Pthread attr setstacksize Error table id toc tbody tr td div id toctitle Contents div ul li a href Pthread attr getstacksize Example a li li a href Pthread attr getstacksize Example Code a li li a href Pthread Get Stack Size a li ul td tr tbody table p ManualREAD ATTR SETSTACKSIZE NAME relatedl top pthread attr setstacksize pthread attr setstacksize example pthread attr getstacksize - set get stack size attribute in thread attributes pthread stack min object SYNOPSIS top include pthread h int pthread attr setstacksize pthread attr t attr size t pthread attr getstacksize stacksize int pthread