Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161105202558.GK5749@port70.net>
Date: Sat, 5 Nov 2016 21:25:59 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: George Kulakowski <kulakowski@...gle.com>
Cc: musl@...ts.openwall.com
Subject: ub fix in magenta

why do you think union based type punning is ub?
are you compiling musl as c++ code?

commit 224516687417d5e9dcbb0ba300c3e34bb47bb12b
Author: George Kulakowski <kulakowski@...gle.com>
Date:   2016-10-19 17:11:59 -0700

    [musl][malloc] Remove undefined behavior in malloc
    
    This bit of code computes an approximation to log2(x) by extracting the
    exponent from a float. Doing it via a union this way is bad, so memcpy
    instead.

https://fuchsia.googlesource.com/magenta/+/224516687417d5e9dcbb0ba300c3e34bb47bb12b


this makes implementation internals publicly visible, introduce
paddings and whenever you need to add new fields you will have
to break the abi again.

note that the initializers are not valid c and thus non-conforming.

commit c751172f029e96a3208b37da91fd9e020a792834
Author: George Kulakowski <kulakowski@...gle.com>
Date:   2016-10-13 21:31:24 -0700

    [musl] Use a single proper struct definition for pthread types
    
    There is one slight change in layout here made for simplicity's
    sake. Upstream's pthread_barrier_t overlays the _b_count and _b_inst
    fields in the 32 bit case. Since this is so rarely used (in Fuchsia
    outside of libc I pretty much only see tsan, gdb etc. test cases),
    just do the simple thing.

https://fuchsia.googlesource.com/magenta/+/c751172f029e96a3208b37da91fd9e020a792834

(i don't plan to review all changes i just wanted to see if there
was anything useful in the magenta repo for musl, havent found much
yet, but some of the changes could have been discussed upstream)

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.