After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162979 - gtk+ crashes on HP-UX
gtk+ crashes on HP-UX
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.6.x
Other HP-UX
: Normal normal
: Need diagnosis
Assigned To: gtk-bugs
gtk-bugs
: 307816 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-01-05 03:45 UTC by Paul Cornett
Modified: 2005-07-08 03:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Cornett 2005-01-05 03:45:11 UTC
Any gtk program (such as gtk-demo) segfaults on startup, on HP-UX. The fault
occurs in _gdk_x11_set_input_focus_safe, line 327, which is

LockDisplay(dpy);

dpy->lock_fns contains an invalid address. This occurs for 2.4.x and 2.6.0, but
not 2.2.4 (which does work). I have tried compiling gtk and all prerequisites
with HP C 11.08, HP aCC 3.57, and gcc 3.4.3, shared libraries and static, always
the same result.
Comment 1 Matthias Clasen 2005-01-05 05:07:49 UTC
That sounds like a bug in the gdkasync.c code using semiprivate Xlib interfaces
doesn't work on HP-UX.
Comment 2 Angelo Mosè Pozzi 2005-05-12 12:43:32 UTC
I have the same problem with gtk+-2.6.7.
In your opinion, who should fix the bug?
Comment 3 Matthias Clasen 2005-05-12 14:04:15 UTC
Can you investigate if lock_fns is valid after calling XInitThreads ?
Comment 4 Paul Cornett 2005-05-17 22:44:48 UTC
Output of the program below:
d=40003478 d->lock_fns=00000000

BTW, the invalid address that caused the crash looked like garbage, it was not NULL.

#include <X11/Xlibint.h>
int main(void)
{
  if (XInitThreads()) {
    Display* d = XOpenDisplay(":0");
    printf("d=%p d->lock_fns=%p\n", d, d->lock_fns);
    XCloseDisplay(d);
  }
  return 0;
}
Comment 5 Matthias Clasen 2005-06-22 13:52:02 UTC
*** Bug 307816 has been marked as a duplicate of this bug. ***
Comment 6 kgs 2005-06-23 22:26:12 UTC
_XDisplay Structure defined in Xlibint.h is causing the problem.

Depending on the defintions of -DHPPEX and -DSHMLINK ,  HP-UX lockf_fns is
placed in different location in Display Struct

In Xlibint.h file , 
    78  struct _XDisplay
    79  {
    80          XExtData *ext_data;    ....
   157          KeySym lock_meaning;       /* for XLookupString */
   158          struct _XLockInfo *lock;   /* multi-thread state, display lock *
/
   159          struct _XInternalAsync *async_handlers; /* for internal async */
   160  #if !(SHMLINK || HPPEX)
   161          unsigned long bigreq_size; /* max size of big requests */
   162          struct _XLockPtrs *lock_fns; /* pointers to threads functions */
                                  ^^^^^^^^^
   163          void (*idlist_alloc)(      /* XID list allocator function */
   164  #if NeedFunctionPrototypes
   165               Display *       /* dpy */,
   166               XID *      
   223  #if SHMLINK || HPPEX
   224          unsigned long bigreq_size; /* max size of big requests */
   225          XID resource_max;       /* allocator max ID */
   226          int xcmisc_opcode;      /* major opcode for XC-MISC */
   227
   228          /* End of HP R5 compatible structure */
   229
   230          struct _XLockPtrs *lock_fns; /* pointers to threads functions */
                                  ^^^^^^^^^^
   231          void (*idlist_alloc)();    /* XID list allocator function */
   232          unsigned int num_lock;  /* keyboard numlock modifiers */
   233  #endif /* SHMLINK || HPPEX */


   X11 is built with SHMLINK & HPPEX set . But gtk is not built with these
defintions &  LockDisplay  looking for lock_fns in a wrong location.
This is causing the problem 

Compiling GTK with the following flags solves the problem.
CFLAGS='-DHPPEX  -DSHMLINK ' . 

Comment 7 Paul Cornett 2005-06-24 20:01:56 UTC
When built with those defines, gtk+-2.6.8 now works for me. Thanks.
Comment 8 Matthias Clasen 2005-06-24 20:33:20 UTC
Wierd. 
Should we tweak configure.in to add "-DHPPEX -DSHMLINK" to CFLAGS on HP-UX ?
Comment 9 Gowri Kandasamy 2005-06-27 17:00:48 UTC
These flags are applicable for all HP-UX architecture ( PA_RISC , Itanium).
The configure.in file needs to be updated with these flags.
Comment 10 Angelo Mosè Pozzi 2005-06-28 10:04:50 UTC
I've build gtk+-2.6.7 and now it works fine. Thanks a lot 
Comment 11 Matthias Clasen 2005-07-08 03:58:44 UTC
2005-07-07  Matthias Clasen  <mclasen@redhat.com>

	* configure.in: Add -DHPPEX -DSHMLINK to CFLAGS for HP-UX.  
	(#162979, Paul Cornett)