|
From: Tom H. <th...@cy...> - 2004-11-16 19:40:12
|
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.
BUG: 93309
A none/tests/pth_stackalign.c 1.1 [POSSIBLY UNSAFE: printf] [no copyright]
A none/tests/pth_stackalign.stderr.exp 1.1
A none/tests/pth_stackalign.stdout.exp 1.1
A none/tests/pth_stackalign.vgtest 1.1
M +2 -3 coregrind/vg_scheduler.c 1.201
M +1 -0 none/tests/.cvsignore 1.22
M +5 -1 none/tests/Makefile.am 1.51
--- valgrind/coregrind/vg_scheduler.c #1.200:1.201
@@ -1813,6 +1813,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_PAGE_SIZE - 1) & ~VKI_PAGE_SIZE;
+ 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.21:1.22
@@ -34,4 +34,5 @@
pluto
pth_blockedsig
+pth_stackalign
rcrl
readline1
--- valgrind/none/tests/Makefile.am #1.50:1.51
@@ -33,4 +33,6 @@
pth_blockedsig.stderr.exp \
pth_blockedsig.stdout.exp pth_blockedsig.vgtest \
+ pth_stackalign.stderr.exp \
+ pth_stackalign.stdout.exp pth_stackalign.vgtest \
rcrl.stderr.exp rcrl.stdout.exp rcrl.vgtest \
readline1.stderr.exp readline1.stdout.exp \
@@ -57,5 +59,5 @@
munmap_exe map_unmap mq mremap rcrl readline1 \
resolv rlimit_nofile sem semlimit sha1_test \
- shortpush shorts smc1 susphello pth_blockedsig \
+ shortpush shorts smc1 susphello pth_blockedsig pth_stackalign \
syscall-restart1 syscall-restart2 system \
coolo_sigaction gxx304 yield
@@ -116,4 +118,6 @@
pth_blockedsig_SOURCES = pth_blockedsig.c
pth_blockedsig_LDADD = -lpthread
+pth_stackalign_SOURCES = pth_stackalign.c
+pth_stackalign_LDADD = -lpthread
# generic C++ ones
|