Bug 169064 - dynamic link sometimes causes non-working image
Summary: dynamic link sometimes causes non-working image
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11
Version: 4
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-22 17:44 UTC by Tom Holroyd
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-22 17:57:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test program that fails (352 bytes, text/plain)
2005-09-22 17:44 UTC, Tom Holroyd
no flags Details

Description Tom Holroyd 2005-09-22 17:44:37 UTC
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 17:44:38 UTC
Created attachment 119156 [details]
test program that fails

Comment 2 Tom Holroyd 2005-09-22 17:48:46 UTC
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 17:57:11 UTC
Your report is technical/developer support request rather than a bug report.

The xorg.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.