Bug 315061 - Cproto segfaults when reading from stdin
Cproto segfaults when reading from stdin
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: cproto (Show other bugs)
7
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Jindrich Novy
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-02 03:12 EDT by Trond Danielsen
Modified: 2013-07-02 19:23 EDT (History)
2 users (show)

See Also:
Fixed In Version: 4.7f-1.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-15 21:12:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Trond Danielsen 2007-10-02 03:12:59 EDT
Description of problem:
Cproto segfaults when reading from stdin.

Version-Release number of selected component (if applicable):
Name   : cproto
Arch   : x86_64
Version: 4.7e
Release: 2.fc6

How reproducible:
Every time.

Steps to Reproduce:
1. Run the following command:
$ echo "#include <stdio.h>
int main(int argc, char *argv[]) { printf(\"hello world\n\"); }" | cproto

  

Additional info:
- I have not yet tested this on my i386 laptop, only on my x86_64 workstation.
- This works just fine:
$ echo "#include <stdio.h>
int main(int argc, char *argv[]) { printf(\"hello world\n\"); }" >hello.c;
cproto hello.c
- gdb backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000407439 in get_cpp_directive (copy=1) at ./lex.l:726
726             *temp_buf = '\0';
(gdb) backtrace 
#0  0x0000000000407439 in get_cpp_directive (copy=1) at ./lex.l:726
#1  0x00000000004080c3 in yylex () at ./lex.l:175
#2  0x0000000000409709 in yyparse () at y.tab.c:877
#3  0x000000000040acdb in process_file (infile=<value optimized out>,
name=0x40b65d "stdin") at ./grammar.y:1011
#4  0x0000000000402348 in main (argc=1, argv=0x7fff97c14078) at cproto.c:821
#5  0x000000373681dab4 in __libc_start_main (main=0x401910 <main>, argc=1,
ubp_av=0x7fff97c14078, 
    init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value
optimized out>, 
    stack_end=0x7fff97c14068) at libc-start.c:222
#6  0x00000000004012c9 in _start ()
Comment 1 Jindrich Novy 2007-10-19 08:53:10 EDT
Fixed in rawhide, thanks for noticing. BTW. this happens exclusively for the
#include directive. The example code isn't compilable anyway ;-)
Comment 2 Thomas E. Dickey 2008-01-06 14:49:05 EST
I added a fix in 4.7f
Comment 3 Trond Danielsen 2008-02-06 02:41:03 EST
I confirm that the problem is gone in 4.7f.
Comment 4 Jindrich Novy 2008-02-14 02:19:03 EST
Ok, I'll release fedora updates then. Thanks!
Comment 5 Fedora Update System 2008-02-14 08:13:42 EST
cproto-4.7f-1.fc8 has been submitted as an update for Fedora 8
Comment 6 Fedora Update System 2008-02-14 08:15:41 EST
cproto-4.7f-1.fc7 has been submitted as an update for Fedora 7
Comment 7 Fedora Update System 2008-02-15 21:12:37 EST
cproto-4.7f-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2008-02-15 21:13:51 EST
cproto-4.7f-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.