Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2016 10:52:23 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Colin Percival <cperciva@tarsnap.com>, freebsd-current@freebsd.org
Subject:   Re: clang/llvm 3.9.0 mysteriously zeroing variables?
Message-ID:  <e0646eb8-d793-1ffb-bd12-febbce86a4f8@selasky.org>
In-Reply-To: <01000158c7252f0c-6c3198b0-fbef-4a60-ade9-e3b91d9e83bd-000000@email.amazonses.com>
References:  <01000158c7252f0c-6c3198b0-fbef-4a60-ade9-e3b91d9e83bd-000000@email.amazonses.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/04/16 01:04, Colin Percival wrote:
> Starting with r309124 (when clang/llvm 3.9.0 was imported) I'm seeing EC2
> instances panic on boot with a division-by-zero error; the code in question
> is in blkfront.c, printing out the size of disks:
>
>> 		device_printf(dev, "%juMB <%s> at %s",
>> 		    (uintmax_t) sectors / (1048576 / sector_size),
>> 		    device_get_desc(dev),
>> 		    xenbus_get_node(dev));
>
> My first thought was that 'sector_size' must be either zero or very large...
> but no, when I add printf("sector_size = %ju\n", (uintmax_t)sector_size), it's
> entirely normal.  What's more, adding that printf makes the division-by-zero
> panic go away.
>
> I'd think I was just hallucinating, but earlier today I heard that a similarly
> "impossible" panic had been observed in the NFS client code when compiled with
> clang/llvm 3.9.0.
>
> So... is anyone else seeing unexpected panics or other odd behaviour starting
> after clang/llvm 3.9.0 was imported?
>

Hi,

Can you look at the code with "objdump -Dx --source" and see what is 
going on there? Might it be the "sector" variable is shadowed?

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e0646eb8-d793-1ffb-bd12-febbce86a4f8>