This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
`tradcpp0' segfaults on nul bytes. When Debian switched to gcc-3.2 my applications' X resources stopped being honored. It turns out that `xrdb' processes its input with `cpp -traditional' and I had a useless nul byte at the end of my .Xresources. I can reproduce this segfault with 3.1. It works fine with 2.95. Release: cpp (GCC) 3.2.2 20030124 (Debian prerelease) Environment: Debian unstable How-To-Repeat: Create a file containing a nul byte, and run it through the traditional preproc. % echo '\0' > bar % od -c bar 0000000 \0 \n 0000002 ~ % cpp bar # 1 "bar" # 1 "<built-in>" # 1 "<command line>" # 1 "bar" bar:1:1: warning: null character(s) ignored ~ % cpp -traditional bar cpp: Internal error: Segmentation fault (program tradcpp0) Please submit a full bug report. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. For Debian GNU/Linux specific bugs, please see /usr/share/doc/debian/bug-reporting.txt. ~ % cpp --version cpp (GCC) 3.2.2 20030124 (Debian prerelease) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
From: Neil Booth <neil@daikokuya.co.uk> To: Alexandre Duret-Lutz <adl@gnu.org> Cc: gcc-gnats@gcc.gnu.org, Jakub Jelinek <jakub@redhat.com>, gcc-bugs@gcc.gnu.org Subject: Re: preprocessor/9465: tradcpp0 segfaults on nul bytes Date: Mon, 27 Jan 2003 22:08:13 +0000 Alexandre Duret-Lutz wrote:- > >Originator: Alexandre Duret-Lutz > >Release: cpp (GCC) 3.2.2 20030124 (Debian prerelease) > >Organization: > >Environment: > Debian unstable > >Description: > `tradcpp0' segfaults on nul bytes. > > When Debian switched to gcc-3.2 my applications' X resources > stopped being honored. It turns out that `xrdb' processes > its input with `cpp -traditional' and I had a useless nul byte > at the end of my .Xresources. > > I can reproduce this segfault with 3.1. It works fine with 2.95. > >How-To-Repeat: > Create a file containing a nul byte, and run it through > the traditional preproc. > > % echo '\0' > bar > % od -c bar > 0000000 \0 \n > 0000002 > ~ % cpp bar > # 1 "bar" > # 1 "<built-in>" > # 1 "<command line>" > # 1 "bar" > bar:1:1: warning: null character(s) ignored > ~ % cpp -traditional bar > cpp: Internal error: Segmentation fault (program tradcpp0) Jakub, this is the second report of this regression you introduced. Do you intend to fix it? Neil.
From: jakub@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: preprocessor/9465 Date: 1 Feb 2003 21:48:43 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-rhl8-branch Changes by: jakub@gcc.gnu.org 2003-02-01 21:48:43 Modified files: gcc : ChangeLog tradcpp.c Log message: PR preprocessor/9465 * tradcpp.c (fixup_newlines): Use memchr instead of strchr. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.60&r2=1.13152.2.657.2.27.2.61 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tradcpp.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.47.2.2.4.1&r2=1.47.2.2.4.2
From: jakub@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: preprocessor/9465 Date: 2 Feb 2003 12:59:59 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-branch Changes by: jakub@gcc.gnu.org 2003-02-02 12:59:58 Modified files: gcc : ChangeLog tradcpp.c Log message: PR preprocessor/9465 * tradcpp.c (fixup_newlines): Use memchr instead of strchr. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.208&r2=1.13152.2.657.2.209 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tradcpp.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.47.2.2.2.1&r2=1.47.2.2.2.2
State-Changed-From-To: open->closed State-Changed-Why: Fixed in 3.2.2.