Commit Graph

11465 Commits

Author SHA1 Message Date
Corinna Vinschen 9d32147e35 cygwin CONTRIBUTORS: Add Daniel Santos
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-25 14:26:36 +02:00
Jon Turney fe7a7709ef Fix transposed lines in 2.8.1 release text 2017-04-24 17:17:38 +01:00
Jon Turney 2980e76ae3 Update 2.8.1 release text 2017-04-24 17:13:04 +01:00
Corinna Vinschen fccaaee026 cygwin: add 2.8.1 release file
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 17:36:54 +02:00
Corinna Vinschen 7437d656cb cygwin TEST: Add nagging debug output to pinfo
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 17:35:06 +02:00
Corinna Vinschen 5ef0399ddd cygwin: pinfo: do not wait for setting ppid on a transitional procinfo
This leads to excessive lag when stracing processes if the inferior
process checks the process table.  The reason is that ppid isn't set
in the procinfo memory of the dynamically loading strace itself.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 17:34:31 +02:00
Corinna Vinschen ffcfbf4b66 cygwin: try unprivileged symlink creation on W10 1703 and later
Add new SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE flag to
CreateSymbolicLinkW call when running on W10 1703 or later.
Don't do that on older versions to avoid ERROR_INVALID_PARAMETER.

Preliminary, needs testing.  There's an off-chance that the
flag results in the same ERROR_INVALID_PARAMETER on 1703 if the
developer settings are not enabled.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 17:17:29 +02:00
Corinna Vinschen e7bcf4633e cygwin: wincap: handle W10 1703
Add has_unprivileged_createsymlink flag and set to true on 1703 and
later.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 17:14:03 +02:00
Corinna Vinschen 63f19278b9 cygwin: wincap: fix evaluation of build number
RtlGetNtVersionNumbers returns the build number with some upper bits
set for no apparent reason.  The fact that RtlGetNtVersionNumbers is
undocumented doesn't exactly help.

Just filter out the upper WORD for now.  If build numbers are in
danger to become 6 digit numbers, re-evaluate.
2017-04-24 17:12:16 +02:00
Corinna Vinschen 3885c06c4f cygwin: remov unused winpids constructor
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-24 14:22:02 +02:00
Christian Franke b8523353d7 Fix stat.st_blocks for files compressed with CompactOS method
Always retrieve FileCompressionInformation for non-empty
files if FileStandardInformation returns 0 allocated blocks.
This fixes stat.st_blocks for files compressed with CompactOS method.

Signed-off-by: Christian Franke <franke@computer.org>
2017-04-22 16:12:36 +02:00
Brian Inglis 8e0876727b cygwin doc: Add postinstall/preremove scripts to install Start Menu entries
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-22 14:02:33 +02:00
Corinna Vinschen 0ee8e0d93d cygwin CONTRIBUTORS: Add Brian Inglis
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-22 14:02:33 +02:00
Corinna Vinschen 529110deba cygwin doc: install-html: Fix docbook.css and index.html symlink installation
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-22 14:02:33 +02:00
Jon Turney 17b85c59bf Update URLs for Cygwin packaging information
Also:
Remove obsolete reference to g-b-s
Remove mention of ancient pre-invisiconsole behaviour of setup scripts

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-04-20 15:28:06 +01:00
Daniel Santos b43e28aef0 strace: Fix "over-optimization" flaw in strace.
Recent versions of gcc are optimizing away the TLS buffer allocated in
main, so we need to tell gcc that it's really used.  RtlSecureZeroMemory
accomplishes this while also inlining the memset.

Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
2017-04-19 20:17:04 +02:00
Corinna Vinschen fe86ad29d6 cygwin doc: install-html: install docbook.css
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-19 10:09:16 +02:00
Corinna Vinschen 7f13f08701 cygwin doc: install-html: link index.html instead of copying
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-19 10:08:28 +02:00
Corinna Vinschen bdb017b30c newlib: remove __infinity{f,ld} constants
previous commit 4c90db7bc8 introduced
a compile time error because libm/common/s_infconst.c used the remove
__fmath, __dmath, and __ldmath union types.

