New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode tr/// Fails Inside of ithreads #8717
Comments
From imacat@mail.imacat.idv.twCreated by imacat@mail.imacat.idv.tw Hi. This is imacat from Taiwan. Unicode tr/// seems to fail inside Here is the example. Please tell me if you need any more information. imacat@rinse ~ % perl -mthreads -e'@_ = qw(abc); threads->new(sub { $_ = "z"; tr/\x{FF21}/A/; })->join;' Perl Info
|
From BQW10602@nifty.com
In perl-current, utf8::SWASHGET() has been removed. But something seems still wrong with tr///, while character classes, It seems that tr///, not swash, would be to blame. %perl -mthreads -e "threads->new(sub { $_ = qq/\x{391}/; s/[\x{391}-\x{39F}]/\x{3A1}/g; })->join;" %perl -mthreads -e "threads->new(sub { $_ = qq/\x{391}/; tr/\x{391}-\x{39F}/\x{3A1}/; })->join;" %perl -mthreads -e "threads->new(sub { $_ = qq/\x{391}/; s/\p{Greek}/\x{3A1}/g; })->join;" %perl -mthreads -e "sub ToLower { qq/0391\t039F\t03A1/ } threads->new(sub { $_ = qq/\x{391}/; $_ = lc; })->join;" Note: "Î" (0xCE) is the first octet of U+0391..U+039F. Regards, |
The RT System itself - Status changed from 'new' to 'open' |
From @jdheddenSADAHIRO Tomoyuki wrote:
With -DDEBUGGING, this also produces: Attempt to free unreferenced scalar: SV 0x3cf5b8, Jerry D. Hedden wrote in
It may be a stretch, but could these be related? __________________________________________________ |
From @nwc10On Wed, Dec 27, 2006 at 12:00:32AM +0900, SADAHIRO Tomoyuki wrote:
op.c has this: case OP_TRANS: That SV appears to be in the *shared* optree. :-( It's getting freed once in each thread, hence the error: Attempt to free unreferenced scalar: SV 0x8371e4c, Perl interpreter: 0x82b0008. I wonder - would there be a way under some level of DEBUGGING to assert that Nicholas Clark |
From BQW10602@nifty.comOn Wed, 27 Dec 2006 18:03:35 +0000, Nicholas Clark wrote
Other instances: %perl -mthreads -e "threads->new(sub { $_ = qq/A/; tr/\x{391}-\x{39F}/\x{3A1}/; })->join;" Note: "" (empty string) is the hash key of the swatch for "A" %perl -mthreads -e "threads->new(sub { $_ = qq//; tr/\x{391}-\x{39F}/\x{3A1}/; })->join;" ? No error? In this case no swatch is created, as swash_fetch() in utf8.c
At the run time of tr///, swash_fetch() stores the swatch into the swash, The swash for tr/// is created by calling swash_init() from pmtrans() Then should the swash for tr/// be stored somewhere but cSVOP->op_sv? Regards, |
From BQW10602@nifty.comOn Wed, 27 Dec 2006 06:57:33 -0800 (PST), "Jerry D. Hedden" wrote
Not certain, but it seems that for tr/// the swash might Regards, |
From BQW10602@nifty.comOn Sat, 30 Dec 2006 22:11:09 +0900, SADAHIRO Tomoyuki wrote
For cache of swashes, a new variable PL_trans_padav is added. P.S. Hence the index for PL_trans_padav is stored into op_sv Regards, |
From @nwc10On Sun, Dec 31, 2006 at 10:55:25PM +0900, SADAHIRO Tomoyuki wrote:
I don't think that this is going to work - see below:
The problem is that storing anything SV-like under ithreads in the optree I'm not sure what to do here. The "obvious" thing is to indirect this swash But a part of me is wondering if a "non-obvious" solution would work better, Nicholas Clark |
From @iabynOn Wed, Jan 03, 2007 at 06:21:38PM +0000, Nicholas Clark wrote:
But that runs into the problem that 'read-only' SVs actually get modified -- |
From @nwc10On Wed, Jan 03, 2007 at 06:40:44PM +0000, Dave Mitchell wrote:
True. I'd not fully thought that through. Nicholas Clark |
From @iabyntr/// failing under threads has (hopefully) been fixed by changes 29765 make tr/// threadsafe by moving swash into pad Which in the utf8 case moves the swash from op_sv into the pad, and in the -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#41124 (status was 'resolved')
Searchable as RT41124$
The text was updated successfully, but these errors were encountered: