|
From: Tom H. <th...@cy...> - 2004-11-16 19:44:08
|
CVS commit by thughes:
The calculation used to round the size of a new thread's stack to a
multiple of the page size had an off by one error. Fixed it to use
the PGROUNDUP macro instead of trying to do the calculation itself
and then get it wrong.
MERGE TO STABLE
A none/tests/pth_stackalign.c 1.1.2.1 [POSSIBLY UNSAFE: printf] [no copyright]
A none/tests/pth_stackalign.stderr.exp 1.1.2.1
A none/tests/pth_stackalign.stdout.exp 1.1.2.1
A none/tests/pth_stackalign.vgtest 1.1.2.1
M +1 -2 coregrind/vg_scheduler.c 1.171.2.3
M +1 -0 none/tests/.cvsignore 1.18.2.1
M +6 -2 none/tests/Makefile.am 1.43.2.1
--- valgrind/coregrind/vg_scheduler.c #1.171.2.2:1.171.2.3
@@ -1954,6 +1954,5 @@ void do__apply_in_new_thread ( ThreadId
/* Consider allocating the child a stack, if the one it already has
is inadequate. */
- new_stk_szb = si->size + VG_AR_CLIENT_STACKBASE_REDZONE_SZB + si->guardsize;
- new_stk_szb = (new_stk_szb + VKI_BYTES_PER_PAGE - 1) & ~VKI_BYTES_PER_PAGE;
+ new_stk_szb = PGROUNDUP(si->size + VG_AR_CLIENT_STACKBASE_REDZONE_SZB + si->guardsize);
VG_(threads)[tid].stack_guard_size = si->guardsize;
--- valgrind/none/tests/.cvsignore #1.18:1.18.2.1
@@ -40,4 +40,5 @@
pluto
pth_blockedsig
+pth_stackalign
rcl_assert
rcrl
--- valgrind/none/tests/Makefile.am #1.43:1.43.2.1
@@ -47,4 +47,6 @@
pth_blockedsig.stderr.exp \
pth_blockedsig.stdout.exp pth_blockedsig.vgtest \
+ pth_stackalign.stderr.exp \
+ pth_stackalign.stdout.exp pth_stackalign.vgtest \
pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \
rcl_assert.stderr.exp rcl_assert.vgtest \
@@ -75,6 +77,6 @@
int munmap_exe map_unmap mq mremap rcl_assert rcrl readline1 \
resolv rlimit_nofile seg_override sem semlimit sha1_test \
- shortpush shorts smc1 susphello pth_blockedsig pushpopseg \
- syscall-restart1 syscall-restart2 system \
+ shortpush shorts smc1 susphello pth_blockedsig pth_stackalign \
+ pushpopseg syscall-restart1 syscall-restart2 system \
coolo_sigaction gxx304 yield
@@ -156,4 +158,6 @@
pth_blockedsig_SOURCES = pth_blockedsig.c
pth_blockedsig_LDADD = -lpthread
+pth_stackalign_SOURCES = pth_stackalign.c
+pth_stackalign_LDADD = -lpthread
# generic C++ ones
|