Bug 438170 - strsignal generates segmentation fault on x86_64
Summary: strsignal generates segmentation fault on x86_64
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 8
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-19 14:53 UTC by Ahmon Dancy
Modified: 2008-03-29 23:56 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-19 15:12:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ahmon Dancy 2008-03-19 14:53:54 UTC
Description of problem:

This program generates a segmentation fault on x86_64 but not i386:

#include <signal.h>
#include <stdio.h>

int main() {
        printf("DESC: %s\n", strsignal(7));
        return 0;
}

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

glibc-2.6-4

How reproducible:

Fully.

Steps to Reproduce:
1. Compile signal.c
2. Execute the compiled binary.
  
Actual results:

Segmentation fault

Expected results:

stdout should read:
DESC: Bus Error

Comment 1 Jakub Jelinek 2008-03-19 15:12:30 UTC
Compile it with -Wall and the compiler will tell you a helpful hint - the
function is implicitly prototyped when you compile with the default namespace.
Then read
info libc 'Feature Test Macros'
and note that strsignal is a GNU extension.

Comment 2 Ahmon Dancy 2008-03-19 15:27:14 UTC
Gah..  thanks.



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