On Mon, May 19, 2014 at 10:25 AM, Dave Cheney <[email protected]> wrote:
> On Mon, May 19, 2014 at 4:12 PM, Dmitry Vyukov <[email protected]> wrote:
>> On Mon, May 19, 2014 at 10:02 AM, Dave Cheney <[email protected]> wrote:
>>> Hi Dmitry,
>>>
>>> I've been experimenting with gosmith on arm and the results are, um, 
>>> explosive
>>>
>>> panda(/tmp) % bash gosmith.bash
>>> + true
>>> + gosmith -seed=24701
>>> + /home/dfc/go/pkg/tool/linux_arm/5g out.go
>>> out.go:16: internal compiler error: walkexpr ORECV
>>> panda(/tmp) %
>>> panda(/tmp) % bash gosmith.bash
>>> + true
>>> + gosmith -seed=29032
>>> + /home/dfc/go/pkg/tool/linux_arm/5g out.go
>>> out.go:10: internal compiler error: walkexpr ORECV
>>> panda(/tmp) % bash gosmith.bash
>>> + true
>>> + gosmith -seed=4404
>>> + /home/dfc/go/pkg/tool/linux_arm/5g out.go
>>> out.go:7: internal compiler error: walkexpr ORECV
>>> panda(/tmp) % bash gosmith.bash
>>> + true
>>> + gosmith -seed=22357
>>> + /home/dfc/go/pkg/tool/linux_arm/5g out.go
>>> out.go:10: internal compiler error: walkexpr ORECV
>>>
>>> Do you know how to disable the internal compiler error handler so I
>>> can run 5g under gdb and see if I can find out what is going on.
>>
>> If you just run under gdb, it must handle SIGSEGV first (even if
>> program installs own handler).
>
> Doesn't appear to work like that on arm, I'm very confused
>
>  % gdb --args /home/dfc/go/pkg/tool/linux_arm/5g out.go
> GNU gdb (GDB) 7.6.2 (Debian 7.6.2-1)
> Copyright (C) 2013 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-linux-gnueabihf".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/dfc/go/pkg/tool/linux_arm/5g...done.
> (gdb) r
> Starting program: /home/dfc/go/pkg/tool/linux_arm/5g out.go
> out.go:10: internal compiler error: walkexpr ORECV
> [Inferior 1 (process 32368) exited with code 01]
>
>>> I've also tried building the stdlib with asan but either there is a
>>> bug in 5c that triggers an asan alert, or asan doesn't work properly
>>> on arm so I haven't been able to build a working asan enabled standard
>>> library on arm yet.
>>
>> ARM is not as well tested as Intel64, but it works for us in some 
>> environments.
>> What is the alert?
>
> % env CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fno-common
> -O0 -g" bash ./make.bash
> # Building C bootstrap tool.
> cmd/dist
>
> # Building compilers and Go bootstrap tool for host, linux/arm.
> lib9
> libbio
> liblink
> misc/pprof
> cmd/cc
> cmd/gc
> cmd/5l
> cmd/5a
> cmd/5c
> cmd/5g
> pkg/runtime
> =================================================================
> ==610== ERROR: AddressSanitizer: unknown-crash on address 0xbeeb7d78
> at pc 0xb592ac7d bp 0xbeeb78c8 sp 0xbeeb78c8
> WRITE of size 72 at 0xbeeb7d78 thread T0
>     #0 0xb592ac7b (/usr/lib/arm-linux-gnueabihf/libasan.so.0.0.0+0xac7b)
>     #1 0x2fd39 (/home/dfc/go/pkg/tool/linux_arm/5c+0x2fd39)
>     #2 0x30429 (/home/dfc/go/pkg/tool/linux_arm/5c+0x30429)
>     #3 0x12c4b (/home/dfc/go/pkg/tool/linux_arm/5c+0x12c4b)
>     #4 0xcdf7 (/home/dfc/go/pkg/tool/linux_arm/5c+0xcdf7)
>     #5 0xbf79 (/home/dfc/go/pkg/tool/linux_arm/5c+0xbf79)
>     #6 0xa497 (/home/dfc/go/pkg/tool/linux_arm/5c+0xa497)
>     #7 0xc56b (/home/dfc/go/pkg/tool/linux_arm/5c+0xc56b)
>     #8 0xa497 (/home/dfc/go/pkg/tool/linux_arm/5c+0xa497)
>     #9 0x9c19 (/home/dfc/go/pkg/tool/linux_arm/5c+0x9c19)
>     #10 0x75935 (/home/dfc/go/pkg/tool/linux_arm/5c+0x75935)
>     #11 0x57f57 (/home/dfc/go/pkg/tool/linux_arm/5c+0x57f57)
>     #12 0x56b95 (/home/dfc/go/pkg/tool/linux_arm/5c+0x56b95)
>     #13 0xc5bbb (/home/dfc/go/pkg/tool/linux_arm/5c+0xc5bbb)
>     #14 0xb57c1631 (/lib/arm-linux-gnueabihf/libc-2.18.so+0x17631)
> Address 0xbeeb7d78 is located at offset 32 in frame <boolgen> of T0's stack:
>   This frame has 2 object(s):
>     [32, 104) 'nod'
>     [160, 232) 'nod1'
> HINT: this may be a false positive if your program uses some custom
> stack unwind mechanism or swapcontext
>       (longjmp and C++ exceptions *are* supported)
> Shadow bytes around the buggy address:
>   0x37dd6f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x37dd6f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x37dd6f70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x37dd6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>   0x37dd6f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> =>0x37dd6fa0: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1[00]
>   0x37dd6fb0:00 00 f4 f4 f4 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 02
>   0x37dd6fc0: f4 f3 f3 f3 f3 00 00 00 f4 f4 f4 f3 f3 f3 f3 00
>   0x37dd6fd0: 00 00 00 00 00 f1 f1 00 00 00 00 00 00 00 00 00
>   0x37dd6fe0: 00 f4 f4 f3 f3 f3 f3 00 00 00 00 f4 f2 f2 f2 f2
>   0x37dd6ff0: 00 f1 f1 f1 f1 00 00 00 00 00 00 f3 00 00 f4 f4
> Shadow byte legend (one shadow byte represents 8 application bytes):
>   Addressable:           00
>   Partially addressable: 01 02 03 04 05 06 07
>   Heap left redzone:     fa
>   Heap righ redzone:     fb
>   Freed Heap region:     fd
>   Stack left redzone:    f1
>   Stack mid redzone:     f2
>   Stack right redzone:   f3
>   Stack partial redzone: f4
>   Stack after return:    f5
>   Stack use after scope: f8
>   Global redzone:        f9
>   Global init order:     f6
>   Poisoned by user:      f7
>   ASan internal:         fe
> ==610== ABORTING
> go tool dist: FAILED: /home/dfc/go/pkg/tool/linux_arm/5c -D GOOS_linux
> -D GOARCH_arm -I $WORK -q -n -o $WORK/runtimedefs proc.c


+address-sanitizer


Try to set env var ASAN_OPTIONS="handle_segv=0 allow_user_segv_handler=1".
See https://code.google.com/p/address-sanitizer/wiki/Flags for
description of the flags.

What does "handle SIGSEGV" command in your gdb says?
Try to enter "handle SIGSEGV stop" and "handle SIGBUS stop""in gdb
before running the program.

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to