AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
Expand all | Collapse all

aix5.3: thread_creds_t not being a type, but a global variable

  • 1.  aix5.3: thread_creds_t not being a type, but a global variable

    Posted Tue June 06, 2006 10:32 AM

    Originally posted by: haubi


    Hi,

    apologies if this is the wrong forum - have not seen a fix for this yet, and don't know better where to report such things.

    There is a bug in [i]/usr/include/sys/thread.h[/i] of AIX oslevel [b]5.3.0.0[/b], which does not appear in AIX 5.2 an earlier.

    Look at declaration of type 'thread_creds_t', actually being a variable-definition rather than a type-declaration, due to the missing keyword 'typedef'.code
    /* Kernel view of thread credemtials structure (size-invariant) */
    struct thread_credentials {
    uint flags; /* Control structure data */
    cred_ext_t cred; /* Credentials to be modified */
    int reserved[9]; /* reserved fields for future */
    } thread_creds_t;
    [/code]This causes some very strange gcc-behaviour:

    When there is more than one global constructor in a c++ project, then only one global object gets constructed.
    The clue is that gcc seems to create only one global-constructor-entry per object file, giving it the mangled name of the first global object in the source.

    So all object files having sys/thread.h compiled in, contain a global-constructor-entry of the same name, so only one of them gets collected (by gcc's collect2), and therefore only one is executed at program-startup.

    As the type 'thread_creds_t' is introduced first with AIX 5.3, there is a simple workaround: Just define thread_creds_t to nothing, i.e. 'gcc -Dthread_creds_t='

    If necessary, I have some sample to demonstrate the problem.

    Thanks,
    haubi
    PS: If you need more information from the actual system, please give me the full commandline, i'm not an aix administrator...
    #AIX-Forum


  • 2.  Re: aix5.3: thread_creds_t not being a type, but a global variable

    Posted Wed March 28, 2007 12:22 PM

    Originally posted by: jpc@pt.ibm.com


    That's fixed in bos.adt.include 5.3.0.53.

    Or for a quickfix, just add a typedef before the struct.
    #AIX-Forum


  • 3.  Re: aix5.3: thread_creds_t not being a type, but a global variable

    Posted Tue July 01, 2008 08:47 AM

    Originally posted by: andrejvanderzee


    A similar issue for struct fc_softrc in /usr/include/net/if_arp.h not fixed in the service packs and fixes as of today. For details see:
    http://www-128.ibm.com/developerworks/forums/thread.jspa?messageID=14104633&#14104633
    Greets,
    Andrej

    Message was edited by: andrejvanderzee
    #AIX-Forum