Bug 526116 - F11 binutils and F12 glibc makes string functions crash
Summary: F11 binutils and F12 glibc makes string functions crash
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-28 20:25 UTC by Göran Uddeborg
Modified: 2009-10-14 12:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-10-14 12:36:09 UTC
Type: ---

Attachments (Terms of Use)

Description Göran Uddeborg 2009-09-28 20:25:00 UTC
Description of problem:
I was testing a few things from rawhide, and had to install a new glibc.  Later when I compiled some code, I found that strcmp() crashes with two valid strings as input.  That happened only in 64 bit mode, but later I found that strlen() has the same problem, both in 64 and 32 bit mode.

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

How reproducible:
Every time

Steps to Reproduce:
1. Create this program
#include <string.h>
#include <stdio.h>

char *s1 = "String";

int main()
  fprintf(stderr, "Computing length of \"%s\"\n", s1);
  int len = strlen(s1);
  fprintf(stderr, "Length is %d\n", len);
  return 0;

2. Compile with: cc c.c -o c
3. Run: ./c
Actual results:
[göran@mimmi ~]$ ./c
Computing length of "String"
Segmentation fault

Additional info:
I of course realise this might not be a supported combination (whatever that would mean when it comes to rawhide).  But I was still surprised to see it and wanted to mention it.  I don't have any system I can upgrade completely to rawhide right now.

If this isn't supposed to work, maybe it would be worth a "Conflict: gcc < <whatever>" in the glibc rpm?

I tried to install the glibc-debuginfo rpm and look at what actually happens.  But then my debugger started to crash too! (gdb-

Comment 1 Jakub Jelinek 2009-09-29 08:36:59 UTC
To use rawhide glibc you need toolchain that handles STT_GNU_IFUNC well, namely at least rawhide prelink, likely binutils, gdb, ...  gcc isn't strictly required.

Comment 2 Göran Uddeborg 2009-09-29 11:26:08 UTC
Right, updating my binutils resolved the issue.  So it would not be "conflict" with gcc, but some other packages then.  If you choose to go that way.

Comment 3 Andreas Schwab 2009-10-14 12:36:09 UTC
Fixed in 2.10.90-25.

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