Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2015 03:45:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-amd64@FreeBSD.org
Subject:   [Bug 205684] putc function coredump
Message-ID:  <bug-205684-6@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205684

            Bug ID: 205684
           Summary: putc function coredump
           Product: Base System
           Version: 10.2-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: gnu
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: snrtcel@126.com
                CC: freebsd-amd64@FreeBSD.org
                CC: freebsd-amd64@FreeBSD.org

Created attachment 164798
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D164798&action=
=3Dedit
code, coredump files

mine system infomation as below:

FreeBSD y2ghost.bsd 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12
15:26:37 UTC 2015     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GEN=
ERIC
 amd64



mine code as beblow:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#include <stdio.h>

int main(int ac, char *av[])
{
    int c =3D 0;
    while (1) {
        c =3D getc(stdin);
        if (EOF =3D=3D c) {
            break;
        }

        c =3D putc(c, stdout);
        if (EOF =3D=3D c) {
            break;
        }
    }

    if (0 !=3D ferror(stdin)) {
        printf("%s\n", "input error");
    }

    return 0;
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
then   cc -g xx.c
./a.out=20
asdfkaasdfds^\[1]    1485 quit (core dumped)  ./a.out

I press ctrl+\, then a.out coredump, the frame infomation as beblow

Loaded symbols for /libexec/ld-elf.so.1
#0  0x0000000800964f08 in _read () from /lib/libc.so.7
(gdb) bt
#0  0x0000000800964f08 in _read () from /lib/libc.so.7
#1  0x0000000800964840 in memmove () from /lib/libc.so.7
#2  0x000000080094be47 in __srget () from /lib/libc.so.7
#3  0x000000080094bcfe in __srget () from /lib/libc.so.7
#4  0x00000000004009db in main (ac=3D1, av=3D0x7fffffffeb68) at y.c:7
(gdb) l
7               c =3D getc(stdin);
8               if (EOF =3D=3D c) {
9                   break;
10              }
11=20=20=20=20=20=20
12              c =3D putc(c, stdout);
13              if (EOF =3D=3D c) {
14                  break;
15              }
16          }

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205684-6>