public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix possible uninitialized ATCB component use
@ 2020-12-16 13:15 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-12-16 13:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: Philippe Gil

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

When System.Memory implementation is using Debug_Pools, Common ATCB's
uninitialized Global_Task_Lock_Nesting component may be used.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* libgnarl/s-tporft.adb (Register_Foreign_Thread): Set
	Global_Task_Lock_Nesting before using allocator.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 429 bytes --]

diff --git a/gcc/ada/libgnarl/s-tporft.adb b/gcc/ada/libgnarl/s-tporft.adb
--- a/gcc/ada/libgnarl/s-tporft.adb
+++ b/gcc/ada/libgnarl/s-tporft.adb
@@ -53,6 +53,7 @@ begin
 
    Local_ATCB.Common.LL.Thread := Thread;
    Local_ATCB.Common.Current_Priority := System.Priority'First;
+   Local_ATCB.Common.Global_Task_Lock_Nesting := 0;
    Specific.Set (Local_ATCB'Unchecked_Access);
 
    --  It is now safe to use an allocator



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

only message in thread, other threads:[~2020-12-16 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:15 [Ada] Fix possible uninitialized ATCB component use Pierre-Marie de Rodat

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).