Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqaM1-007GPD-4F for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Mar 2025 16:15:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tqaLz-00AFvU-Ib for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Mar 2025 16:15:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqaLz-00AFvL-8j for pgsql-hackers@lists.postgresql.org; Fri, 07 Mar 2025 16:15:15 +0000 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqaLv-001Wly-2V for pgsql-hackers@postgresql.org; Fri, 07 Mar 2025 16:15:14 +0000 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3d4469b35e4so3817805ab.1 for ; Fri, 07 Mar 2025 08:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741364111; x=1741968911; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EQ0tS2TCBP0D8iXrI+TltkZ2cSb3/3oe2RR2Uq3uBaE=; b=BRt3/ktN7wCYN430phtmR+oy59TMqKwRXnkQ8AKO0+fobwjeQmbntttnFYg/5gwl6l QP17mOloVtBxaSZLzm8j4yi3gJq8xYax2mVdv79KzvI2amfjjGcnw0TedHUM7a5ISaKC IEBAEeQrbjXBw2LsnbxdG1JfAv85OFLOzLrAvDu0caJCiKfYJ2xIsvffV2UgdTFX+HVZ 8qRpHd35TC1JpV6v4ez7bi01T4ZEheKtV7DBJ/RXmAIUyMR8cJzblffrsYtENdw6IVIl uRgvPs6LqRp/2dd3WNRADcgJxgu4FB8nDC4aznFt70UyePMgfnTq9T7PyGT1aEuaIoOQ 2roA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741364111; x=1741968911; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EQ0tS2TCBP0D8iXrI+TltkZ2cSb3/3oe2RR2Uq3uBaE=; b=je9Olvc8dXmO71t7CTLfzEU/DEDg3jfvcIzBUllO8sPxWNm7nGruL981AK1UaF4d/v XhPH3woSkHx1ncuF4Un3KAfOtBZj5YE6mJ2T613yLpOFFwhV8lbkRcTMbCpXgqcDdUIg 6IzklrRgu8t8yq9NSgePsGG+PG4ZO3zrN5ClZ1scY307w/PgeadFuY602xKaotoYoz6y Ikg/W0QKgP+gGCoVY1PX4DWMXyASeuvf1dLXt//yFmN7SK2j7Udc1AqYSInUsWSWxoZ/ LhjC41F1rEHmNF6n15EYalWFrAwO1mW9teMIxKP00GlJ4+hB5/mxmaQkZsBDRiPeYj4E cjmQ== X-Gm-Message-State: AOJu0YycixBtTP6GxfEM70pR/DjYpALcBCdpaWxSVf1SRHFeRXqBMx7J hz0QCWUaafzlf17kya4cVSnD8gtJQJo6x1inXjt/QirMvenLpGffCtBYPg== X-Gm-Gg: ASbGncsTqjMbNVDECy4aMjOyav5Ab0InJ5MD9ZjCLb/0RTms97gPDMZHVLtg66WX/vK 0V15oGbTpxitgooYvgxmS/DFWqwlDYNhvD9VWJ/pll3226U+bzSqqO9TdqUoRQ4PhhWLKXRCts0 l24CdAoy7O0e5G2ATm2H2/KugMAeBmCkKE48olCrKLvle32NeSN8s5NkwgCT5k74062IFW0pgcB 0H9GSb6mrBoAxpBvuouxSBMlBNicH7JJLuUTV9xQxlXy05jw5WRDje/HilGR2A/gUJwFBEAd+oe JaOn9OI0wevjgkDFbFC5zAPhNWWDKYKpPSJ1rqzH/Ee3K5Z8LYvb7G5Z1IsfmeV+SlQJ7m+x06E cqSKyJlP2VdcYmR4e+hWYLRvF7FHunzoJLew= X-Google-Smtp-Source: AGHT+IEyeFbzi9iTRwVyyvwRKBRzzhiZujbv4FqoQOEO/HnPHPVyPBLUQ9GOyPiFf+pRZCa3LAk9XQ== X-Received: by 2002:a05:6e02:240b:b0:3cf:fe21:af8 with SMTP id e9e14a558f8ab-3d44192f632mr50693925ab.4.1741364110881; Fri, 07 Mar 2025 08:15:10 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3d43b512e6fsm8841505ab.38.2025.03.07.08.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 08:15:10 -0800 (PST) Date: Fri, 7 Mar 2025 10:15:08 -0600 From: Nathan Bossart To: Tomas Vondra Cc: PostgreSQL Hackers Subject: Re: strange valgrind reports about wrapper_handler on 64-bit arm Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 07, 2025 at 12:03:47AM +0100, Tomas Vondra wrote: > while running check-world on 64-bit arm (rpi5 with Debian 12.9), I got a > couple reports like this: > > ==64550== Use of uninitialised value of size 8 > ==64550== at 0xA62FE0: wrapper_handler (pqsignal.c:107) > ==64550== by 0x580BB9E7: ??? (in > /usr/libexec/valgrind/memcheck-arm64-linux) > ==64550== Uninitialised value was created by a stack allocation > ==64550== at 0x4F94660: strcoll_l (strcoll_l.c:258) > ==64550== > { > > Memcheck:Value8 > fun:wrapper_handler > obj:/usr/libexec/valgrind/memcheck-arm64-linux > } > **64550** Valgrind detected 1 error(s) during execution of "ANALYZE > mcv_lists;" > > The exact command varies, I don't think it's necessarily about analyze > or extended stats. > > The line the report refers to is this: > > (*pqsignal_handlers[postgres_signal_arg]) (postgres_signal_arg); > > so I guess it can't be about postgres_signal_arg (as that's an int). But > that leaves just pqsignal_handlers, and why would that be uninitialized? > > The closest thing I found in archives is [1] from about a year ago, but > we haven't found any clear explanation there either :-( Hm. The pointer to strcoll_l makes me wonder if there might be an issue in one of the handler functions that wrapper_handler calls, and wrapper_handler is getting the blame. I don't see how pqsignal_handlers could be uninitialized. It's static, and we are careful to set it appropriately before we call sigaction(). -- nathan