Bug 187540
Summary: | Using any explicit optimization level results in an executable that fails with 'segmentation fault.' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | John Slayton <juanslayton> |
Component: | gcc4 | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-04-03 12:26:47 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
John Slayton
2006-03-31 19:56:34 UTC
Created attachment 127149 [details]
Tarball will create directory 'bugstash' which contains source greader.c and data files needed to run the executable. Also included are two executables from my machine, with/without -O2
That's just buggy testcase: in download_roster, there is char zo[2]; ... (not initialized in any way), then: for (a = 0; a < Class_size; a++) { strcpy (Buf, "/tmp/bugstash/Name"); zo[0] = (char)((a / 10) + 48); strcat (Buf, &zo[0]); zo[0] = (char) ((a % 10) + 48); strcat (Buf, &zo[0]); fp = fopen(Buf, "r"); fgets (Name[a], 500, fp); fclose(fp); } That triggers undefined behavior, can work only if zo[1] happens to have value 0, but nothing initialized it that way. |