NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Emacsen segfaulting on startup



On Tue, Jan 28, 2014 at 11:06:12AM -0500, Thor Lancelot Simon wrote:
> On Tue, Jan 28, 2014 at 09:33:27AM +0000, Matthias Scheler wrote:
> > 
> > This is nothing that NetBSD can ensure. A good example is the 64-bit
> > time_t change in NetBSD 6.0. If you compile a shared library and a
> > program using this type under NetBSD 5.0 they will use a 32-bit time_t.
> > If you now recompile *one* of those two under NetBSD 6.0 it will start
> > using 64-bit time_t-s. And as a result it is no longer compatible with
> > the NetBSD 5.0 library or program. This will definitely result in crashes.
> 
> All the libraries involved _should_ have appropriately renamed
> symbols for any function taking time_t or different library major
> version numbers.

Yes, all the NetBSD base-system libraries. But imagine a pkgsrc package
with a shared library whose API contains something like this:

struct foo {
        time_t when;
        const char *what;
};

extern void bar(const struct foo *);

If you now recompile the package with that shared library under
NetBSD 6.0 the size and layout of "struct foo" will change. An
application in *another* package which wasn't recompiled will
very likely trigger a crash when calling bar() because it used
the old layout of "struct foo".

        Kind regards

-- 
Matthias Scheler                                  http://zhadum.org.uk/


Home | Main Index | Thread Index | Old Index