| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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].
|
|
|
|
|
| |
The latter is much clearer as to what's going on, and the programmer and
program reader don't have to count characters.
|
|
|
|
| |
The latter two are easier to read
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This was added in 5.5/5.6 as a backwards-compatibility measure
when taint was extended to happen in more places.
|
|
|
|
|
| |
All the tables are now based on the native character set, so using
uvuni() in almost all cases is wrong.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
These functions should be used in preference to the old ones which can
read beyond the end of the input string.
|
|
|
|
|
|
| |
Cygwin::sync_winenv should fix [CPAN #65052], ADODB missing
%COMMONPROGRAMFILES%.
sync_winenv code and solution by Chris Day.
|
|
|
|
| |
Use cygwin_conv_path since cygwin-1.7 and support native utf-8 paths.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[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
|
|
|
|
|
|
| |
From: "Reini Urban" <rurban@x-ray.at>
Message-ID: <6910a60807280355g129511d9v61c9763c3fd12a27@mail.gmail.com>
p4raw-id: //depot/perl@34200
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510712210613s71712346i6e9f2b5e7275aa34@mail.gmail.com>
p4raw-id: //depot/perl@32689
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510710011632n175427fdx39e173372862526e@mail.gmail.com>
p4raw-id: //depot/perl@32006
|
|
|
|
|
| |
which duplicates the functionality of is_binmount().
p4raw-id: //depot/perl@31773
|
|
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510708150739q18fa5863s55010b538d11f77f@mail.gmail.com>
Updated patch originally by Reini Urban.
p4raw-id: //depot/perl@31737
|
|
|
| |
p4raw-id: //depot/perl@31712
|
|
|
|
|
| |
Message-Id: <46C15106.9080003@x-ray.at>
p4raw-id: //depot/perl@31710
|
|
|
|
|
| |
Message-Id: <46C14E6C.8020809@x-ray.at>
p4raw-id: //depot/perl@31708
|
|
|
|
|
|
| |
From: "Reini Urban" <rurban@x-ray.at>
Message-ID: <6910a60707070600xa8638eak3c3f20b20ccc093a@mail.gmail.com>
p4raw-id: //depot/perl@31568
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510706140513v5d3bb0e0l89dff31da83abfb9@mail.gmail.com>
p4raw-id: //depot/perl@31379
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510705221758p71418517ncb89fac289d74c35@mail.gmail.com>
p4raw-id: //depot/perl@31258
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Thanks Steve
p4raw-id: //depot/perl@30087
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
existed prior to running make.
p4raw-id: //depot/perl@29427
|
|
|
|
|
| |
changes will be needed to get it to link though.
p4raw-id: //depot/perl@29142
|
|
|
| |
p4raw-id: //depot/perl@28805
|
|
|
|
|
| |
in a path with spaces in it.
p4raw-id: //depot/perl@28803
|
|
|
|
|
| |
Message-ID: <20060417010520.GA2888@efn.org>
p4raw-id: //depot/perl@27865
|
|
|
|
|
| |
to accept extra output from module tests
p4raw-id: //depot/perl@26959
|
|
|
|
|
| |
Message-ID: <20051127082918.GA2556@efn.org>
p4raw-id: //depot/perl@26215
|
|
|
|
|
| |
Message-ID: <20050922014555.GA2852@efn.org>
p4raw-id: //depot/perl@25586
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Message-ID: <20050606034354.GA1456@efn.org>
p4raw-id: //depot/perl@24710
|
|
|
|
|
| |
Message-ID: <20050513131545.GB4024@efn.org>
p4raw-id: //depot/perl@24461
|
|
|
|
|
| |
Message-ID: <20050211040434.GA3824@efn.org>
p4raw-id: //depot/perl@23961
|
|
|
|
|
| |
Message-ID: <20040816001252.GA2148@efn.org>
p4raw-id: //depot/perl@23218
|
|
|
|
|
| |
Message-ID: <20031124161136.GC2656@efn.org>
p4raw-id: //depot/perl@21783
|
|
|
|
|
|
| |
From: "Gerrit P. Haase" <gp@familiehaase.de>
Message-ID: <162265353578.20030524165129@familiehaase.de>
p4raw-id: //depot/perl@19623
|
|
|
|
|
| |
p4raw-link: @19013 on //depot/perl: 4eee6e183013a0f0e9dce0d53c643393a9e49455
p4raw-id: //depot/perl@19050
|
|
|
|
|
|
|
|
|
| |
[ 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..)
|
|
|
|
|
|
|
|
|
|
| |
[ 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..)
|
|
|
| |
p4raw-id: //depot/perl@17671
|
|
|
|
|
|
|
|
| |
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
|