[osiris-devel] Osiris 2.4.4-stable released

Brian Wotring brian at shmoo.com
Thu Jan 29 10:37:42 EST 2004


Here is an example of code that will seg, it demonstrates the problem, 
exactly.  Correctly define the foo structure with an additional short, 
and everything is happy.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct foo
{
     short x;
     short y;
     short z;
};

struct bar
{
     long long gold;
     char buf[1024];
};

int main()
{
     struct foo myfoo;
     struct bar mybar;

     struct bar * realbar;

     char *buf = (char *)malloc( sizeof( myfoo ) + sizeof( mybar ) );
     mybar.gold = 4;

     memcpy( buf, &myfoo, sizeof( myfoo ) );
     memcpy( (buf+sizeof(myfoo)), &mybar, sizeof( mybar ) );

     realbar = (struct bar *)( buf + sizeof( myfoo ) );
     fprintf( stderr, "gold is: %llu\n", realbar->gold );

     return 0;
}


On Jan 28, 2004, at 11:42 AM, Alexei_Roudnev wrote:

> It is not hardware issue; it is (more likely) compilation mode issue. 
> For
> Solaris, I strongly recommend to have binary version, built on Solaris 
> 2.7 /
> Ultra Sparc / 32 bits, which can work on ANY hardware and ANY software
> (Solaris 2./7 - 2.9), and forget about this problem. You can not align
> network data structure to theparticular hardware (what if next Sun 
> will have
> 126bit mode - change structures again?).
>
> Moreover, I am 100% sure that C compiler allows to use un-aligned 
> structures
> in 64 bit mode, just look for the compiler options.
>
> ----- Original Message -----
> From: "Brian Wotring" <brian at shmoo.com>
> To: "Osiris Developers" <osiris-devel at lists.shmoo.com>
> Sent: Wednesday, January 28, 2004 5:07 AM
> Subject: Re: [osiris-devel] Osiris 2.4.4-stable released
>
>
>>
>> You are correct, it would effect OpenBSD running on this hardware.
>>
>> On Jan 27, 2004, at 6:02 PM, Richard Johnson wrote:
>>
>>> At 06:23 -0700 on 2004-01-26, Brian Wotring wrote:
>>>> - - this release changes the message header structure used
>>>>    throughout the components of the Osiris sytem.  Thus,
>>>>    this release is not compatible with previous releases.
>>>>    The changes was necessary in order to fix an alignment
>>>>    problem on Solaris.
>>>
>>>
>>> While I understand this fix isn't actually in until the rel_3_dev
>>> branch,
>>> the alignment problem doesn't seem to affect just Solaris:
>>>
>>>  | $ uname -mpsv
>>>  | OpenBSD GENERIC#4 sparc64 SUNW,UltraSPARC-IIi @ 333 MHz, version 0
>>> FPU
>>>  | $ dmesg | grep '3.4-current'
>>>  | OpenBSD 3.4-current (GENERIC) #4: Fri Jan 23 17:29:32 MST 2004
>>>  | $ osiris
>>>  | Osiris command line management utility - version 2.4.4-stable
>>>  | authenticating to (localhost)
>>>  |
>>>  | User: admin
>>>  | Password:
>>>  |
>>>  | [frozen here]
>>>
>>> The freeze noted in 2.4.4 does not occur in 3.0.1-current, so I
>>> suspect the
>>> alignment fix was the key for OpenBSD sparc64 support as well.
>>>
>>>
>>> Richard
>>> _______________________________________________
>>> osiris-devel mailing list
>>> osiris-devel at lists.shmoo.com
>>> https://lists.shmoo.com/mailman/listinfo/osiris-devel
>>>
>>>
>> --
>>      Brian Wotring ( brian at shmoo.com )
>>      PGP KeyID: 0x9674763D
>>
>> _______________________________________________
>> osiris-devel mailing list
>> osiris-devel at lists.shmoo.com
>> https://lists.shmoo.com/mailman/listinfo/osiris-devel
>>
>
> _______________________________________________
> osiris-devel mailing list
> osiris-devel at lists.shmoo.com
> https://lists.shmoo.com/mailman/listinfo/osiris-devel
>
>
--
     Brian Wotring ( brian at shmoo.com )
     PGP KeyID: 0x9674763D




More information about the osiris-devel mailing list