Since this is very old, and unused for a very long time, just drop the
file and thus the __infinity constants entirely.

Exception: Cygwin exports __infinity from the beginning.  There's a very,
VERY low probability that any existing executable or lib still uses this
constant, but we just keep it in for backward compat, nevertheless.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-18 12:17:26 +02:00
Jon Turney c84697c259 Avoid decimal point localization in /proc/loadavg
Explicitly format the contents of /proc/loadavg to avoid the decimal point
getting localized according to LC_NUMERIC. Using anything other than '.' is
wrong and breaks top.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-04-10 10:59:54 +01:00
Mark Geisert c6c7dfc493 mkvers.sh: Remove "function" to avoid dash objecting to bash-ism. 2017-04-06 18:17:08 +02:00
Jon Turney a9da3e4e67 Make ldd stop after any non-continuable exception
Ensure that ldd always stops when the exception is flagged as
non-continuable.

Also arrange for ldd to exit with a non-zero exit code if something went
wrong which prevented us from listing all dynamic dependencies.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-04-04 18:47:44 +01:00
Corinna Vinschen 961a6909d9 Cygwin: Export reallocarray
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-04 12:23:18 +02:00
Corinna Vinschen 6f88e6b2d5 Bump Cygwin to 2.8.1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-04 12:23:09 +02:00
Corinna Vinschen 577c9d55da Add latest changes to Cygwin release information
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-28 13:42:11 +02:00
Corinna Vinschen b5b03d2d5f Change CURR_SHARED_MAGIC to account for getloadavg patch
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-28 13:41:31 +02:00
Jon Turney d0a359f6d2 Implement getloadavg()
v2:
autoload PerfDataHelper functions
Keep loadavg in shared memory
Guard loadavg access by a mutex
Initialize loadavg to the current load

v3:
Shared memory version bump isn't needed if we are only extending it
Remove unused autoload
Mark inititalized flags as NO_COPY for correct behaviour in fork child

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-27 22:03:58 +01:00
Jon Turney b568f92c50 declaration of ppoll() by poll.h should be guarded by _GNU_SOURCE
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-03-27 22:03:01 +01:00
Corinna Vinschen bbffd7ce7a Recognize Netapp mode supporting reparse points
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-27 20:28:03 +02:00
Corinna Vinschen fa4fcf7373 cygwin: Do not generate surrogate chars on netapp
Just like Samba, Netapp FSes seem to dislike invalid surrogate usage in
filenames.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 20:52:25 +01:00
Corinna Vinschen 0accc5332a Document cygserver changes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 18:13:08 +01:00
Corinna Vinschen 663b4ab824 cygserver: Speed up non-debug scenario
_log/_vlog were always called so we always had a function call hit even
if we're not debugging.  Expand on the debugging macros so the decision
to call _log/_vlog is done in the caller already.  Also, make a log level
difference between syscall_printf and system_printf.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 17:55:36 +01:00
Corinna Vinschen 4dbcfeb7d0 cygserver: Small code cleanup
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 17:53:40 +01:00
Corinna Vinschen b80b2c0119 cygserver: Revamp thread sleep handling
The current implementation is a very simple approach to implement
a statically sized sleep queue.  The problem is that this code requires
a certain amount of synchronization because the slots in the queue are
used dynamically.  To top it off, the Event objects used for sync'ing
are created and destroyed on demand.  This is complicated, slow, and
error prone.

There's also a blatant bug here: The number of slots in the queue was
wrongly computed in size.  It was too small if XSI IPC was used a lot.

Make the code more robust.  Let the queue have the right size.  Every
slot is now used for a specific IPC object.  All sync objects (switched
to Semaphores) are only created when first required, but never destroyed.
This reduces the usage of a critical section to the creation of a new
sync object.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 17:53:34 +01:00
Corinna Vinschen 0b73dba4de cygserver: raise number of worker threads on demand
The number of threads in the worker pool is fixed so far.  This is a
problem in XSI IPC scenarions with an unknown number of consumers.
It doesn't make sense to make the pool very big for a start, but when
the need arises, we need to make sure we can serve the request even if
all other worker threads are in a wait state.

