mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Fix stack memory, undefined behavior, etc.
This commit is contained in:
parent
110559ce6a
commit
507d7a0b0b
11 changed files with 41 additions and 186 deletions
|
@ -127,7 +127,7 @@ TEST(pthread_create, testBigStack) {
|
|||
}
|
||||
|
||||
static void *CheckStack2(void *arg) {
|
||||
char buf[57244];
|
||||
char buf[262144 - 32768 * 2];
|
||||
TriggerSignal();
|
||||
CheckLargeStackAllocation(buf, sizeof(buf));
|
||||
return 0;
|
||||
|
@ -137,8 +137,8 @@ TEST(pthread_create, testBiggerGuardSize) {
|
|||
pthread_t id;
|
||||
pthread_attr_t attr;
|
||||
ASSERT_EQ(0, pthread_attr_init(&attr));
|
||||
ASSERT_EQ(0, pthread_attr_setstacksize(&attr, 65536));
|
||||
ASSERT_EQ(0, pthread_attr_setguardsize(&attr, 8192));
|
||||
ASSERT_EQ(0, pthread_attr_setstacksize(&attr, 262144));
|
||||
ASSERT_EQ(0, pthread_attr_setguardsize(&attr, 32768));
|
||||
ASSERT_EQ(0, pthread_create(&id, &attr, CheckStack2, 0));
|
||||
ASSERT_EQ(0, pthread_attr_destroy(&attr));
|
||||
ASSERT_EQ(0, pthread_join(id, 0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue