[MPlayer-dev-eng] [PATCH] Startup crash on sparc64

Attila Kinali attila at kinali.ch
Mon Aug 9 14:31:20 CEST 2004


On Fri, Jul 23, 2004 at 02:58:36PM +0100, Julian Coleman wrote:
> In m_config.h, the `data' member of struct m_config_save_slot is aligned on a
> 4 byte boundary because it follows the `int lvl' member.  In the parse_*()
> functions in m_option.c, the construction:
> 
>   if(dst) VAL(dst)
> 
> causes the address of `data' to be assigned to a pointer.  As pointers must
> be aligned on an 8 byte boundary on sparc64, a bus error is generated at this
> point.
> 
> The following patch (hack?) fixes this
> 
> J
> 
>   - - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -
> 
> --- m_config.h.orig     2003-08-13 17:29:00.000000000 +0100
> +++ m_config.h  2004-07-23 10:37:29.000000000 +0100
> @@ -9,7 +9,10 @@
>  struct m_config_save_slot {
>    m_config_save_slot_t* prev;
>    int lvl;
> -  unsigned char data[0];
> +  union {
> +    unsigned char data[0];
> +    void* dummy;
> +  };
>  };

Isnt there a compiler directive to allign variables on certain byte
boundaries ?

			Attila Kinali




More information about the MPlayer-dev-eng mailing list