Bug 57122

Summary: Internal error: Segmentation fault (program cpp0)
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-12-05 09:52:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
source file needed to reproduce bug
none
Core dump none

Description Sysoltsev Slawa 2001-12-05 09:49:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
gcc crashes with segmentation fault when i try to compile C source file 
with certain error.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. command line:  gcc -D'MD5Name(x)=#Broken##x' test.c

test.c:
#include <stdio.h>
int main ()
{
    printf (MD5Name(SLAWA));
    return 0;
}


Actual Results:  gcc emits diagnostics:
<command line>: '#' is not followed by a macro parameter
gcc: Internal error: Segmentation fault (program cpp0)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

gcc also creates core dump in current directory

Expected Results:  compile-time error

Additional info:

I will try to attach core dump and test.c files

Comment 1 Sysoltsev Slawa 2001-12-05 09:51:19 UTC
Created attachment 39690 [details]
source file needed to reproduce bug

Comment 2 Sysoltsev Slawa 2001-12-05 09:52:05 UTC
Created attachment 39691 [details]
Core dump

Comment 3 Jakub Jelinek 2001-12-18 13:05:34 UTC
The ICE was fixed in gcc-2.96-100, though the warning is correct,
such argument is bogus.
If you want to stringify the whole thing (which I belive because you're passing
it to printf), then it should be
gcc -D'MD5Name(x)="Broken" #x' test.c

*** This bug has been marked as a duplicate of 54380 ***