summaryrefslogtreecommitdiff
path: root/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* make exec keep its argument list more reliablyZefram2017-12-141-10/+18
| | | | | | | | | | Bits of exec code were putting the constructed commands into globals PL_Argv and PL_Cmd, which could then be clobbered by reentrancy. These are only global in order to manage their freeing, but that's better managed by using the scope stack. So replace them with automatic variables, with ENTER/SAVEFREEPV/LEAVE to free the memory. Also copy the strings acquired from SVs, to avoid magic clobbering the buffers of SVs already read. Fixes [perl #129888].
* Change some strncmp(), etc. to strBEGINs()Karl Williamson2017-11-061-2/+2
| | | | | The latter is much clearer as to what's going on, and the programmer and program reader don't have to count characters.
* Convert strcmp into strEQ, strNEKarl Williamson2017-10-241-4/+4
| | | | The latter two are easier to read
* PATCH: [perl #127708] segfault in "$!" in threadsKarl Williamson2016-04-091-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was showing up on Darwin because its setlocale is particularly not thread safe. But the problem is more generic. Using locales just isn't a good idea in a threaded application, as locales are process-wide, not thread-specific. Calling setlocale() changes the locale of all threads at the same time. Further the return of setlocale() is a pointer to internal storage. If you call setlocale() just to learn what it currently is without actually changing the locale, there is no guarantee that another thread won't interrupt your thread, switching the locale to something else before you've had a chance to copy it somewhere else for safekeeping, and the internal storage may have been freed during that interruption, leading to things like segfaults. This is a problem that has been around in the locale handling code for a long time. I don't know why it hasn't shown up before, or maybe it has and is not reproducible because it's timing dependent, and so any problems didn't have tickets written for them, or were rejected as not reproducible. But the problem has been made worse in recent releases. Only fairly recently has perl changed so this problem can occur in programs that don't use locale explicitly: ones that don't 'use locale' nor call setlocale(). This ticket is for such a program that gets a locale-related segfault, without ever touching locales itself. I have done an audit of the perl source, looking for all such occurrences, and this patch fixes all of them that I found. The only other ones, besides "$!", is in converting to/from UTF-8 in cygwin.c. In all such cases, perl briefly switches the locale, does an operation, then switches back. The solution here is to add mutexes to make these areas of code uninterruptible critical sections, so that they can rely on having the locale be what they expect it to be during the entirety of the operation, and can't have a setlocale() from another thread free internal storage. But this is not a general solution. A thread executing these sections can interrupt some other thread doing a setlocale() and zap that. However, we have long cautioned against doing setlocales() in a thread, and that caution was strengthened in a commit made yesterday, fc82b82ef4784a38877f35f56ee16f14934460ce. The current commit should make safe all threaded programs that don't use locales explicitly. It's too close to the 5.24 release to do the rearchitecting required for a general solution. That would involve adding more critical sections. POSIX 2008 introduced new locale handling functions that are thread-safe, and affect only a single thread, and don't require mutexes. The ultimate solution would be to use those tools where available, and to hide from the outer code which set is being used. Thus, perl would be thread-safe on such platforms, while remaining problematic on older ones, though fixed so segfaults wouldn't occur. Tony Cook believes we could emulate the newer behavior on all platforms at a significant performance penalty. I think this would require a lot of code, and suspect there would be glitches in it for XS code. But he may have some ideas about how to do it simply. In any case, this has to wait until post 5.24. Three other notes: It seems to me that the cygwin code could be replaced by equivalent code that doesn't use locales at all. The comments in the source seem to even indicate that. I'll look into doing this in 5.25. Another possible reason that this hasn't shown up in earlier perls is that the problems may have been entirely affecting I/O operations and there are already mutexes involving I/O, and so those could be inadvertently protecting from, or at least minimizing, the problems found here. I haven't investigated to verify this. This commit doesn't add a test. I am asking on p5p for assistance in writing one
* avoid a "FILE" name conflict with cygwin's wchar.hTony Cook2014-02-181-0/+1
| | | | | | | | | | | | | | | | | | | | | The 1.7.28 release of cygwin (or possible a separate package released around the same time) header wchar.h includes the following code: typedef __FILE FILE; With PERLIO_NOT_STDIO set to true, the default for core source files, we #include nostdio.h which does: struct _FILE; #define FILE struct _FILE which turns the above code into: typedef __FILE struct _FILE; which isn't C. Disable this hack for cygwin.c
* Removed the ifdefs for INCOMPLETE_TAINTSBrian Fraser2013-09-211-2/+0
| | | | | This was added in 5.5/5.6 as a backwards-compatibility measure when taint was extended to happen in more places.
* Convert some uvuni() to uvchr()Karl Williamson2013-08-291-4/+4
| | | | | All the tables are now based on the native character set, so using uvuni() in almost all cases is wrong.
* Fix Cygwin build warningsJerry D. Hedden2012-08-301-3/+3
| | | | | | | | | | | Fixes the following build warnings under Cygwin: cygwin.c: In function 'do_spawn': cygwin.c:132:5: warning: assignment from incompatible pointer type cygwin.c: In function 'XS_Cygwin_posix_to_win_path': cygwin.c:346:9: warning: 'err' may be used uninitialized in this function cygwin.c: In function 'XS_Cygwin_win_to_posix_path': cygwin.c:257:9: warning: 'err' may be used uninitialized in this function
* Use the new utf8 to code point functionsKarl Williamson2012-03-191-3/+3
| | | | | These functions should be used in preference to the old ones which can read beyond the end of the input string.
* add Cygwin::sync_winenv [perl #110190]Reini Urban2012-02-091-0/+3
| | | | | | Cygwin::sync_winenv should fix [CPAN #65052], ADODB missing %COMMONPROGRAMFILES%. sync_winenv code and solution by Chris Day.
* CYG17 utf8 pathsReini Urban2012-01-241-34/+218
| | | | Use cygwin_conv_path since cygwin-1.7 and support native utf-8 paths.
* Fix -Wwrite-string warnings in cygwin.cJerry D. Hedden" (via RT)2010-08-251-5/+8
| | | | | | | | | | | | | | | [perl #77376] Fix the following build warnings that are now being generated because -Wwrite-string has been turned on: cygwin.c: In function `do_aspawn': cygwin.c:69: warning: assignment discards qualifiers from pointer target type cygwin.c: In function `do_spawn': cygwin.c:91: warning: initialization discards qualifiers from pointer target type cygwin.c: In function `init_os_extras': cygwin.c:544: warning: initialization discards qualifiers from pointer target type
* Cygwin build harmonization, remove cygwin/Makefile.SHsReini Urban2008-08-111-173/+0
| | | | | | From: "Reini Urban" <rurban@x-ray.at> Message-ID: <6910a60807280355g129511d9v61c9763c3fd12a27@mail.gmail.com> p4raw-id: //depot/perl@34200
* Re: Perl @ http://www.ccl4.org/~nick/P/perl-33444.tar.bz2Reini Urban2008-03-111-1/+10
| | | | | | | | Message-ID: <47D2EF38.10503@x-ray.at> * CYG04 At least on cygwin strip the last number from the dll. This is in the cygwin.com build since years. p4raw-id: //depot/perl@33481
* Fix cygwin.c againJerry D. Hedden2007-12-221-2/+2
| | | | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510712221311v1c58d606jc8dfeee6a21e6194@mail.gmail.com> Fixes breakage caused by change #32707 p4raw-link: @32707 on //depot/perl: 24792b8dabd61fb81a064d275b67bc65123a8d4c p4raw-id: //depot/perl@32712
* const'ing in cygwin.cJerry D. Hedden2007-12-211-2/+3
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510712210613s71712346i6e9f2b5e7275aa34@mail.gmail.com> p4raw-id: //depot/perl@32689
* /cygdrive is configurableJerry D. Hedden2007-10-021-10/+13
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510710011632n175427fdx39e173372862526e@mail.gmail.com> p4raw-id: //depot/perl@32006
* Following Jan's advice, remove Cygwin::is_textmount(),Rafael Garcia-Suarez2007-08-311-15/+0
| | | | | which duplicates the functionality of is_binmount(). p4raw-id: //depot/perl@31773
* Get Cwd->cwd() to work under CygwinJerry D. Hedden2007-08-201-1/+4
| | | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510708150739q18fa5863s55010b538d11f77f@mail.gmail.com> Updated patch originally by Reini Urban. p4raw-id: //depot/perl@31737
* Delete the files which #31710 should have removed.Abhijit Menon-Sen2007-08-142-0/+0
| | | p4raw-id: //depot/perl@31712
* get rid of cygwin perlld and ld2Reini Urban2007-08-143-168/+11
| | | | | Message-Id: <46C15106.9080003@x-ray.at> p4raw-id: //depot/perl@31710
* Cygwin::mount_table, Cygwin::mount_flagsReini Urban2007-08-141-0/+73
| | | | | Message-Id: <46C14E6C.8020809@x-ray.at> p4raw-id: //depot/perl@31708
* cygwin path conversions, take 4Reini Urban2007-07-091-2/+99
| | | | | | From: "Reini Urban" <rurban@x-ray.at> Message-ID: <6910a60707070600xa8638eak3c3f20b20ccc093a@mail.gmail.com> p4raw-id: //depot/perl@31568
* RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32Jan Dubois2007-06-281-6/+11
| | | | | | | | | | | From: "Jan Dubois" <jand@activestate.com> Message-ID: <02bd01c7b90b$49863720$dc92a560$@com> Rearranges the initialization of Win32CORE. The Perl interpreter isn't fully initialized when Perl_init_os_extras() in win32/win32.c is called, so it is not safe to use the Perl calling mechanism yet. Fixes a problem building PAR-Packer on Win32. p4raw-id: //depot/perl@31490
* [perl #43265] cygwin/Makefile.SHs: miniperl -Ilib for a clean @INC cygwin@cygwin.com2007-06-211-1/+1
| | | | | | From: cygwin@cygwin.com (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-1276-1182357570-46.43265-75-0@perl.org> p4raw-id: //depot/perl@31439
* Less sed'ing in Cygwin Makefile.SHsJerry D. Hedden2007-06-141-6/+1
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510706140513v5d3bb0e0l89dff31da83abfb9@mail.gmail.com> p4raw-id: //depot/perl@31379
* Forgotten Cygwin patchJerry D. Hedden2007-05-231-0/+1
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510705221758p71418517ncb89fac289d74c35@mail.gmail.com> p4raw-id: //depot/perl@31258
* Re: Win32 modules & cygwinYitzchak Scott-Thoennes2007-02-221-0/+7
| | | | | | | | | | From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org> Message-ID: <1254.67.42.109.122.1171965018.squirrel@67.42.109.122> Also includes integration & deletion of win32/ext/Win32API to ext/Win32API, and addition of copyright message and corrections to spacing/tabbing as suggested by Jan Dubois. p4raw-id: //depot/perl@30379
* alloca () might end up unreferenced during linking.H.Merijn Brand2007-01-311-0/+1
| | | | | Thanks Steve p4raw-id: //depot/perl@30087
* help cygwin find its dlls even on taint tests with no pathYitzchak Scott-Thoennes2007-01-081-0/+8
| | | | | | From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org> Message-ID: <2437.63.226.247.31.1168217788.squirrel@63.226.247.31> p4raw-id: //depot/perl@29713
* -Dprefix failed on Cygwin unless the directory ${installbin} alreadySteve Peters2006-11-301-1/+2
| | | | | existed prior to running make. p4raw-id: //depot/perl@29427
* Changes to get perl to compile with g++ on Cygwin. Some additionalSteve Peters2006-10-301-4/+1
| | | | | changes will be needed to get it to link though. p4raw-id: //depot/perl@29142
* Clean up some comments.Steve Peters2006-09-071-4/+4
| | | p4raw-id: //depot/perl@28805
* Fix to first problem causing Cygwin Perl to fail to build Steve Peters2006-09-071-1/+1
| | | | | in a path with spaces in it. p4raw-id: //depot/perl@28803
* fix cygwin buildYitzchak Scott-Thoennes2006-04-171-6/+6
| | | | | Message-ID: <20060417010520.GA2888@efn.org> p4raw-id: //depot/perl@27865
* Revert change 24461, now that change 26757 allows TESTRafael Garcia-Suarez2006-01-271-1/+1
| | | | | to accept extra output from module tests p4raw-id: //depot/perl@26959
* fix wrong pool error in cygwin buildYitzchak Scott-Thoennes2005-11-271-1/+1
| | | | | Message-ID: <20051127082918.GA2556@efn.org> p4raw-id: //depot/perl@26215
* quiet a few warningsYitzchak Scott-Thoennes2005-09-231-2/+2
| | | | | Message-ID: <20050922014555.GA2852@efn.org> p4raw-id: //depot/perl@25586
* Re: janitorial work ? [patch]Jim Cromie2005-07-081-1/+1
| | | | | | | | Message-ID: <42CC3CE9.5050606@divsol.com> (reverted all dual-lived modules since they must work with older perls too so must wait for a new Devel::PPPort) p4raw-id: //depot/perl@25101
* Re: blead attribute warnings, cygwin + gcc 3.4.1Yitzchak Scott-Thoennes2005-06-061-6/+12
| | | | | Message-ID: <20050606034354.GA1456@efn.org> p4raw-id: //depot/perl@24710
* change to quiet cygwin's perlldYitzchak Scott-Thoennes2005-05-131-5/+5
| | | | | Message-ID: <20050513131545.GB4024@efn.org> p4raw-id: //depot/perl@24461
* Re: [PATCH] Re: perl winpid?Yitzchak Scott-Thoennes2005-02-111-0/+36
| | | | | Message-ID: <20050211040434.GA3824@efn.org> p4raw-id: //depot/perl@23961
* make cygwin ld2 executableYitzchak Scott-Thoennes2004-08-161-0/+1
| | | | | Message-ID: <20040816001252.GA2148@efn.org> p4raw-id: //depot/perl@23218
* remove hardcoded version number from cygwin/perlld.inYitzchak Scott-Thoennes2003-11-242-3/+5
| | | | | Message-ID: <20031124161136.GC2656@efn.org> p4raw-id: //depot/perl@21783
* for cygwin/perlld.inGerrit P. Haase2003-05-261-1/+1
| | | | | | From: "Gerrit P. Haase" <gp@familiehaase.de> Message-ID: <162265353578.20030524165129@familiehaase.de> p4raw-id: //depot/perl@19623
* Oops (change #19013 missed changing the Perl version number).Jarkko Hietaniemi2003-03-241-1/+1
| | | | | p4raw-link: @19013 on //depot/perl: 4eee6e183013a0f0e9dce0d53c643393a9e49455 p4raw-id: //depot/perl@19050
* Integrate:Jarkko Hietaniemi2003-03-171-2/+1
| | | | | | | | | [ 19012] We don't have the new Perl at this stage. p4raw-link: @19012 on //depot/maint-5.8/perl: 7353bff6c5730d27add0d0abfadfddb3d119a622 p4raw-id: //depot/perl@19013 p4raw-integrated: from //depot/maint-5.8/perl@19010 'copy in' cygwin/perlld.in (@19006..)
* Integrate:Slaven Rezic2003-03-171-1/+2
| | | | | | | | | | [ 19006] Subject: Re: [Patch] Maintperl versioning for Cygwin Message-ID: <87ptoqev4c.fsf@vran.herceg.de> p4raw-link: @19006 on //depot/maint-5.8/perl: 65f9e441d42a0992031a7b25f809df40333410c5 p4raw-id: //depot/perl@19007 p4raw-integrated: from //depot/maint-5.8/perl@19005 'merge in' cygwin/perlld.in (@19000..)
* Change version from 5.8.0 to 5.9.0.Hugo van der Sanden2002-08-041-1/+1
| | | p4raw-id: //depot/perl@17671
* Re: forewarning: usedevel and versiononlyH.Merijn Brand2002-05-291-1/+1
| | | | | | | | From: "H.Merijn Brand" <h.m.brand@hccnet.nl> Message-Id: <20020529081515.D570.H.M.BRAND@hccnet.nl> More 5.7.3 -> 5.8.0. p4raw-id: //depot/perl@16851