Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGsNn-00068X-Pu for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Apr 2019 21:46:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGsNm-0006bK-9i for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Apr 2019 21:46:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGsNl-0006Zs-Sv for pgsql-hackers@lists.postgresql.org; Wed, 17 Apr 2019 21:46:18 +0000 Received: from courriel.mines-paristech.fr ([77.158.173.149] helo=antispam-1.ensmp.fr) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGsNi-0005fY-L9 for pgsql-hackers@lists.postgresql.org; Wed, 17 Apr 2019 21:46:16 +0000 Received: from smtp-4.mines-paristech.fr (smtp-4.ensmp.fr [77.158.173.143]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 25E1355E49; Wed, 17 Apr 2019 23:46:11 +0200 (CEST) Received: from lancre (216.237.219.88.rev.sfr.net [88.219.237.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-4.mines-paristech.fr (Postfix) with ESMTPSA id C62132C006B; Wed, 17 Apr 2019 23:46:10 +0200 (CEST) Date: Wed, 17 Apr 2019 23:46:09 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@lancre To: Tom Lane cc: PostgreSQL Developers Subject: Re: pgsql: Fix unportable code in pgbench. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: 0 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrfeefgdduieefucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffujgfkfhgfgggtsehttdertddtredvnecuhfhrohhmpefhrggsihgvnhcuvefqgffnjffquceotghovghlhhhosegtrhhirdgvnhhsmhhprdhfrheqnecukfhppeekkedrvdduledrvdefjedrvdduieenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Tom, > Fix unportable code in pgbench. Sorry for this unforseen issue... portability is a pain:-( > The buildfarm points out that UINT64_FORMAT might not work with sscanf; > it's calibrated for our printf implementation, which might not agree > with the platform-supplied sscanf. Fall back to just accepting an > unsigned long, which is already more than the documentation promises. Yep, but ISTM that it is down to 32 bits, whereas the PRNG seed expects 48 bits a few lines below: base_random_sequence.xseed[0] = iseed & 0xFFFF; base_random_sequence.xseed[1] = (iseed >> 16) & 0xFFFF; base_random_sequence.xseed[2] = (iseed >> 32) & 0xFFFF; So the third short is now always 0. Hmmm. I'll propose another option over the week-end. -- Fabien.