public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Incorrect change to generic_morestack.c:__morestack_load_mmap()?
@ 2019-01-30 18:01 Paul Smith
  0 siblings, 0 replies; only message in thread
From: Paul Smith @ 2019-01-30 18:01 UTC (permalink / raw)
  To: gcc

I was looking through the diffs between GCC 8.1.0 and GCC 8.2.0 and saw
this change, which doesn't look right to me: it changes munmap() to use
the new static_pagesize variable, but that variable is not assigned
until after it's used.  Since it's global it's always 0, so this code
runs munmap(0, 0) which doesn't seem too useful to me.

I checked and the current SVN trunk still has this change as-is.



@@ -825,7 +811,12 @@
      TLS accessor function is resolved.  */
   mmap (__morestack_current_segment, 0, PROT_READ, MAP_ANONYMOUS, -1, 0);
   mprotect (NULL, 0, 0);
-  munmap (0, getpagesize ());
+  munmap (0, static_pagesize);
+
+  /* Initialize these values here, so as to avoid dynamic linker
+     activity as part of a __morestack call. */
+  static_pagesize = getpagesize();
+  use_guard_page = getenv ("SPLIT_STACK_GUARD") != 0;
 }

 /* This function may be used to iterate over the stack segments.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-30 18:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 18:01 Incorrect change to generic_morestack.c:__morestack_load_mmap()? Paul Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).