LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 02-05-2006, 02:57 PM   #1
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Rep: Reputation: 0
Wink how do i increase pthread stack size


Hi I am running gentoo ........uname -a shows:

Linux tux 2.6.15-gentoo-r1 #3 SMP PREEMPT Sat Feb 4 21:57:23 GMT 2006 i686 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux

Anyway I try to run some cedega games and it says:

Your system requires the use of pthreads but the maximum system allowed stack size of 2052 kB may be too small for some games.
If you experience problems, try rerunning with "-use-pthreads no" which may help

How do I increase my stack size? I have tried recompiling glibc .....my make.conf is as follows:

CFLAGS="-Os -mcpu=i686 -pipe"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
USE="cdr dvd dvdr dvdread hal nptl nptlonly -gnome -ipv6"

but after i re-emerge glib by doing the following:

omitfp -hardened -linuxthreads-tls (-multilib) +nls +nptl +nptlonly -pic -profile (-selinux) +userlocales 0 kB

Total size of downloads: 0 kB


then

emerge --oneshot glibc

It appears to work but then I get the same error im really stuck with this can anyone tell me how I can increase the pthread stack size on gentoo

Thanks
David

also if I do:

/lib/libc.so.6

Compiled by GNU CC version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1).
Compiled on a Linux 2.6.11 system on 2006-02-05.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
The C stubs add-on version 2.1.2.
GNU Libidn by Simon Josefsson
BIND-8.2.3-T5B
libthread_db work sponsored by Alpha Processor Inc
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
For bug reporting instructions, please see:
 
Old 02-05-2006, 06:05 PM   #2
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Original Poster
Rep: Reputation: 0
hmm I just went on some irc chat room and some guy told me to do make menuconfig /stack ......sounded like bs have do any of you no how I can increase my pthread stack size??? there is nothing on this on the web execpt re emerging glibc which does not work
 
Old 02-05-2006, 08:51 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
http://blog.vegebyte.co.uk/archive/c...ck-size-error/
 
Old 02-05-2006, 09:23 PM   #4
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Original Poster
Rep: Reputation: 0
im submitting my make.conf and the article im reading in just a sec :-)
 
Old 02-05-2006, 09:26 PM   #5
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Original Poster
Rep: Reputation: 0
ty

thanks foo bar .....I did however already ...read that page .....the link the guy provides leads to a unnofficial transgaming page with a few articles on pthreads .....one was to simply re-emerge glibc and update make.conf .......I did that and it didnt work ....however I found another article which im trying .....heres my make.conf do you think its okay?

CFLAGS="-Os -mcpu=i686 -pipe"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="cdr dvd dvdr dvdread hal nptl nptlonly -gnome -ipv6"
#PORTAGE_BINHOST="http://chinstrap.alternating.net/files/2005.1/grp/i686"
PORTDIR_OVERLAY=/usr/local/portage
#PORTAGE_BINHOST="file://localhost/mnt/cdrom/All"
#PKGDIR="/mnt/cdrom/"
ACCEPT_KEYWORDS="~x86"

GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/ http://ftp.club-internet.fr/pub/mirrors/gentoo http://ftp.heanet.ie/pub/gentoo/ "

also heres the article im working of that I am in the process of trying

http://gentoo-wiki.com/HOWTO_Migrate_to_NPTL

this article says to do

emerge newuse world

the one I wanted to do was a simple

emerge glibc but it didnt work ......do you think im on the right track with the above link

thanks for the help
david
 
Old 02-06-2006, 05:12 PM   #6
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Hi ive figured I have pthreads foobar but the default size is way to small for cedega ....there are 2MB how to I make the default pthread stack size bigger ?

I was looking at one of your c programs for setting stack size and I did the following

#include <pthread.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
size_t stacksize;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_getstacksize (&attr, &stacksize);

printf("Default stack size = %d\n", stacksize);
stacksize=3026;
pthread_attr_setstacksize(&attr,stacksize);
printf("Default stack size = %d\n is now: ", stacksize);
}


actually REPHRASE that ......YOU did the following :-) ..... anyway Im figuring that sets a threads stack size but only within that program hehe how could I alter the default stack size globally?

so cedega will work

David
 
Old 02-07-2006, 12:41 AM   #7
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
your kidding
i don't remember doin that
i aughta get a job !
i don't know how to speak gentoo sorry

anyway
what do you get from and show output from
ulimit -s
and
run the command
/lib/libc.so.6
does it say Native POSIX Threads Library ?
and
getconf GNU_LIBPTHREAD_VERSION
should give NPTL version

what does that program above say about your default stack size
it should be 8388608 bytes = 8 megabytes for NPTL
not 2 !
ulimit -s should return
8192

you not running a very old kernel are you ?
since we are doing c what does this show ?
Code:
#include <stdio.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
int size = getpagesize ();
printf("Pagesize = %d\n", size);
}
it should be 4096
i think NPTL by default uses pagesize * 2
(one page plus a guard page) i thnk
 
Old 02-08-2006, 12:07 PM   #8
redwing26
LQ Newbie
 
Registered: Feb 2006
Posts: 13

Original Poster
Rep: Reputation: 0
hehe thanks for your input .....I have now got my stack sizee fixed and /lib/libc.so.6 shows


GNU C Library stable release version 2.3.6, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8).
Compiled on a Linux 2.6.11 system on 2006-02-06.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
Native POSIX Threads Library by Ulrich Drepper et al
The C stubs add-on version 2.1.2.
GNU Libidn by Simon Josefsson
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

It turns out I had correctly re-emerged glibc and set the USE flags nptl and nptlonly but my CHOST var in my make.conf was = i386 so It didnt compile nptl for that architecture ......the thing is once I looked on one of the sites notes sections it did mention that ,......when I updated my CHOST to i686 it installed nptl and I now have a stack size that cedega doesnt complain about :-)

Thanks
David
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 - new stack size? DJOtaku Fedora 2 10-07-2005 01:22 PM
How do you increase a kernel stack size? ginda Linux - Newbie 4 01-24-2005 07:52 PM
Stack size decision atul_mehrotra Programming 2 10-08-2004 05:32 AM
Stack Size Decision atul_mehrotra Linux - General 0 10-07-2004 02:01 AM
increase point size size when printing PDF files newlin Red Hat 0 09-27-2003 08:13 AM


All times are GMT -5. The time now is 06:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration