Subject: xsrc/25042: x11-ssh-askpass segv's unless -O2 cflags are turned off
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <wolfgang@wsrcc.com>
List: netbsd-bugs
Date: 04/03/2004 11:25:21
>Number:         25042
>Category:       xsrc
>Synopsis:       x11-ssh-askpass segv's unless -O2 cflags are turned off
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 03 19:26:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang S. Rupprecht
>Release:        NetBSD 2.0B
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Environment:
	
	
System: NetBSD bonnet.wsrcc.com 2.0B NetBSD 2.0B (WSRCC) #5: Fri Apr 2 12:59:48 PST 2004 wolfgang@bonnet.wsrcc.com:/var/obj/netbsd/sys/arch/amd64/compile/WSRCC amd64
Architecture: x86_64
Machine: amd64
>Description:

    x11-ssh-askpass SEGV's in a way that appears to trash the stack.

    When it is recompiled with just "-g" it runs fine.  It is not
    clear if this is a gcc problem or simply bad code in the
    application or libraries.
	
>How-To-Repeat:

    with default build (CFLAGS=-O2) out of pkgsrc/security

    $ gdb x11-ssh-askpass
    ...
    (gdb) run
    Starting program: /var/obj/pkgsrc/security/ssh-askpass/work/x11-ssh-askpass-1.0/x11-ssh-askpass 
    Reading symbols from /usr/libexec/ld.elf_so...done.
    Reading symbols from /usr/X11R6/lib/libXt.so.6...done.
    Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
    Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
    Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
    Reading symbols from /usr/lib/libc.so.12...done.
    Reading symbols from /usr/X11R6/lib/X11/locale/lib/common/xlcDef.so.2...done.

    Program received signal SIGSEGV, Segmentation fault.
    0x0000000041098a12 in memcpy () from /usr/lib/libc.so.12
    (gdb) up
    Initial frame selected; you cannot go up.

    Runs fine with -g

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: