Follow-up Comment #4, bug #18481 (project freeciv):

[12:12:ttypl][longturn@spock:~:4]$ cat a.c
#include <stdio.h>

        printf("%d %dn", sizeof(int), sizeof(size_t));
        return 0;
[12:12:ttypl][longturn@spock:~:5]$ gcc a.c -o a && ./a 
4 8

Here we go, I believe this is the source of the SIGBUS. 2.2 works fine on
sparc64, here is what changed:

./utility/registry.c:1952: int *secfile_lookup_int_vec(const struct
section_file *secfile,
./utility/registry.c:1953:                             size_t *dim, const
char *path, ...)
   3230   food_ini = secfile_lookup_int_vec(file, (size_t *)
   3231                                     &,
   3232                                     "civstyle.granary_food_ini");


./utility/registry.c:1606: int *secfile_lookup_int_vec(struct section_file
./utility/registry.c:1607:                            int *dimen, const char
*path, ...)
   3082   food_ini = secfile_lookup_int_vec(&file,
   3083                                     "civstyle.granary_food_ini");

The function secfile_lookup_int_vec() is now broken (it was good in 2.2).

I think this is what is called "strict alignment". n-byte data types must be
n-byte aligned. is 4-byte aligned, and when cast to
a 8-byte data type causes the SIGBUS.


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to