summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
...
* Add accidentally missing ChangeLog entry for previous patchCorinna Vinschen2015-07-071-0/+16
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* x86_64: Handle myfault exceptions when running on alternate signal stackCorinna Vinschen2015-07-075-2/+71
| | | | | | | | | | | | | | | | | | x86_64 only: * cygtls.cc (san::leave): Restore _my_tls.andreas. * cygtls.h (class san): Add _clemente as in 32 bit case. Add ret and frame members. (san::san): Handle _my_tls.andreas as on 32 bit. Take parameter and write it to new member ret. Store current stack pointer in frame. (san::~san): New destructor to restore _my_tls.andreas. (__try): Use __l_except address as parameter to san::san. * dcrt0.cc (dll_crt0_0): Add myfault_altstack_handler as vectored continuation handler. * exception.h (myfault_altstack_handler): Declare. * exceptions.cc (myfault_altstack_handler): New function. Explain what it's good for. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Simplify stack allocation code in child after forkCorinna Vinschen2015-07-073-69/+68
| | | | | | | | | | | | | * child_info.h (CURR_CHILD_INFO_MAGIC): Update. (child_info_fork::alloc_stack_hard_way): Drop declaration. * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fold into child_info_fork::alloc_stack. (getstack): Remove. (child_info_fork::alloc_stack): Simplify check for application-provided stack in "hard way" code. Don't call getstack for each page, just reallocate stack immediately as required. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Simplify fork code setting up child stack infoCorinna Vinschen2015-07-072-29/+25
| | | | | | | * fork.cc (frok::parent): Simplify code propagating stack setup to child process. Tweak comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* winsup/cygwin: rework basename redefinition handling in path.ccYaakov Selkowitz2015-07-062-3/+11
| | | | | | This fixes the compile after commit 79e419de6261c4e04785908828096cb4d56b8680. * path.cc: Rework basename redefinition handling. Explain why.
* Align hard stack allocation to pthread stack setup changesCorinna Vinschen2015-07-052-11/+23
| | | | | | | | * dcrt0.cc (CYGWIN_GUARD): Remove. (child_info_fork::alloc_stack_hard_way): Align stack commit to changes of thread stack setup in CygwinCreateThread. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement correct RLIMIT_STACK handlingCorinna Vinschen2015-07-056-71/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * miscfuncs.cc (struct pthread_wrapper_arg): Add member guardsize. (pthread_wrapper): Set thread stack guarantee according to guardsize. Tweak assembler code so that $rax/$eax is not required by GCC to prepare the wrapper_arg value. (CygwinCreateThread): Fix deadzone handling. Drop setting a "POSIX" guardpage (aka page w/ PAGE_NOACCESS). Always use Windows guard pages instead. On post-XP systems (providing SetThreadStackGuarantee) always set up stack Windows like with reserved/commited areas and movable guard pages. Only on XP set up stack fully commited if the guardpage size is not the default system guardpage size. Fill out pthread_wrapper_arg::guardsize. Improve comments. * resource.cc: Implement RSTACK_LIMIT Linux-like. (DEFAULT_STACKSIZE): New macro. (DEFAULT_STACKGUARD): Ditto. (rlimit_stack_guard): New muto. (rlimit_stack): New global variable holding current RSTACK_LIMIT values. (__set_rlimit_stack): Set rlimit_stack under lock. (__get_rlimit_stack): Initialize rlimit_stack from executable header and return rlimit_stack values under lock. (get_rlimit_stack): Filtering function to return useful default stacksize from rlimit_stack.rlim_cur value. (getrlimit): Call __get_rlimit_stack in RLIMIT_STACK case. (setrlimit): Call __set_rlimit_stack in RLIMIT_STACK case. * thread.cc (pthread::create): Fetch default stacksize calling get_rlimit_stack. (pthread_attr::pthread_attr): Fetch default guardsize calling wincap.def_guard_page_size. (pthread_attr_getstacksize): Fetch default stacksize calling get_rlimit_stack. * thread.h (PTHREAD_DEFAULT_STACKSIZE): Remove. (PTHREAD_DEFAULT_GUARDSIZE): Remove. (get_rlimit_stack): Declare. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Disable fetching heap info on 64 bit XP/2003Corinna Vinschen2015-07-055-1/+27
| | | | | | | | | | * fhandler_process.cc (heap_info::heap_info): Disable fetching heap info on 64 bit XP/2003. Explain why. * wincap.h (wincaps::has_broken_rtl_query_process_debug_information): New element. * wincap.cc: Implement above element throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add missing wincap changes to previous ChangeLog entryCorinna Vinschen2015-07-051-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix original stack when running signal handler on alternate stackCorinna Vinschen2015-07-048-134/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (SetThreadStackGuarantee): Import. * cygtls.h (struct _cygtls): Replace thread_context with a ucontext_t called context. * exceptions.cc (exception::handle): Exit from process via signal_exit in case sig_send returns from handling a stack overflow SIGSEGV. Explain why. (dumpstack_overflow_wrapper): Thread wrapper to create a stackdump from another thread. (signal_exit): Fix argument list to reflect three-arg signal handler. In case we have to create a stackdump for a stack overflow condition, do so from a separate thread. Explain why. (sigpacket::process): Don't run signal_exit on alternate stack. (altstack_wrapper): Wrapper function to do stack correction when calling the signal handler on an alternate stack to handle a stack overflow. Make sure to have lots of comments. (_cygtls::call_signal_handler): Drop local context variable to reduce stack pressure. Use this->context instead. Change inline assembler to call altstack_wrapper. (_cygtls::signal_debugger): Accommodate aforementioned change to struct _cygtls. * tlsoffset.h: Regenerate. * tlsoffset64.h: Regenerate. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document previous changeCorinna Vinschen2015-07-011-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix fork after recovered stack overflowCorinna Vinschen2015-07-012-2/+19
| | | | | | | * fork.cc (frok::parent): Set stacktop value based on requested stack pointer value in child. Explain why. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add comment to sigaltstack to explain setting ss_flags hereCorinna Vinschen2015-06-302-0/+8
| | | | | | * signal.cc (sigaltstack): Add comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Handle ss_flags value longjmp safe.Corinna Vinschen2015-06-273-5/+18
| | | | | | | | | * exceptions.cc (_cygtls::call_signal_handler): Drop manipulating thread's ss_flags here. It's not safe against longjmp. * signal.cc (sigaltstack): Check if we're running on the alternate stack and set ss_flags returned in oss to SS_ONSTACK. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Define larger MINSIGSTKSZ and SIGSTKSZ values for CygwinCorinna Vinschen2015-06-262-0/+13
| | | | | | | | * include/cygwin/signal.h: Revert to define MINSIGSTKSZ and SIGSTKSZ here with bigger values to allow _cygtls to reside on signal stack, should it turn out to be required at one point. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix values returned by getrlimit(RLIMIT_STACK)Corinna Vinschen2015-06-262-10/+31
| | | | | | | * resource.cc (getrlimit): Fix values returned by RLIMIT_STACK. Explain why this had to be changed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Complement SIGEV_* enums with macrosKen Brown2015-06-232-0/+8
| | | | | | * include/cygwin/signal.h (SIGEV_*): Add macros. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Don't push on original stack during alternate signal stack setupCorinna Vinschen2015-06-222-56/+56
| | | | | | | | | * exceptions.cc (_cygtls::call_signal_handler): Drop pushing a register on the original stack, it confuses GCC. Rearrange the assembler code so that $rax/$eax is not used by GCC to prepare an argument value. Use $rax/$eax without saving. Drop clearing $rbp/$epb. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Safe all clobbered volatile registers when using alternate stackCorinna Vinschen2015-06-212-22/+54
| | | | | | | | | * exceptions.cc (_cygtls::call_signal_handler): Drop subtracting 16 bytes from the alternate stack, it's not necessary. Safe all clobbered registers. Safe one on the orignal stack, the others on the alternate stack on both platforms. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix commentsCorinna Vinschen2015-06-201-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* ChangeLog entries for Cygwin's alternate signal stack implementationCorinna Vinschen2015-06-201-0/+25
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add alternate signal stack to docsCorinna Vinschen2015-06-201-0/+6
| | | | | | | * new-features.xml (ov-new2.1): Add alterante signal stack info. * posix.xml (std-susv4): Move sigaltstack here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implement using alternate signal stack in CygwinCorinna Vinschen2015-06-201-13/+108
| | | | | | | * exceptions.cc (_cygtls::call_signal_handler): Implement alternate signal stack handling. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use MINSIGSTKSZ and SIGSTKSZ from newlib for Cygwin as wellCorinna Vinschen2015-06-201-3/+0
| | | | | | | | | | * libc/include/sys/signal.h: Move altstack macros completely outside of rtems block. * include/cygwin/signal.h: Remove definitions of MINSIGSTKSZ and SIGSTKSZ here. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Handle exceptions in sigaltstackCorinna Vinschen2015-06-201-21/+35
| | | | | | * signal.cc (sigaltstack): Add fault handler. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Preliminary infrastructure to implement alternate stackCorinna Vinschen2015-06-198-147/+208
| | | | | | | | | | | | | | | | | | | | | | | * libc/include/sys/signal.h: Define SS_ONSTACK and SS_DISABLE unconditionally. (sigaltstack): Enable prototype on Cygwin. * common.din (sigaltstack): Export. * cygtls.cc (_cygtls::init_thread): Initialize altstack. * cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish more clearly from stack_t. Accommodate throughout. (_cygtls): Add altstack member. * exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL if we encounter a stack overflow, and no alternate stack has been defined. * include/cygwin/signal.h (MINSIGSTKSZ): Define (SIGSTKSZ): Define. (SA_ONSTACK): Define. * signal.cc (sigaltstack): New function. * tlsoffset.h: Regenerate. * tlsoffset64.h: Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Formatting fixes in exceptions.ccCorinna Vinschen2015-06-192-37/+67
| | | | | | * Makefile.in (install-man): Exclude release subdir from search paths. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Disallow installing "man pages" from release subdirCorinna Vinschen2015-06-182-4/+8
| | | | | | * Makefile.in (install-man): Exclude release subdir from search paths. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add sethostnameCorinna Vinschen2015-06-175-2/+26
| | | | | | | | | | | | * net.cc (sethostname): New function. * common.din (sethostname): Export * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2001. (CYGWIN_VERSION_DLL_MINOR): Set to 0. * new-features.xml (ov-new): Rename from ov-new1.7. (ov-new2.1): Add new section. Document sethostname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add release/2.0.5 fileCorinna Vinschen2015-06-171-0/+16
|
* Try to handle concurrent close on socket more gracefullyCorinna Vinschen2015-06-152-14/+53
| | | | | | | | | | | | | | | * fhandler_socket.cc (LOCK_EVENTS): Don't enter critical section with invalid mutex handle since then socket has been closed. (UNLOCK_EVENTS): Close critical section. (fhandler_socket::evaluate_events): Handle calling connect on shutdown socket. (fhandler_socket::wait_for_events): Try for pthread_testcancel in case of WAIT_FAILED. Try to come up with a better errno in case we waited on an invalid handle. (fhandler_socket::release_events): Change wsock_mtx and wsock_evt to NULL under lock to avoid accessing invalid handle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Handle more Winsock error codes.Corinna Vinschen2015-06-152-0/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Don't enforce SA_RESTART in non-main threadsCorinna Vinschen2015-06-152-1/+12
| | | | | | | | * exceptions.cc (_cygtls::call_signal_handler): Disable enforcing SA_RESTART in non-main threads to allow returning with EINTR from system calls. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix ChangeLog entryCorinna Vinschen2015-06-111-1/+1
|
* Bump minor DLL version to 5Corinna Vinschen2015-06-112-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Avoid compiler warning in latest patchcygwin-2_0_4-releaseCorinna Vinschen2015-06-082-2/+7
| | | | | | | * pinfo.cc (_pinfo::cwd): Initialize s to avoid comiler warning. (_pinfo::cmdline): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Evaluate /proc/$PID/{root,cwd,cmdline} for native processesCorinna Vinschen2015-06-083-3/+94
| | | | | | | | | | | * pinfo.cc (_pinfo::root): Fake default root for native processes. (open_commune_proc_parms): New helper function to access process parameter block. (_pinfo::cwd): Fetch missing cwd for native processes from processes parameter block. (_pinfo::cmdline): Ditto for command line. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* add bind mount fix to release notesCorinna Vinschen2015-06-081-0/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Avoid delays trying to fetch Cygwin info from non-Cygwin processesCorinna Vinschen2015-06-083-1/+22
| | | | | | | * pinfo.cc (_pinfo::commune_request): Don't try to send commune requests to non-Cygwin processes. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Generate SIGHUP for terminal process group on tty master closeTakashi Yano2015-06-082-6/+25
| | | | | | | | | * fhandler_tty.cc (fhandler_pty_slave::write): Move causing of SIGHUP into fhandler_pty_master::close(). (fhandler_pty_slave::read): Ditto. (fhandler_pty_master::close): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump minor DLL version to 4Corinna Vinschen2015-06-082-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Add Cygwin 2.0.3 release filecygwin-2_0_3-releaseCorinna Vinschen2015-06-031-0/+8
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump minor DLL version to 3Corinna Vinschen2015-06-022-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use NtQueryObject to detect closing the last master handleCorinna Vinschen2015-05-282-8/+29
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * net.cc: Define _NETIOAPI_H_ to accomodate newer w32api.Takashi Yano2015-05-272-1/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump minor DLL version to 2cygwin-2_0_2-releaseCorinna Vinschen2015-05-032-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Bump minor DLL version to 1cygwin-2_0_1-releaseCorinna Vinschen2015-04-303-1/+13
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use all ACEs from original ACL on Samba shareCorinna Vinschen2015-04-302-3/+8
| | | | | | | * security.cc (convert_samba_sd): Fix accidental dropping of all non-Unix User, non-Unix Group accounts. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Define __s64 and __u64cygwin-2_0_0-releaseCorinna Vinschen2015-04-272-1/+9
| | | | | | * include/asm/types.h: Add __s64 and __u64 types. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Document previous unlink patchCorinna Vinschen2015-04-231-0/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>