This patch changes threaded_queue to just add another worker thread
if all current workers are busy.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 16:18:26 +01:00
Corinna Vinschen 838eaf6674 cygserver: Only print basename of source in debug output to raise readability
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 16:12:52 +01:00
Corinna Vinschen 8d6a522877 cygserver: Seralize debug output to stdout to raise readability
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-24 16:12:00 +01:00
Corinna Vinschen 8259db586a dlfcn: Remove stray debug output
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-22 11:10:15 +01:00
Yaakov Selkowitz 90e35b1eb3 Rename <sys/_locale.h> to <xlocale.h>
The locale_t type is provided by <xlocale.h> on Linux, FreeBSD, and Darwin.
While, like on some of those systems, it is automatically included by
<locale.h> with the proper feature test macros, its presence under this
particular name is still presumed in real-world software.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-03-22 10:03:45 +01:00
Corinna Vinschen 33297d810d Cygwin: dlfcn: Fix reference counting
The original dll_init code was living under the wrong assumption that
dll_dllcrt0_1 and in turn dll_list::alloc will be called for each
LoadLibrary call.  The same wrong assumption was made for
cygwin_detach_dll/dll_list::detach called via FreeLibrary.

In reality, dll_dllcrt0_1 gets only called once at first LoadLibrary
and cygwin_detach_dll once at last FreeLibrary.

In effect, reference counting for DLLs was completely broken after fork:

  parent:
    l1 = dlopen ("lib1");  // LoadLibrary, LoadCount = 1
    l2 = dlopen ("lib1");  // LoadLibrary, LoadCount = 2

    fork ();               // LoadLibrary in the child, LoadCount = 1!
      child:
        dlclose (l1);      // FreeLibrary actually frees the lib
        x = dlsym (l2);    // SEGV

* Move reference counting to dlopen/dlclose since only those functions
  have to keep track of loading/unloading DLLs in the application context.

* Remove broken accounting code from dll_list::alloc and dll_list::detach.

* Fix error handling in dlclose.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-21 14:31:03 +01:00
Corinna Vinschen 778f4397f3 Add release message for commit 973f766f6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-14 16:54:57 +01:00
Corinna Vinschen 73d3f9cf20 Revert "Add release message for commit 973f766f6"
This reverts commit 125852d77b.

Accidentally commited too much.
2017-03-14 16:52:20 +01:00
Corinna Vinschen 125852d77b Add release message for commit 973f766f6
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-14 09:24:48 +01:00
Corinna Vinschen 02011278e0 Extend 2.8.0 release text
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12 12:21:40 +01:00
Corinna Vinschen dd757cc43a Implement fhandler_dev_null::write to workaround a problem with NUL
Windows NUL device returns only the lower 32 bit of the number of
bytes written.  Implement a fake write function to ignore the underlying
NUL device.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12 12:17:43 +01:00
Corinna Vinschen a3f297d3c2 Return value from write is ssize_t, not int
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-12 12:16:23 +01:00
Yaakov Selkowitz 6c420fa494 getrandom: it's MIN, not MAX
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-11 10:03:29 +01:00
Corinna Vinschen c9e4b69e9f Belatedly bump Cygwin DLL version to 2.8.0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10 20:50:35 +01:00
Corinna Vinschen 45d0d75910 Drop now unused child_info_fork::from_main
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10 20:45:19 +01:00
Corinna Vinschen 48755fb9bc fork: Don't copy _main_tls->local_clib from *_impure_ptr
So far we copy *_impure_ptr into _main_tls->local_clib if the child
process has been forked from a pthread.  But that's not required.
The local_clib area of the new thread is on the stack and the stack
gets copied from the parent anyway (in frok::parent).  So we only
have to make sure _main_tls is pointing to the right address and
do the simple post-fork thread init.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-03-10 20:44:53 +01:00