[Bug 205684] putc function coredump

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 29 03:45:26 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205684

            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 at FreeBSD.org
          Reporter: snrtcel at 126.com
                CC: freebsd-amd64 at FreeBSD.org
                CC: freebsd-amd64 at FreeBSD.org

Created attachment 164798
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=164798&action=edit
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 at releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC
 amd64



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

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

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

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

    return 0;
}
=======================
then   cc -g xx.c
./a.out 
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=1, av=0x7fffffffeb68) at y.c:7
(gdb) l
7               c = getc(stdin);
8               if (EOF == c) {
9                   break;
10              }
11      
12              c = putc(c, stdout);
13              if (EOF == c) {
14                  break;
15              }
16          }

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


More information about the freebsd-amd64 mailing list