Bug 782251 - Undefined reference to `_XGetRequest' since libX11-1.4.99.1
Summary: Undefined reference to `_XGetRequest' since libX11-1.4.99.1
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL
Version: rawhide
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL: http://comments.gmane.org/gmane.linux...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-16 23:12 UTC by Bruno Wolff III
Modified: 2015-11-26 16:49 UTC (History)
4 users (show)

Fixed In Version: SDL-1.2.14-16.fc17
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-17 14:19:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test from configure (1.98 KB, text/plain)
2012-01-17 10:16 UTC, Petr Pisar
no flags Details
Proposed fix (754 bytes, patch)
2012-01-17 14:00 UTC, Petr Pisar
no flags Details | Diff
Patch from upstream (2.37 KB, patch)
2012-01-19 10:59 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
SDL Simple Directmedia Layer 1376 0 None None None Never

Description Bruno Wolff III 2012-01-16 23:12:56 UTC
Description of problem:
The mass rebuild version of SDL no longer works properly. When linking it I see an error of:
/usr/lib/gcc/i686-redhat-linux/4.7.0/../../../libSDL.so: undefined reference to `_XGetRequest'
I get this when trying to rebuild sear and lordsawar.
I have a scratch build of sear that dumps config.log and the buildlog for this is at:
http://koji.fedoraproject.org/koji/getfile?taskID=3707311&name=build.log

After seeing this I tried to reproduce it at home and did.
SDL-1.2.14-13.fc17 worked, but SDL-1.2.14-14.fc17 did not.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Bruno Wolff III 2012-01-17 05:49:14 UTC
It looks like the SDL-1.2.10-GrabNotViewable.patch patch got added in git recently but wasn't included in any official build before the mass rebuild build.

Comment 2 Bruno Wolff III 2012-01-17 06:18:41 UTC
I tried commenting out that patch and it didn't prevent the problem. So something outside of SDL probably changed since last August in a way that causes a problem for SDL.

Comment 3 Petr Pisar 2012-01-17 09:26:15 UTC
The SDL-1.2.10-GrabNotViewable.patch has been added in SDL-1.2.14-13.fc17 which is before F17 mass rebuild. Actually it was added and built in all Fedoras.

My quick tip is the configure test uses an X11 symbol but does not link to X11 library explicitly. SDL pkg-config does not do this because SDL is aimed to shield application from X11. I think linker has changed in between to cut off  unneeded run-time linking dependencies.

I will investigate it more deeply soon.

Comment 4 Petr Pisar 2012-01-17 09:40:21 UTC
BTW, you depends on SDL-devel nowhere despite the configure test links to libSDL.so. You should not rely in pulling SDL-devel indirectly through SDL_mixer-devel or similar.

Comment 5 Petr Pisar 2012-01-17 10:11:19 UTC
This does not exhibit on x86_64. Actually I got similar report for pcre on i686 F14.

I scanned sources of SDL and of sear and I could not find the symbol anywhere. I have no i686 virtual machine. What does say "nm -D /usr/lib/libSDL.so | grep _XGetRequest" on your machine?

Comment 6 Petr Pisar 2012-01-17 10:16:37 UTC
Created attachment 555718 [details]
test from configure

configure compiles it as:

$ gcc -o conftest -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -Wl,-z,relro  conftest.c  -lSDL -lpthread

Could you try it? Can you reproduce the bug with this isolated test?

Comment 7 Petr Pisar 2012-01-17 10:44:21 UTC
(In reply to comment #5)
> I scanned sources of SDL and of sear and I could not find the symbol anywhere.
> I have no i686 virtual machine. What does say "nm -D /usr/lib/libSDL.so | grep
> _XGetRequest" on your machine?

It's there as undefined dynamic symbol. It's because of libX11-devel.i686 declares:

/usr/include/X11/Xlibint.h:434:extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);

The symbol exists only in i686 libX11. And is defined in i686 /usr/lib/libX11.so.

Comment 8 Petr Pisar 2012-01-17 12:11:42 UTC
So the problem is X11 adds new symbol. SDL does not link to X11. SDL dlopens() it. Because X11 declares the symbols as extern in header file, the X11 symbols must be resolved at run-time linker. SDL redefines all X11 symbols to hide them from global symbol table and to make linker happy without X11 library.

Solution is to add _XGetRequest into SDL:src/video/x11/SDL_x11sym.h. But before that I'd like to hear from X11 guys why the symbol (_XGetRequest) exists on i686 only.

Comment 9 Petr Pisar 2012-01-17 12:51:59 UTC
My fault. Latest SDL-1.2.14-14.fc17 compiled against libX11-1.4.99.1 declares and defines the symbol on i686 as well as on x86_64. My rawhide does not include SDL-1.2.14-14.fc17 because mirrors are to slow.

Comment 10 Bruno Wolff III 2012-01-17 13:55:11 UTC
gcc -o conftest -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wl,-z,relro  conftest.c  -lSDL -lpthread
/usr/lib/gcc/i686-redhat-linux/4.7.0/../../../libSDL.so: undefined reference to `_XGetRequest'
collect2: error: ld returned 1 exit status

Comment 11 Petr Pisar 2012-01-17 14:00:26 UTC
Created attachment 555785 [details]
Proposed fix

Simple test case: ldd -r -d /usr/lib64/libSDL.so

Comment 12 Petr Pisar 2012-01-17 14:19:40 UTC
I believe I fixed it in SDL-1.2.14-15.fc17.

Comment 13 Bruno Wolff III 2012-01-17 16:48:26 UTC
sear and lordsawar both built successfully once SDL-1.2.14-15.fc17 was in the build root. Thanks for fixing this so quickly.

Comment 14 Petr Pisar 2012-01-19 10:59:13 UTC
Created attachment 556251 [details]
Patch from upstream

Comment 15 Petr Pisar 2012-01-19 11:16:44 UTC
Rebuilt with upstream patch as SDL-1.2.14-16.fc17.

Comment 16 sagnik 2015-09-14 21:45:05 UTC
Guys, I have this same error on my RHEL 6 machine, Here's my lsb_release -a:

LSB Version:	:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:	RedHatEnterpriseServer
Description:	Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release:	6.5
Codename:	Santiago

I installed SDL and SDL-devel from yum, then install pygame. from pygame.base import * produced this:

ImportError: /usr/lib64/libSDL-1.2.so.0: undefined symbol: _XGetRequest

Comment 17 Petr Pisar 2015-09-15 07:51:15 UTC
(In reply to sagnik from comment #16)
> Guys, I have this same error on my RHEL 6 machine, Here's my lsb_release -a:
> 
> LSB Version:
> :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-
> amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
> Distributor ID:	RedHatEnterpriseServer
> Description:	Red Hat Enterprise Linux Server release 6.5 (Santiago)
> Release:	6.5
> Codename:	Santiago
> 
> I installed SDL and SDL-devel from yum, then install pygame. from
> pygame.base import * produced this:
> 
> ImportError: /usr/lib64/libSDL-1.2.so.0: undefined symbol: _XGetRequest

Then contact Red Hat support to escalate your request properly. RHEL is not Fedora.

Comment 18 Wim Taymans 2015-11-26 15:31:16 UTC

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

Comment 19 Petr Pisar 2015-11-26 16:49:20 UTC
This bug report was about Fedora. Not Red Hat Enterprise Linux.


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