Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160204154137.GN9349@brightrain.aerifal.cx>
Date: Thu, 4 Feb 2016 10:41:38 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: setcontext/getcontext/makecontext missing?

On Thu, Feb 04, 2016 at 03:54:09PM +0100, Szabolcs Nagy wrote:
> * Short, Todd <tshort@...mai.com> [2016-02-04 14:09:30 +0000]:
> > 
> > It appears that setcontext/getcontext/makecontext are declared in
> > ./include/ucontext.h, but there???s no definitions for them in
> > musl. These three functions are part of libc/glibc.so:
> > 
> 
> these are deprecated posix apis.
> 
> > Since the functions are declared, is there any intent to put them into musl?
> > 
> 
> they have unclear semantics and only possible to
> implement in asm (hence it is a significant effort
> to add them).

There's been some interest in adding them and they were on a long-term
goal list, but I'm not sure it makes sense anymore. All the major
users of this API have been moving _off_ of it, because it's
deprecated and impossible to use correctly - see the rationale here:

http://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html

So it's rather unfortunate (but typical OpenSSL nonsense) that they've
adding a new use of it.

> > I ran into this when attempting to compile OpenSSL with musl. In
> > the OpenSSL master branch, I???m able to do:
> > 
> > CC=musl-gcc ./config
> > make depend
> > make
> > 
> > However, ld fails because there is an undefined reference to
> > setcontext, getcontext and makecontext. This is new async
> > functionality in OpenSSL that uses these APIS.
> > 
> 
> imho that's an openssl bug.
> 
> if they really need the *context apis, then use adequate
> (link-time) configure check for them.

Agree strongly. There's at least one other major POSIX/POSIX-like
system that lacks them.

> but looking at
> http://git.openssl.org/?p=openssl.git;a=commit;h=a3667c316ae60ef454fb804221c3ca44af30a9aa
> this async lib is probably misguided, but they can
> implement the api with pthreads in a portable way.

Indeed.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.