Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 13 Jul 2011 15:52:59 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: cluts review

On Wed, Jul 13, 2011 at 09:52:01PM +0400, Solar Designer wrote:
> I think you're confusing things.  Maybe Rich suggested that you use
> sigaction() instead of signal()?  That's fine, but it has nothing to do
> with the choice of setjmp() vs. sigsetjmp().

You should always use sigaction instead of signal because the latter
leaves too much implementation-defined to be useful. With that said,
let's just drop this bikeshed. sigsetjmp/siglongjmp are just as easy
to use and it's more certain that they'll work in the presence of
buggy implementations, so let's go with them.

> > This reminds me, the code is distinctly C99, and it tests SUSv4 
> > functions, so if you don't mind, for cluts, I'll use those two standards 
> 
> I am fine with limiting cluts to newer systems if Rich is fine with that.

I think it's reasonable for now, but at some point it might be worth
evaluating the level of dependency and reducing it if anyone wants to
test older libraries. I don't think there's any use in avoiding C99
features that are purely at the compiler level (like compound
literals) because any current or future compiler capable of being used
on unix-like systems will support these.

> > Oh, and I do believe I know aht "clobbered" means (overwriting the new 
> > value of the variable with the old one, from when the context was saved, 
> > right?).
> 
> Yes.  Do you know in what cases this happens, and how to prevent it?

Actually saying it's "clobbered" is an understatement. Breaking the
rules invokes undefined behavior, and in at least one real-world case,
gcc generated code that performed a memory read from something like
0x60 (absolute address) instead of 0x60(%esp). Don't ask me why;
that's UB. Proper code should not invoke UB.

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.