]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Init the per-thread sigaltstacks properly. New threads should always
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Tue, 16 Mar 2004 22:07:12 +0000 (22:07 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Tue, 16 Mar 2004 22:07:12 +0000 (22:07 +0000)
appear without a sigaltstack.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2331

coregrind/vg_scheduler.c
coregrind/vg_signals.c

index dd604da8c4f6544921cb84fe1014d871178027d9..0ec739c4c3de15dfcef4ef3bae8b3a49ff06167e 100644 (file)
@@ -574,6 +574,11 @@ void mostly_clear_thread_record ( ThreadId tid )
    VG_(threads)[tid].sys_pre_res         = NULL;
 
    VG_(threads)[tid].proxy               = NULL;
+
+   /* start with no altstack */
+   VG_(threads)[tid].altstack.ss_sp = (void *)0xdeadbeef;
+   VG_(threads)[tid].altstack.ss_size = 0;
+   VG_(threads)[tid].altstack.ss_flags = VKI_SS_DISABLE;
 }
 
 
index 08a355febaf9e341b49122aaf9cf0f03693c7fd6..b178bebc7b4207fef6dd2da6994255fc38e9988e 100644 (file)
@@ -2391,10 +2391,6 @@ void VG_(sigstartup_actions) ( void )
    vg_scss.scss_per_sig[VKI_SIGVGKILL].scss_flags = VKI_SA_SIGINFO;
    VG_(ksigfillset)(&vg_scss.scss_per_sig[VKI_SIGVGKILL].scss_mask);
 
-   /* Copy the alt stack, if any. */
-   ret = VG_(ksigaltstack)(NULL, &VG_(threads)[1].altstack);
-   vg_assert(ret == 0);
-
    /* Copy the process' signal mask into the root thread. */
    vg_assert(VG_(threads)[1].status == VgTs_Runnable);
    VG_(threads)[1].sig_mask = saved_procmask;