Re: clang/llvm 3.9.0 mysteriously zeroing variables?

2016-12-20 Thread Jakub Palider
Hi,

do you still observe this behaviour? Which type of EC2 instances were
affected?
I tried to reproduce with kernel/tools from Dec 15 and did not manage to
crash the machine.

Jakub

On Sun, Dec 4, 2016 at 5:38 PM, Dimitry Andric  wrote:

> On 04 Dec 2016, at 10:52, Hans Petter Selasky  wrote:
> >
> > 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?
>
> I don't see anything in the generated code for the call that can cause
> this, except for sector_size really being zero, or the result of
> 1048576/sector_size being zero.
>
> On i386, you get this:
>
> .loc1 1349 19   # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:19
> movl-56(%ebp), %ecx # -56(%rbp) = sectors
> .Ltmp1148:
> #DEBUG_VALUE: xbd_connect:sectors <- %ECX
> .loc1 1349 38 is_stmt 0 # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:38
> movl$1048576, %eax  # imm = 0x10
> xorl%edx, %edx
> divl-52(%ebp)   # -52(%ebp) = sector_size
> movl%eax, %edi
> .loc1 1349 27   # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:27
> xorl%edx, %edx
> movl%ecx, %eax
> divl%edi
> movl%eax, -32(%ebp) # 4-byte Spill
>
> On amd64, it looks pretty similar:
>
> .loc1 1349 19   # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:19
> movq-112(%rbp), %rcx# -112(%rbp) = sectors
> .Ltmp1128:
> #DEBUG_VALUE: xbd_connect:sectors <- %RCX
> .loc1 1349 38 is_stmt 0 # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:38
> movl$1048576, %eax  # imm = 0x10
> xorl%edx, %edx
> divq-88(%rbp)   # -88(%rbp) = sector_size
> movq%rax, %rsi
> .loc1 1349 27   # /usr/src/sys/dev/xen/blkfront/
> blkfront.c:1349:27
> xorl%edx, %edx
> movq%rcx, %rax
> divq%rsi
> movq%rax, %r15
>
> Colin, does it panic for you in the first or the second div?
>
> -Dimitry
>
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Clang 3.6.0 for ARMv7 failure

2015-03-18 Thread Jakub Palider
Hi,

every couple of days I rebase to the head of the -current and this time
I encountered a problem during toolchain build related probably to the
recent compiler changes. As I am mainly interested in building kernel I
just switched to kernel-toolchain which worked fine for me, but anyway,
this looks like a wider problem. Maybe I am missing some transition
option - previous builds were fine - if so I would be happy to hear any
pointers to fix it locally.

Below is the error report.

Thank you,
Jakub Palider

Unexpected member type for HA
UNREACHABLE executed
at 
/root/jpa/anpa-fbsd/lib/clang/libllvmarmcodegen/../../../contrib/llvm/lib/Target/ARM/ARMCallingConv.h:209!


Stack dump:
0.  Program
arguments: /home/jpa/anpa-build/arm.arm/root/jpa/anpa-fbsd/tmp/usr/bin/cc -cc1 
-triple armv6--freebsd11.0-gnueabi -emit-obj -disable-free -main-file-name 
b_tgamma.c -mrelocation-model pic -pic-level 1 -mthread-model posix 
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu arm1176jzf-s 
-target-feature +soft-float -target-feature +soft-float-abi -target-feature 
-neon -target-feature -crypto -target-abi aapcs-linux -msoft-float -mfloat-abi 
soft -dwarf-column-info -coverage-file 
/home/jpa/anpa-build/arm.arm/root/jpa/anpa-fbsd/lib/msun/b_tgamma.So 
-resource-dir 
/home/jpa/anpa-build/arm.arm/root/jpa/anpa-fbsd/tmp/usr/bin/../lib/clang/3.6.0 
-D PIC -D ARM_ARCH_6=1 -I /home/jpa/anpa-fbsd/lib/msun/src -I 
/home/jpa/anpa-fbsd/lib/msun/../libc/include -I 
/home/jpa/anpa-fbsd/lib/msun/../libc/arm -isysroot 
/home/jpa/anpa-build/arm.arm/root/jpa/anpa-fbsd/tmp -O2 -Wsystem-headers 
-Werror -Wno-pointer-sign -Wno-unknown-pragmas -Wno-empty-body 
-Wno-string-plus-int -Wno-unused-const-varia
 ble -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality 
-Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch 
-Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -std=gnu99 
-fdebug-compilation-dir 
/home/jpa/anpa-build/arm.arm/root/jpa/anpa-fbsd/lib/msun -ferror-limit 19 
-fmessage-length 0 -mstackrealign -fno-signed-char -fobjc-runtime=gnustep 
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o b_tgamma.So -x c 
/home/jpa/anpa-fbsd/lib/msun/bsdsrc/b_tgamma.c 




___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org