Bug 169064 - dynamic link sometimes causes non-working image
dynamic link sometimes causes non-working image
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: xorg-x11 (Show other bugs)
4
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: X/OpenGL Maintenance List
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-22 13:44 EDT by Tom Holroyd
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-22 13:57:34 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)
test program that fails (352 bytes, text/plain)
2005-09-22 13:44 EDT, Tom Holroyd
no flags Details

  None (edit)
Description Tom Holroyd 2005-09-22 13:44:37 EDT
Description of problem:

When I leave off some of the -lXblah arguments, the dynamic linker manages to
find everything OK, but depending on position, the program segfaults or
otherwise doesn't work.  When I fully specify the link order, it still sometimes
doesn't work, if the order is wrong.  I have found an order that always works,
but there's still some strange position dependent bug.  I haven't tried linking
statically.

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

I've tried this on two very different boxes, both x86, running FC4 that was
completely up to date (yum update done prior to all tests, and xorg-x11 has had
a few changes recently so I made sure I was getting the latest, as of 9/22).

How reproducible:

Very, but unpredictably, depending on link order.

Steps to Reproduce:
1.  Sample program below.
2.  Compile and link; experiment with library order, like leave most of them
off, or just try something like -lGLw -lGL -lXt -lX11 -lXm; some combinations
work, some don't.  I get segfaults, or invalid X requests, depending on how it
links.  Even re-running it can change what I get (different dynamic link order).
  
Actual results:

segfault

Expected results:

no segfault

Additional info:

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>

#include <X11/Intrinsic.h>

static String fallbackResources[] = {
  NULL
};

XtAppContext app = NULL;
Widget toplevel = NULL;

int
main(int argc, char *argv[])
{
  toplevel = XtAppInitialize(&app, "moo", NULL, 0, &argc, argv,
    fallbackResources, NULL, 0);
  return 0;
}
Comment 1 Tom Holroyd 2005-09-22 13:44:38 EDT
Created attachment 119156 [details]
test program that fails
Comment 2 Tom Holroyd 2005-09-22 13:48:46 EDT
More information about the link order.  We've tried this now on a total of 4
different boxes.

The basic workaround is to move '-lXm' to the left of '-lGLw'.

Apparently there are some functions with the same name in there someplace.
Comment 3 Mike A. Harris 2005-09-22 13:57:11 EDT
Your report is technical/developer support request rather than a bug report.

The xorg@lists.freedesktop.org mailing list is a more appropriate location
to seek assistance for developing X applications.

Setting status to NOTABUG.

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