NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/54090: gcc -fsanitize=address creates an unusable binary on amd64



>Number:         54090
>Category:       toolchain
>Synopsis:       gcc -fsanitize=address creates an unusable binary on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 30 21:35:00 +0000 2019
>Originator:     Alexander Nasonov
>Release:        NetBSD 8.99.36 (aka current)
>Organization:
	XMM SWAP LTD
>Environment:
System: NetBSD neva 8.99.36 NetBSD 8.99.36 (GENERIC) #0: Sun Mar 24 17:41:51 GMT 2019  alnsn@nebeda:/home/alnsn/netbsd-current/sljit/src/sys/arch/amd64/compile/obj/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	Address sanitizer doesn't work on amd64 current.
	If /proc isn't mounted with the 'linux' flag, gcc
	produces a binary that complains about missing
	/proc/pid/task. If /proc is mounted with the 'linux'
	flag, the binary prints 'ASAN:DEADLYSIGNAL' and hangs.
>How-To-Repeat:
	# umount /proc
	# mount -orw,linux -t procfs none /proc
	# sysctl -w security.pax.aslr.enabled=0
	# sysctl -w security.pax.mprotect.enabled=0

	$ echo 'int main(){}' > /tmp/x.c
	$ gcc -fsanitize=address /tmp/x.c
	$ ktrace ./a.out
	ASAN:DEADLYSIGNAL

	$ kdump
	...
	4474      1 a.out    CALL  getpid
	4474      1 a.out    RET   getpid 4474/0x117a, 18417/0x47f1
	4474      1 a.out    CALL  sched_yield
	4474      1 a.out    RET   sched_yield 0
	4474      1 a.out    PSIG  SIGSEGV caught handler=0x7f7ff6c23572 mask=(): code=SEGV_MAPERR, addr=0x0, trap=6)
	4474      1 a.out    CALL  write(2,0x7f7ff6c9052c,0x12)
	4474      1 a.out    GIO   fd 2 wrote 18 bytes
	    "ASAN:DEADLYSIGNAL\n"
	4474      1 a.out    RET   write 18/0x12
	4474      1 a.out    CALL  sched_yield
	4474      1 a.out    RET   sched_yield 0
	4474      1 a.out    CALL  sched_yield
	4474      1 a.out    RET   sched_yield 0
	4474      1 a.out    CALL  sched_yield
	4474      1 a.out    RET   sched_yield 0
	4474      1 a.out    CALL  sched_yield
	4474      1 a.out    RET   sched_yield 0
	... sched_yield forever ...
>Fix:
	not known.



Home | Main Index | Thread Index | Old Index