aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-31Cygwin: Speed up dumperJon Turney1-9/+4
Stop after we've written the dump in response to the initial breakpoint EXCEPTION_DEBUG_EVENT we recieve for attaching to the process. (rather than bogusly sitting there for 20 seconds waiting for more debug events from a stopped process after we've already written the dump).
2020-07-31Cygwin: Remove synchronization event from dumperJon Turney1-12/+0
The use of the 'cygwin_error_start_event' for synchronization with dumper was removed from the DLL in commit 8abeff1e (April 2001).
2020-07-31Cygwin: Add --nokill dumper optionJon Turney2-4/+26
Add --nokill option to dumper, for compatibility with minidumper, and to assist with testing.
2020-07-29arm: Fix include to avoid undefined referenceSebastian Huber1-1/+1
ld: libm.a(lib_a-fesetenv.o): in function `fesetenv': newlib/libm/machine/arm/fesetenv.c:38: undefined reference to `vmsr_fpscr' Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2020-07-29arm: Split fenv.c into multiple filesEshan dhawan19-282/+696
Use the already existing stub files if possible. These files are necessary to override the stub implementation with the machine-specific implementation through the build system. Reviewed-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-07-29arm: Fix fenv supportEshan dhawan9-772/+127
The previous fenv support for ARM used the soft-float implementation of FreeBSD. Newlib uses the one from libgcc by default. They are not compatible. Having an GCC incompatible soft-float fenv support in Newlib makes no sense. A long-term solution could be to provide a libgcc compatible soft-float support. This likely requires changes in the GCC configuration. For now, provide a stub implementation for soft-float multilibs similar to RISC-V. Move implementation to one file and delete now unused files. Hide implementation details. Remove function parameter names from header file to avoid name conflicts. Provide VFP support if __SOFTFP__ is not defined like glibc. Reviewed-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
2020-07-28Cygwin: Decorate NtQueryVirtualMemory() to fix 32-bit buildJon Turney1-1/+1
Decorate NtQueryVirtualMemory() with NTAPI (for stdcall) to fix 32-bit build. Reported-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2020-07-27riscv: fix integer wraparound in memcpyPkmX via Newlib1-2/+2
This patch fixes a bug in RISC-V's memcpy implementation where an integer wraparound occurs when src + size < 8 * sizeof(long), causing the word-sized copy loop to be incorrectly entered. Signed-off-by: Chih-Mao Chen <cmchen@andestech.com>
2020-07-24fhandler_proc.cc(format_proc_cpuinfo): add flags and TLB sizeBrian Inglis1-42/+255
update to Linux-next 5.8 order fields and flags: add amd_dcm, arch_lbr, arch_perfmon, art, cpuid, extd_apicid, ibpb, ibrs, ibrs_enhanced, nonstop_tsc_s3, nopl, rep_good, ring3mwait, ssbd, stibp, tsc_known_freq, tsc_reliable, xtopology flags; add TLB size line; add ftuprint macro for feature test unconditional flag print; add commented out flags requiring CR or MSR access in print order with comment explaining issue; make cpuid leaf numbers consistent 8 hex digits for searching
2020-07-22Cygwin: mmap: Remove AT_ROUND_TO_PAGE workaroundCorinna Vinschen2-106/+43
It's working on 32 bit OSes only anyway. It even fails on WOW64. Drop unsupported NtMapViewOfSection flags. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-21Cygwin: mmap: document recent bugfixKen Brown1-0/+3
2020-07-21Cygwin: Use MEMORY_WORKING_SET_EX_INFORMATION in dumperJon Turney3-8/+65
Use the (undocumented) MEMORY_WORKING_SET_EX_INFORMATION in dumper to determine if a MEM_IMAGE region is unsharable, and hence has been modified. After this, we will end up dumping memory regions where: - state is MEM_COMMIT (i.e. is not MEM_RESERVE or MEM_FREE), and -- type is MEM_PRIVATE and protection allows reads (i.e. not a guardpage), or -- type is MEM_IMAGE and attribute is non-sharable (i.e. it was WC, got written to, and is now a RW copy)
2020-07-21Cygwin: Don't dump non-writable image regionsJon Turney1-0/+6
After this, we will end up dumping memory regions where: - state is MEM_COMMIT (i.e. is not MEM_RESERVE or MEM_FREE), and -- type is MEM_PRIVATE and protection allows reads (i.e. not a guardpage), or -- type is MEM_IMAGE and protection allows writes Making this decision based on the current protection isn't 100% correct, because it may have been changed using VirtualProtect(). But we don't know how to determine if a region is shareable. (As a practical matter, anything which gets us the stack (MEM_PRIVATE) and .data/.bss (RW MEM_IMAGE) is going to be enough for 99% of cases)
2020-07-21Cygwin: Drop excluded regions list from dumperJon Turney2-61/+4
Drop excluded regions, now it's always empty
2020-07-21Cygwin: Remove reading of PE for section flags from dumperJon Turney4-114/+3
2020-07-21Cygwin: Show details of all memory regions in dumper debug outputJon Turney1-21/+80
2020-07-20Cygwin: mmap: constify pagesize throughoutCorinna Vinschen1-8/+8
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-20Cygwin: mmap: fix mapping beyond EOF on 64 bitKen Brown1-0/+1
Commit 605bdcd410384dda6db66b9b8cd19e863702e1bb enabled mapping beyond EOF in 64 bit environments. But the variable 'orig_len' did not get rounded up to a multiple of 64K. This rounding was done on 32 bit only. Fix this by rounding up orig_len on 64 bit, in the same place where 'len' is rounded up. Rounding up is needed to make sigbus_page_len a multiple of the allocation granularity. In addition, failing to round up could cause orig_len to be smaller than len. Since these are both unsigned values, the statement 'orig_len -= len' could then cause orig_len to be huge, and mmap would fail with errno EFBIG. I observed this failure while debugging the problem reported in https://sourceware.org/pipermail/cygwin/2020-July/245557.html. The failure can be seen by running the test case in that report under gdb or strace.
2020-07-20Cygwin: pty: Fix a bug on redirecting something to /dev/pty*.Takashi Yano via Cygwin-patches1-5/+0
- After commit 0365031ce1347600d854a23f30f1355745a1765c, key input becomes not working by following steps. 1) Start cmd.exe in mintty. 2) Open another mintty. 3) Execute "echo AAA > /dev/pty*" (pty* is the pty opened in 1.) This patch fixes the issue.
2020-07-20Cygwin: sockets: Rearrange check for connect failureCorinna Vinschen1-9/+7
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-16Cygwin: FIFO: document recent fixesKen Brown1-0/+3
2020-07-16Cygwin: FIFO: update commentaryKen Brown1-4/+17
2020-07-16Cygwin: FIFO: clean upKen Brown1-6/+4
Remove the fhandler_fifo::get_me method, which is no longer used. Make the methods get_owner, set_owner, owner_lock, and owner_unlock private.
2020-07-16Cygwin: FIFO: allow take_ownership to be interruptedKen Brown3-8/+59
Use cygwait in take_ownership to allow interruption while waiting to become owner. Return the cygwait return value or a suitable value to indicate an error. raw_read now checks the return value and acts accordingly.
2020-07-16Cygwin: fhandler_fifo::take_ownership: don't set event unnecessarilyKen Brown1-1/+4
Don't set update_needed_evt if there's currently no owner. This will cause unnecessary churn once I'm the owner and am listening for connections.
2020-07-16Cygwin: FIFO: add missing lockKen Brown1-0/+2
2020-07-16Cygwin: FIFO: make certain errors non-fatalKen Brown1-11/+10
If update_my_handlers fails to duplicate one or more handles, just mark the corresponding handlers as being in an error state. But if update_my_handlers is unable to open the process of the previous owner, it's likely that something serious has gone wrong, so we continue to make that a fatal error.
2020-07-16Cygwin: FIFO: fix indentationKen Brown1-84/+84
2020-07-16Cygwin: FIFO: improve taking ownership in fifo_reader_threadKen Brown1-21/+23
When a reader takes ownership in fifo_reader_thread, it now goes directly to the part of the main loop that listens for a connection. Previously it went back to the beginning of the loop. Also, if the reader has to delay taking ownership because the previous owner has not finished updating the shared fifo_client handlers, it now checks to see if cancel_evt has been set. Previously it might have had to spin its wheels unnecessarily only to eventually find that its thread had been canceled.
2020-07-16Cygwin: FIFO: reduce I/O interleavingKen Brown2-8/+50
Add a bool member 'last_read' to the fifo_client_handler structure, which is set to true on a successful read. This is used by raw_read as follows. When raw_read is called, it first locates the writer (if any) for which last_read is true. raw_read tries to read from that writer and returns if there is input available. Otherwise, it proceeds to poll all the writers, as before. The effect of this is that if a writer writes some data that is only partially read, the next attempt to read will continue to read from the same writer. This should reduce the interleaving of output from different writers.
2020-07-16Cygwin: fhandler_fifo::hit_eof: improve reliabilityKen Brown3-30/+6
Use the writer count introduced in the previous commit to help detect EOF. Drop the maybe_eof method, which is no longer needed.
2020-07-16Cygwin: FIFO: keep a writer count in shared memoryKen Brown2-166/+124
When a reader opens, it needs to block if there are no writers open (unless is is opened with O_NONBLOCK). This is easy for the first reader to test, since it can just wait for a writer to signal that it is open (via the write_ready event). But when a second reader wants to open, all writers might have closed. To check this, use a new '_nwriters' member of struct fifo_shmem_t, which keeps track of the number of open writers. This should be more reliable than the previous method. Add nwriters_lock to control access to shmem->_nwriters, and remove reader_opening_lock, which is no longer needed. Previously only readers had access to the shared memory, but now writers access it too so that they can increment _nwriters during open/dup/fork/exec and decrement it during close. Add an optional 'only_open' argument to create_shmem for use by writers, which only open the shared memory rather than first trying to create it. Since writers don't need to access the shared memory until they have successfully connected to a pipe instance, they can safely assume that a reader has already created the shared memory. For debugging purposes, change create_shmem to return 1 instead of 0 when a reader successfully opens the shared memory after finding that it had already been created. Remove check_write_ready_evt, write_ready_ok_evt, and check_write_ready(), which are no longer needed. When opening a writer and looping to try to get a connection, recheck read_ready at the top of the loop since the number of readers might have changed. To slightly speed up the process of opening the first reader, take ownership immediately rather than waiting for the fifo_reader_thread to handle it.
2020-07-16Cygwin: FIFO: fix problems finding new ownerKen Brown2-33/+61
When the owning reader closes and there are still readers open, the owner needs to wait for a new owner to be found before closing its fifo_client handlers. This involves a loop in which dec_nreaders is called at the beginning and inc_nreaders is called at the end. Any other reader that tries to access shmem->_nreaders during this loop will therefore get an inaccurate answer. Fix this by adding an nreaders method and using it instead of dec_nreaders and inc_nreaders. Also add nreaders_lock to control access to the shmem->_nreaders. Make various other changes to improve the reliability of finding a new owner.
2020-07-16ctype.h: Fix unused variable warningsAschref Ben Thabet1-4/+9
If __HAVE_LOCALE_INFO__ is not defined, then the locale in the locale-specific ctype functions is ignored. In the previous implementation this resulted in compiler warnings. For example: int main() { locale_t locale; locale = duplocale(uselocale((locale_t)0)); isspace_l('x', locale); return 0; } gcc -Wall main.c main.c: In function 'main': main.c:6:11: warning: variable 'locale' set but not used [-Wunused-but-set-variable] 6 | locale_t locale; | ^~~~~~
2020-07-16Cygwin: document previous poll/select patchCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-16Cygwin: make sure failed sockets always signal writabilityMarc Hoersken1-0/+6
Since FD_CONNECT is only given once, we manually need to set FD_WRITE for connection failed sockets to have consistent behaviour in programs calling poll/select multiple times. Example test to non-listening port: curl -v 127.0.0.1:47
2020-07-13Cygwin: FAQ 1.6: Update "Who's behind the project?"Brian Inglis1-17/+16
winsup/doc/faq-what.xml: remove Red Hat, Net, Win32 references and clean up
2020-07-13Cygwin: FAQ 1.5: Clarify "What version is this"Brian Inglis1-10/+19
Patch to: https://sourceware.org/git/?p=newlib-cygwin.git;f=winsup/doc/faq-what.xml;a=blob as a result of thread: https://cygwin.com/pipermail/cygwin/2020-July/245442.html and comments: https://cygwin.com/pipermail/cygwin-patches/2020q3/010331.html Relate Cygwin DLL to Unix kernel, add required options to command examples, differentiate Unix and Cygwin commands; mention that the cygwin package contains the DLL, replace setup.exe reference by Cygwin Setup program wording.
2020-07-12Cygwin: Make dumper scan more than first 4GB of VM on x86_64Jon Turney1-2/+2
It's unclear that we need an end address here at all, or can just rely on VirtualQueryEx() failing when we reach the end of memory regions.
2020-07-12Cygwin: Add a new win32_pstatus data type for modules on x86_64Jon Turney2-4/+16
Also take a bit more care with sizes in other data types to ensure they are the same on x86 and x86_64. Add some explanatory comments.
2020-07-12Cygwin: Update ELF target used by dumper on x86_64Jon Turney1-2/+8
Like [1], but actually making the effort to be 'usable' and 'tested'. [1] https://cygwin.com/pipermail/cygwin/2019-October/242815.html
2020-07-12Cygwin: Slightly improve error_start documentationJon Turney1-1/+5
2020-07-10testsuite: Fix iconv tests to use new encoding config definesKeith Packard via Newlib3-48/+47
_ICONV_CONVERTER -> ICONV_FROM_ENCODING. It's not perfect, as the library can support different from/to encodings now, but at least in the default configurations the tests now work. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-07-10libc/iconv: find_alias was mis-computing remaining alias table lengthKeith Packard via Newlib1-1/+1
This caused the strnstr to walk off the end of the alias array and fetch invalid data. Instead of attempting to update 'len', just re-compute it based on the table end pointer that is already known. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-07-10libc/iconv: Remove unneeded pointer var for _iconv_aliasesKeith Packard via Newlib2-6/+3
The pointer value for the iconv alias data never changes, so get rid of the pointer and make it an array instead. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-07-10libc/iconv: Detect CES handler loading failureKeith Packard via Newlib1-1/+1
Fix the code checking for character set loading failure so that it checks the return value from the init function. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-07-10Fix invalid acl_entry_t on 32-bit CygwinDavid Allsopp2-1/+5
If the acl_t struct was at or above 0x80000000 then the pointer was sign-extended to 0xffff_ffff_8000_0000 and so the index was lost. Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2020-07-10Cygwin: convert sys_wcstombs/sys_mbstowcs wrapper to inline functionsCorinna Vinschen4-66/+62
This should slightly speed up especially path conversions, given there's one less function call rearranging all function arguments in registers/stack (and less stack pressure). For clarity, rename overloaded sys_wcstombs to _sys_wcstombs and sys_cp_mbstowcs to _sys_mbstowcs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-09Cygwin: Bump DLL version to 3.1.7Corinna Vinschen1-1/+1
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-07-09Cygwin: add microcode patch to release messagescygwin-3_1_6-releaseCorinna Vinschen1-0/+3
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>