[Mono-devel-list] Compile error Mono 0.91 on PowerBook G4 YDL 3

rico at elctech.com rico at elctech.com
Sat May 15 16:48:37 EDT 2004


I have not seen any resolution to this issue on the list and I wanted to
provide more information to help solve the problem. I'm hoping I've given
enough information for someone to make sense of the exceptions-ppc.c mapping
to the YDL headers. If not, please let me know what else I can provide.

I ran into this on my G3 YDL 3 system. Looking in:
/usr/include/ucontext.h:
---------------
/* Get machine dependent definition of data structures.  */
#include <sys/ucontext.h>
---------------

/usr/include/sys/ucontext.h:
---------------
typedef struct sigcontext mcontext_t;
/* Userlevel context.  */
typedef struct ucontext
  {
    unsigned long int uc_flags;
    struct ucontext *uc_link;
    stack_t uc_stack;
#if __WORDSIZE == 32
    mcontext_t uc_mcontext;
    __sigset_t uc_sigmask;
#else
    sigset_t    uc_sigmask;
    mcontext_t  uc_mcontext;  /* last for extensibility */
#endif
  } ucontext_t;
---------------

The failing code (in mono/mini/exceptions-ppc.c:1082) is caused by this
lookup:
uc->uc_mcontext.uc_regs->gregs [PT_NIP]

Where uc is defined as:
struct ucontext *uc = ctx;

So a struct ucontext has a uc_mcontext field, but looking at the definition
of sigcontext (mcontext_t) in /usr/include/asm/sigcontext.h:
---------------
struct sigcontext_struct {
        unsigned long   _unused[4];
        int             signal;
        unsigned long   handler;
        unsigned long   oldmask;
        struct pt_regs  *regs;
};
---------------

There is an entry for 'regs', but not for uc_regs. Furthermore, uc_regs does
not seem to map to 'regs' since there is no 'gregs' field in struct pt_regs.


More information about the Mono-devel-list mailing list