Bug 483629 - SEGV on printf a __thread variable, compiled with -fPIC
SEGV on printf a __thread variable, compiled with -fPIC
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
4.7
ia64 Linux
low Severity medium
: rc
: ---
Assigned To: Jakub Jelinek
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-02 12:26 EST by Petr Muller
Modified: 2016-09-19 22:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 12:11:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
original customer testcase (2.90 KB, application/octet-stream)
2009-02-02 12:29 EST, Petr Muller
no flags Details
reduced testcase (722 bytes, application/octet-stream)
2009-02-02 12:30 EST, Petr Muller
no flags Details

  None (edit)
Description Petr Muller 2009-02-02 12:26:54 EST
Description of problem:

Firstly: I'm not sure where the problem actually lies - could be glibc, could be gcc, could be invalid testcase. I'm filing this so it won't get lost in the case it's a real bug we would want to fix in RHEL4. NOTABUG is expected, but I want to be sure.

When testing bug 479630, I've encountered a SEGV on the testcase provided by customer, on something like this, if present in a shared library compiled with -fPIC:

static __thread char whatever[100];

void do_stuff(){
   printf("whatever=%p\n", whatever);
}

Because I haven't seen the SEGV on other arches, and even RHEL5 on ia64, I assumed it's a bug. I've tried to narrow down the issue, but I'm not sure if the reductio is valid, so I will append both testcases.

Version-Release number of selected component (if applicable):
gcc-3.4.6-10.ia64
glibc-2.3.4-2.41.ia64

How reproducible:
always

Steps to Reproduce (original reproducer)
1) untar the TLS.tar.gz
2) cd TLS; make
3) LD_LIBRARY_PATH=. ./ldmain

Steps to Reproduce (my reduced reproducer)
1) untar the tc.tar.gz
2) cd tc
3) make test-fpic-thread
  
Actual results:
SEGV

Expected results:
no SEGV
Comment 1 Petr Muller 2009-02-02 12:29:59 EST
Created attachment 330652 [details]
original customer testcase
Comment 2 Petr Muller 2009-02-02 12:30:38 EST
Created attachment 330655 [details]
reduced testcase
Comment 3 Ulrich Drepper 2009-03-16 17:26:57 EDT
This cannot possibly be a glibc problem.  The printf function expects an absolute pointer to the string.  It is the compilers job to covert the magic __thread variable access into such a pointer.  If this fails it is the compilers problem.
Comment 4 Jiri Pallich 2012-06-20 12:11:14 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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