1. 13 5月, 2012 4 次提交
  2. 11 5月, 2012 2 次提交
  3. 08 5月, 2012 6 次提交
  4. 07 5月, 2012 2 次提交
  5. 06 5月, 2012 2 次提交
    • R
      add isastream (obsolete STREAMS junk) · 106e75f7
      Rich Felker 提交于
      apparently some packages see stropts.h and want to be able to use
      this. the implementation checks that the file descriptor is valid by
      using fcntl/F_GETFD so it can report an error if not (as specified).
      106e75f7
    • N
      math: nextafter and nexttoward cleanup · 6cf865db
      nsz 提交于
      make nexttoward, nexttowardf independent of long double representation.
      fix nextafterl: it did not raise underflow flag when the result was 0.
      6cf865db
  6. 05 5月, 2012 4 次提交
    • R
      update license of njk contributed code (x86_64 asm) · 8cfbc8be
      Rich Felker 提交于
      these changes are based on the following communication via email:
      
      "I hereby grant that all of the code I have contributed to musl on or
      before April 23, 2012 may be licensed under the terms of the following
      MIT license:
      
      Copyright (c) 2011-2012 Nicholas J. Kain
      
      Permission is hereby granted, free of charge, to any person obtaining
      a copy of this software and associated documentation files (the
      "Software"), to deal in the Software without restriction, including
      without limitation the rights to use, copy, modify, merge, publish,
      distribute, sublicense, and/or sell copies of the Software, and to
      permit persons to whom the Software is furnished to do so, subject to
      the following conditions:
      
      The above copyright notice and this permission notice shall be
      included in all copies or substantial portions of the Software.
      
      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
      IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
      CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
      TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
      8cfbc8be
    • R
      make pthread stacks non-executable · 7e4d7946
      Rich Felker 提交于
      this change is necessary or pthread_create will always fail on
      security-hardened kernels. i considered first trying to make the stack
      executable and simply retrying without execute permissions when the
      first try fails, but (1) this would incur a serious performance
      penalty on hardened systems, and (2) having the stack be executable is
      just a bad idea from a security standpoint.
      
      if there is real-world "GNU C" code that uses nested functions with
      threads, and it can't be fixed, we'll have to consider other ways of
      solving the problem, but for now this seems like the best fix.
      7e4d7946
    • R
      fix error reporting for dlsym with global symbols · 4027f4e8
      Rich Felker 提交于
      4027f4e8
    • N
      math: change the formula used for acos.s · f697d66b
      nsz 提交于
      old: 2*atan2(sqrt(1-x),sqrt(1+x))
      new: atan2(fabs(sqrt((1-x)*(1+x))),x)
      improvements:
      * all edge cases are fixed (sign of zero in downward rounding)
      * a bit faster (here a single call is about 131ns vs 162ns)
      * a bit more precise (at most 1ulp error on 1M uniform random
      samples in [0,1), the old formula gave some 2ulp errors as well)
      f697d66b
  7. 04 5月, 2012 4 次提交
    • R
      fix uninitialized var in vfwprintf printing 0-prec string · db4096c5
      Rich Felker 提交于
      this could lead to spurious failures of wide printf functions
      db4096c5
    • R
      avoid setting nondefault scheduler too · b4560a6d
      Rich Felker 提交于
      b4560a6d
    • R
      implement stub versions of sched_* · 61be1cfe
      Rich Felker 提交于
      these actually work, but for now they prohibit actually setting
      priority levels and report min/max priority as 0.
      61be1cfe
    • R
      overhaul SSP support to use a real canary · 58aa5f45
      Rich Felker 提交于
      pthread structure has been adjusted to match the glibc/GCC abi for
      where the canary is stored on i386 and x86_64. it will need variants
      for other archs to provide the added security of the canary's entropy,
      but even without that it still works as well as the old "minimal" ssp
      support. eventually such changes will be made anyway, since they are
      also needed for GCC/C11 thread-local storage support (not yet
      implemented).
      
      care is taken not to attempt initializing the thread pointer unless
      the program actually uses SSP (by reference to __stack_chk_fail).
      58aa5f45
  8. 03 5月, 2012 1 次提交
    • R
      fix longstanding exit logic bugs in mbsnrtowcs and wcsnrtombs · 485fb14a
      Rich Felker 提交于
      these are POSIX 2008 (previously GNU extension) functions that are
      rarely used. apparently they had never been tested before, since the
      end-of-string logic was completely missing. mbsnrtowcs is used by
      modern versions of bash for its glob implementation, and and this bug
      was causing tab completion to hang in an infinite loop.
      485fb14a
  9. 01 5月, 2012 2 次提交
  10. 30 4月, 2012 6 次提交
  11. 29 4月, 2012 2 次提交
    • R
      8b711219
    • R
      new fnmatch implementation · 45b38550
      Rich Felker 提交于
      unlike the old one, this one's algorithm does not suffer from
      potential stack overflow issues or pathologically bad performance on
      certain patterns. instead of backtracking, it uses a matching
      algorithm which I have not seen before (unsure whether I invented or
      re-invented it) that runs in O(1) space and O(nm) time. it may be
      possible to improve the time to O(n), but not without significantly
      greater complexity.
      45b38550
  12. 27 4月, 2012 1 次提交
    • R
      update fnmatch to POSIX 2008 semantics · 2b87a5db
      Rich Felker 提交于
      an invalid bracket expression must be treated as if the opening
      bracket were just a literal character. this is to fix a bug whereby
      POSIX left the behavior of the "[" shell command undefined due to it
      being an invalid bracket expression.
      2b87a5db
  13. 25 4月, 2012 4 次提交
    • R
      gdb shared library debugging support · 3ec8d29c
      Rich Felker 提交于
      provide the minimal level of dynamic linker-to-debugger glue needed to
      let gdb find loaded libraries and load their symbols.
      3ec8d29c
    • R
      first attempt at enabling stack protector support · 60872cf9
      Rich Felker 提交于
      the code is written to pre-init the thread pointer in static linked
      programs that pull in __stack_chk_fail or dynamic-linked programs that
      lookup the symbol. no explicit canary is set; the canary will be
      whatever happens to be in the thread structure at the offset gcc
      hard-coded. this can be improved later.
      60872cf9
    • R
      ditch the priority inheritance locks; use malloc's version of lock · 4750cf42
      Rich Felker 提交于
      i did some testing trying to switch malloc to use the new internal
      lock with priority inheritance, and my malloc contention test got
      20-100 times slower. if priority inheritance futexes are this slow,
      it's simply too high a price to pay for avoiding priority inversion.
      maybe we can consider them somewhere down the road once the kernel
      folks get their act together on this (and perferably don't link it to
      glibc's inefficient lock API)...
      
      as such, i've switch __lock to use malloc's implementation of
      lightweight locks, and updated all the users of the code to use an
      array with a waiter count for their locks. this should give optimal
      performance in the vast majority of cases, and it's simple.
      
      malloc is still using its own internal copy of the lock code because
      it seems to yield measurably better performance with -O3 when it's
      inlined (20% or more difference in the contention stress test).
      4750cf42
    • R
      internal locks: new owner of contended lock must set waiters flag · e7655ed3
      Rich Felker 提交于
      this bug probably would have gone unnoticed since it's only used in
      the fallback code for systems where priority-inheritance locking
      fails. unfortunately this approach results in one spurious wake
      syscall on the final unlock, when there are no waiters remaining. the
      alternative (possibly better) would be to use broadcast wakes instead
      of reflagging the waiter unconditionally, and let each waiter reflag
      itself; this saves one syscall at the expense of invoking the
      "thundering herd" effect (worse performance degredation) when there
      are many waiters.
      
      ideally we would be able to update all of our locks to use an array of
      two ints rather than a single int, and use a separate counter system
      like proper mutexes use; then we could avoid all spurious wake calls
      without resorting to broadcasts. however, it's not clear to me that
      priority inheritance futexes support this usage. the kernel sets the
      waiters flag for them (just like we're doing now) and i can't tell if
      it's safe to bypass the kernel when unlocking just because we know
      (from private data, the waiter count) that there are no waiters. this
      is something that could be explored in the future.
      e7655ed3