LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do i increase pthread stack size (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-increase-pthread-stack-size-411930/)

redwing26 02-05-2006 01:57 PM

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:

redwing26 02-05-2006 05:05 PM

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

foo_bar_foo 02-05-2006 07:51 PM

http://blog.vegebyte.co.uk/archive/c...ck-size-error/

redwing26 02-05-2006 08:23 PM

im submitting my make.conf and the article im reading in just a sec :-)

redwing26 02-05-2006 08:26 PM

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

redwing26 02-06-2006 04:12 PM

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

foo_bar_foo 02-06-2006 11:41 PM

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

redwing26 02-08-2006 11:07 AM

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


All times are GMT -5. The time now is 04:37 PM.