Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upBleadperl breaks MDOOTSON/Wx-0.9923.tar.gz #13863
Comments
This comment has been minimized.
This comment has been minimized.
From @chornyOn Russian locale. If I set LANG=C, problem disappears. # Failed test 'use Wx;' More data here: PASS 5.18.2 on same VM: https://rt.cpan.org/Ticket/Display.html?id=95808 -- |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/20/2014 03:16 PM, Alexandr Ciornii (via RT) wrote:
I'm trying to reproduce this, and am unable to compile it. We have seen I'm using gcc 4.8.1; the bug report compiler is 4.7.2. The code is g++ that is failing. At first I thought somehow it was PropertyGrid.c: In function ‘void XS_Wx__ColourProperty_SetPlValue(CV*)’: ========================================= I haven't dealt with C++ in well over a decade. My guess is that the |
This comment has been minimized.
This comment has been minimized.
From @khwilliamson0014-try-this.patchFrom 6fc3931deee01db3827c0b052e449956b74a75cb Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Tue, 20 May 2014 23:03:36 -0600
Subject: [PATCH 14/14] try this
---
numeric.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/numeric.c b/numeric.c
index d431728..f76e581 100644
--- a/numeric.c
+++ b/numeric.c
@@ -528,13 +528,20 @@ Perl_grok_numeric_radix(pTHX_ const char **sp, const char *send)
PERL_ARGS_ASSERT_GROK_NUMERIC_RADIX;
- if (PL_numeric_radix_sv && IN_SOME_LOCALE_FORM) {
+ /* XXX This means there is a bug in 5.20 */
+ if (IN_SOME_LOCALE_FORM) {
+ DECLARE_STORE_LC_NUMERIC_SET_TO_NEEDED();
+ if (PL_numeric_radix_sv) {
+ /* XXX indent */
STRLEN len;
const char * const radix = SvPV(PL_numeric_radix_sv, len);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
*sp += len;
+ RESTORE_LC_NUMERIC();
return TRUE;
}
+ }
+ RESTORE_LC_NUMERIC();
}
/* always try "." if numeric radix didn't match because
* we may have data from different locales mixed */
--
1.8.3.2
|
This comment has been minimized.
This comment has been minimized.
The RT System itself - Status changed from 'new' to 'open' |
This comment has been minimized.
This comment has been minimized.
From @chornyOn Tue May 20 22:17:19 2014, public@khwilliamson.com wrote:
Still fails. -- |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/21/2014 03:13 PM, Alexandr Ciornii via RT wrote:
I wiped out what I had and re-did it to be sure that it wasn't something I then tried dromedary, which has an older g++. Unfortunately it |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/21/2014 09:54 PM, Karl Williamson wrote:
Fernando Vezzosi graciously installed gtk+ libraries on Dromedary, and I After a significant amount of effort with hdr and linker issues, I was undefined symbol: _Z24wxGetFullScreenMethodX11PvS_ which sounds to me like something very basic, and unrelated to my hacks If someone has some advice about this, please let me know. Another |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/22/2014 08:10 PM, Karl Williamson wrote:
I examined the core code in isolation, and see a potential code path |
This comment has been minimized.
This comment has been minimized.
From @khwilliamson0001-Try-this-for-perl-121930.patchFrom 2227b6a17bc0e68970c5e5644b96ac9359a68023 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sun, 25 May 2014 16:42:50 -0600
Subject: [PATCH] Try this for [perl #121930]
This will generate a porting test error, but it's a guess as to what is
causing the bug in question.
---
sv.c | 1 +
vutil.c | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/sv.c b/sv.c
index 1005313..7880b93 100644
--- a/sv.c
+++ b/sv.c
@@ -11586,6 +11586,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
* where printf() taints but print($float) doesn't.
* --jhi */
+ DEBUG_U(PerlIO_printf(Perl_debug_log, "CopHINTS_get(PL_curcop)=%x\n", CopHINTS_get(PL_curcop)));
STORE_LC_NUMERIC_SET_TO_NEEDED();
/* hopefully the above makes ptr a very constrained format
diff --git a/vutil.c b/vutil.c
index 200ff73..4eccd49 100644
--- a/vutil.c
+++ b/vutil.c
@@ -591,9 +591,24 @@ VER_NV:
char *buf;
STORE_NUMERIC_LOCAL_SET_STANDARD();
if (sv) {
+ U32 save_hints;
+ if (IN_PERL_COMPILETIME) {
+ save_hints = PL_hints;
+ PL_hints &= ~ (HINT_LOCALE|HINT_LOCALE_NOT_CHARS);
+ }
+ else {
+ save_hints = CopHINTS_get(PL_curcop);
+ CopHINTS_set(PL_curcop, save_hints & ~ (HINT_LOCALE|HINT_LOCALE_NOT_CHARS));
+ }
Perl_sv_catpvf(aTHX_ sv, "%.9"NVff, SvNVX(ver));
len = SvCUR(sv);
buf = SvPVX(sv);
+ if (IN_PERL_COMPILETIME) {
+ PL_hints = save_hints;
+ }
+ else {
+ CopHINTS_set(PL_curcop, save_hints);
+ }
}
else {
len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
--
1.8.3.2
|
This comment has been minimized.
This comment has been minimized.
From @eserteDana Uto 20. Svibanj 2014, 14:16:52, chorny reče:
I saw these strange "Invalid version format" errors with perl 5.20.0-RC1, too. Probably LANG=de_DE.UTF-8 was iactive. At least the following distributions were affected: * BORUP/Gtk2-TrayIcon-0.06.tar.gz |
This comment has been minimized.
This comment has been minimized.
From @JohnPeacockOn 05/26/2014 02:19 AM, slaven@rezic.de via RT wrote:
Since all of those packages (including Wx) have a huge list of use 5.006_001; None of the version code has changed in a long time (Feb 4) and I'm John |
This comment has been minimized.
This comment has been minimized.
From @eserteDana Ned 25. Svibanj 2014, 23:19:28, slaven@rezic.de reče:
A little bit more data mining in the reports on my hard disk: the following files were referenced in the error messages (perl-5.20.0-RC1 is unthreaded, 5.20.0-RC1t is threaded): $ grep /opt/perl-5.20 /tmp/invalid-version-format.log |perl -nle 'm{ at (\S+) line (\d+)} and print "$1 $2"'|sort -u And the problematic lines in these files: $ grep /opt/perl-5.20 /tmp/invalid-version-format.log |perl -nle 'm{ at (\S+) line (\d+)} and print "$1 $2"'|sort -u|perl -Mautodie -nle 'my($f,$l)=split; open my $fh, $f; for(1..$l-1) { <$fh> } chomp(my $c = <$fh>); print $c' |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn Mon May 26 12:46:59 2014, slaven@rezic.de wrote:
It appears that these all have depdendencies on gtk+, and I run into problems when I try to get them onto my machine. It would be most helpful if someone who has any of these running on their machines could try blead on them with the patch I attached above at |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/26/2014 04:46 PM, Karl Williamson via RT wrote:
I did find a machine that has gtk2, and tried this distribution on it, |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Tue, May 27, 2014 at 2:36 AM, Karl Williamson <public@khwilliamson.com>wrote:
I just tried to install it as requirement for Padre on my notebook with Anything I can do to help troubleshooting it? |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/27/2014 12:42 PM, Alexander Hartmaier wrote:
Yes please, just see if this patch fixes it, and if not we can go from |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Tue, May 27, 2014 at 8:59 PM, Karl Williamson <public@khwilliamson.com>wrote:
Is this a patch against Perl? Two tests failed: The first one is clear, the sha hash changed because we patched the file, I installed it anyways and the Wx tests still fail with the same error. |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 05/27/2014 01:53 PM, Alexander Hartmaier wrote:
Afraid so, or use 5.20 with whatever patch we finally come up with.
HiRes notoriously fails reasonably often in smokers due to load issues.
Darn. Could you either give me temporary ssh access to your system, or |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Tue, May 27, 2014 at 10:33 PM, Karl Williamson
|
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonFor those people who can easily reproduce this problem, there is a http://perl5.git.perl.org/perl.git/shortlog/refs/heads/smoke-me/khw-locale will fix it. I would appreciate it if someone would try it out. |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Mon, Jun 2, 2014 at 6:52 PM, Karl Williamson <public@khwilliamson.com>
I tried to build it and got: I tried building it using |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/03/2014 01:59 AM, Alexander Hartmaier wrote:
I don't know offhand what's going on here. But the changes are now in |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Thu, Jun 5, 2014 at 8:10 PM, Karl Williamson <public@khwilliamson.com>
t/01_load.t ........... 1/6 Test Summary Report t/01_load.t (Wstat: 65280 Tests: 1 Failed: 1) |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deOn 05.06.2014 20:10, Karl Williamson wrote:
I also still see the failure # perl -e'use Gtk3; BEGIN{ Gtk3::init (); } use 5.8.0;' with today's blead. |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/06/2014 02:34 PM, Torsten Schoenfeld wrote:
If you are somewhat comfortable with using gdb, you could give me some First of all, make sure your perl is compiled with -DDEBUGGING, then run Second, run it with gdb, and set a breakpoint and send me the output |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deOn 06.06.2014 23:12, Karl Williamson wrote:
Specifying "-DL" doesn't produce any extra output. (Other "-D" flags do
Here's the backtrace for C<< perl -e'use Gtk3; BEGIN{ Gtk3::init (); } #0 Perl_croak (pat=pat@entry=0x66d172 "%s") at util.c:1685 |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deOn 07.06.2014 00:13, Torsten Schoenfeld wrote:
Now with "-O0": #0 Perl_croak (pat=0x5f81c8 "%s") at util.c:1687 |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/06/2014 04:20 PM, Torsten Schoenfeld wrote:
Thanks for finding that.
I believe I have now found the problem. Your initial analysis would "Gtk3::init is a wrapper around the C function gtk_init which for this I'm pretty confident that the attached patch will cause the immediate Perl has long thought in various places that it knew what the program's This is apparently not common, or otherwise we would have gotten many One solution is to have a setlocale wrapper that intercepts all calls to Another solution is for Perl to change to avoid all assumptions about It is impossible to change the locale from pure perl without Perl's Another solution is to "solve" this via documentation. Tell XS code But we can't tell this to foreign libraries, like gtk. But as I said, require Gtk2; It may be that we document that XS writers have to do something with Suggestions welcome. The cpan grep I used to find calls to the libc setlocale is below. It http://grep.cpan.me/?q=%28^|[^_%3A]%29setlocale\s*\%28%28%24|[^%29]%29+-file%3A%28config|Configure|Changes|.*\.%28t|cgi|log|pod|html|a|pl|pm|PL%29%24%29 |
This comment has been minimized.
This comment has been minimized.
From @khwilliamson0001-To-see-if-fixes-121930.patchFrom c5ec50fce8af462e2eb9d85e317022a1b6d0a881 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 7 Jun 2014 12:07:50 -0600
Subject: [PATCH] To see if fixes 121930
---
vutil.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vutil.c b/vutil.c
index b687103..ed4877f 100644
--- a/vutil.c
+++ b/vutil.c
@@ -599,6 +599,7 @@ VER_NV:
buf = SvPVX(sv);
}
else {
+ setlocale(LC_NUMERIC, "C");
len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
buf = tbuf;
}
--
1.9.1
|
This comment has been minimized.
This comment has been minimized.
From @jkeenanOn Sun Jun 15 09:16:07 2014, michael.kogan@gmx.net wrote:
Would it be possible for you to provide the full error output as well as the output of 'perl -V' from the machine on which you reproduce this error? (My impression is that the perl -V output which your 'perlbug' generated is from a different machine.) Thank you very much. |
This comment has been minimized.
This comment has been minimized.
The RT System itself - Status changed from 'new' to 'open' |
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netOf course. The output of Shutter: $ shutter The output of perl -V: $ perl -V Platform: Characteristics of this binary (from libperl): Line 10 of Copy.pm: use 5.006; . Thanks for the quick reply, 2014-06-16 3:13 GMT+02:00 James E Keenan via RT <perlbug-followup@perl.org>:
|
This comment has been minimized.
This comment has been minimized.
From @tonycozOn Sun Jun 15 09:16:07 2014, michael.kogan@gmx.net wrote:
Could you please provide a complete example that demonstrates the problem? This: LANG=de_DE.utf8 ~/perl/5.20.0-dbg/bin/perl -w -MFile::Copy -e0 didn't fail for me. Neither did: tony@mars:.../git/perl2$ LANG=de_DE.utf8 ./test.pl print "Hello, World\n"; Tony |
This comment has been minimized.
This comment has been minimized.
From @kentfredricWould you be able to inform us what `perl -Mversion\ 9999` emits? My suspicion is you have an old version.pm lying around in @INC, and This won't be a problem on most Perl installations, however, arch does Its likely I'm completely wrong here, but this seems to be the most likely -- |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deI think this is the same issue as the one discussed in https://rt.perl.org/Public/Bug/Display.html?id=121930 It affects any program that directly or indirectly uses gtk+ (or any other library that calls setlocale()), like Shutter. |
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netHello Tony, the two snippets you gave in your comment work for me either without any - Shutter with Copy.pm. URL: https://code.launchpad.net/shutter Output: $ shutter Line 56 in /usr/bin/shutter is: use File::Copy qw/ cp mv /; - Gmusicbrowser with Encode.pm (see cpan ticket #96467 $ gmusicbrowser Line 26 in /usr/bin/gmusicbrowser is: use Encode qw/_utf8_on _utf8_off/; - Reported by another user: Pac Manager with Socket.pm. URL: no idea, can $ pac Thanks for your assistance, |
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netKent, here is the output: $ perl -Mversion\ 9999 perl-data-random Torsten, the issues you referenced look fitting. Indeed, Shutter, |
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netI sent already two replies, 3 and 4 hours ago, but none of them made it Michael 2014-06-16 10:11 GMT+02:00 Michael Kogan <michael.kogan@gmx.net>:
|
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/16/2014 01:53 AM, "Torsten Schönfeld" wrote:
Almost certainly this is the case. I posted a patch to blead to try on 6/7, but have not heard any response |
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netKarl, could you point me to the patch, please? Thanks! |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/16/2014 05:38 AM, Michael Kogan wrote:
I believe your replies eventually got through. And I think your What would likely work for you immediately is to run it under a locale The command 'locale -a' should tell you what locales are available on Another option is to revert to using Perl v5.18 until this issue is My problem is that I can't get gtk to compile on the systems I have |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/16/2014 01:25 PM, Michael Kogan wrote:
Attached |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonkhw.patchFrom c5ec50fce8af462e2eb9d85e317022a1b6d0a881 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Sat, 7 Jun 2014 12:07:50 -0600
Subject: [PATCH] To see if fixes 121930
---
vutil.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vutil.c b/vutil.c
index b687103..ed4877f 100644
--- a/vutil.c
+++ b/vutil.c
@@ -599,6 +599,7 @@ VER_NV:
buf = SvPVX(sv);
}
else {
+ setlocale(LC_NUMERIC, "C");
len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
buf = tbuf;
}
--
1.9.1
|
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netKarl, thanks for the patch. I forwarded the call for testing to the Arch 2014-06-16 21:25 GMT+02:00 Michael Kogan <michael.kogan@gmx.net>:
|
This comment has been minimized.
This comment has been minimized.
From michael.kogan@gmx.netKarl, a user reported that your patch solves the problem: |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/16/2014 11:45 PM, Michael Kogan wrote:
Thanks. Based on that, I've merged this ticket into I can produce a patch that should apply cleanly to v5.20. Things have What we need to do is decide how to proceed. The problem isn't really a Let me first say that the basic issue isn't new in v5.20. It has been Every C program has an underlying locale. Both perl and gtk set up the http://grep.cpan.me/?q=disable_setlocale+ shows 20 modules that do this, most of them authored by Kevin Ryde. There are plenty of things that modules could do in C code that would I think the best long term solution would be for the underlying |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deSorry for the delay. On 07.06.2014 23:45, Karl Williamson wrote:
Yes, your patch does fix the symptom. Thanks for your explanation of the circumstances. You suggest that Gtk2/Gtk3 make gtk+ not call setlocale() in order to As far as I remember, we've never seen locale-related issues with But I do wonder: when perl is parsing things that are supposed to be of [1] https://bugzilla.gnome.org/show_bug.cgi?id=60606 |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/18/2014 01:30 PM, Torsten Schoenfeld wrote:
My explanation wasn't good enough. Here is a more complete one. There have been a lot of bugs and inconsistencies in handling locales. Perl thinks of itself as the center of the universe. It does a I've done some research into this application, but I still don't know There is a case where Perl isn't the center of the universe, and that is So if both Perl and the underlying GUI library call setlocale(LC_ALL, But there is another problem. I omitted a crucial fact above. Yes, Things got perturbed in 5.20 so this lurking issue showed up in more I hope the above is clear enough, but I've gone through several drafts
Well, it seems saner when dealing with a floating point number to not
|
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deOn 20.06.2014 06:22, Karl Williamson wrote:
Then it appears all we need to do in Gtk2/Gtk3 is to tell perl when the $ perl -e'use Gtk3; use POSIX qw/locale_h/; BEGIN{ POSIX::setlocale What's the best way to invoke the locale-updating logic in |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/23/2014 01:20 PM, Torsten Schoenfeld wrote:
I think it would be best if I write some new function to do this and Each takes a single parameter, the char * returned from the setlocale |
This comment has been minimized.
This comment has been minimized.
From kaffeetisch@gmx.deOn 25.06.2014 07:04, Karl Williamson wrote:
I ended up wanting a pure-Perl solution, so I now simply call https://git.gnome.org/browse/perl-Gtk2/commit/?id=02a7052603306cca8e1b910e3cfe8c8677ee0354 When you come up with an XS API around new_numeric() and friends, I can |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/25/2014 02:08 PM, Torsten Schoenfeld wrote:
My guess is that this is done only once, during initialization, so the |
This comment has been minimized.
This comment has been minimized.
From user42_kevin@yahoo.com.auKarl Williamson <public@khwilliamson.com> writes:
I can't remember what went wrong that I put disable_setlocale(). It was
You could probably ask xs code to announce when it has changed or might I wonder that if the perl startups have already set the locale sensibly In some of my charting code I think I applied an LC_NUMERIC to get the |
This comment has been minimized.
This comment has been minimized.
From @karpetFWIW this issue affects any XS module that calls setlocale. You can see it with SWISH::3 (upon which SWISH::Prog and Dezi::App depend) which is a binding to the C libswish3. I have fixed it upstream with: though my fix seems a little draconian (and perhaps I'm doing the whole locale-detection thing wrong in the first place; corrections welcome). Re-reading perllocale I see the XS warnings about setlocale() now very clearly, though as mentioned elsewhere, this behavior didn't manifest until Perl 5.18. |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonThis issue has been fixed in v5.20.1 and blead. The fix involves protecting the Perl core from XS code changing the LC_NUMERIC locale behind its back around versioning statements. This was deemed to not likely to be done in time-critical sections (generally doing just 'requires'). But XS code can still change this and screw up other XS modules and the Perl core, but we haven't had reports of these. Note that Perl v5.22 will try to protect other modules by keeping LC_NUMERIC in the C locale. That means that XS code that wants it to be otherwise will be broken. You can participate in the development of a sufficient API to circumvent such problems by contacting me -- |
This comment has been minimized.
This comment has been minimized.
@khwilliamson - Status changed from 'open' to 'resolved' |
This comment has been minimized.
This comment has been minimized.
From alex.hartmaier@gmail.comOn Mon, Sep 15, 2014 at 9:53 PM, Karl Williamson via RT <
I can confirm that Wx now successfully installs on Xubuntu 14.04 64bit when Thank you very much for your work Karl! Best regards, Alex
|
Migrated from rt.perl.org#121930 (status was 'resolved')
Searchable as RT121930$