Comments (10)
OK, I'm confused.
U32uf
used to be defined entirely in perl.h
(based on preprocessor heuristics). These tests were moved to Configure
in commit a503b74 (in 2022), which was first released with perl 5.38.0. Now U32uf
is defined in config.h
based on the value of the shell variable u32uformat
(as recorded in config.sh
).
However, in your case this variable doesn't exist (which makes no sense) and so the macro expands to nothing (which is bad because it breaks all format strings the macro is used in).
Another anomaly is that your config.sh
contains definitions for ansi2knr
and d_bcmp
. The last traces of these symbols were removed in commits c9db53f and e5d7f4e (both in 2017). The last perl release that had these was 5.26.3 (in 2018).
It looks like somehow you're using (parts of?) the perl configure infrastructure from 2018 (or before) together with perl headers from 2024, so you're missing all kinds of symbols.
from perl5.
The current state of things: The OpenWRT perl is cross-compiled with a custom config.sh
. This config.sh
was originally created for perl v5.26 or earlier; it has since been manually updated with a few new values and symbols, but it has not been kept in sync with the state of Configure
in the perl source tree.
The net result is that OpenWRT's config.sh
still defines symbols that are no longer used by perl (like ansi2knr
), which is harmless, but it is also missing a bunch of other symbols that perl implicitly relies on existing. In particular, several format string definitions are missing, which results in a miscompiled perl v5.38 and v5.40.
As far as I can tell, there is nothing for us to do here: Our Configure
creates the symbols we expect. OpenWRT needs to update its config.sh
template to add the symbols that perl v5.40 expects to exist (and maybe should delete the old symbols that are no longer used). As a safeguard against this specific kind of misconfiguration, I have added a check that the format strings in question are not empty (commit c5df4fd).ยน
Therefore I am going to close this ticket until something else comes up.
ยน Now that I think about it, the problem is not that these strings are empty; it's that they don't exist. So instead of tripping a static assertion, this code would be an undeclared symbol error on current OpenWRT (util.c:125:27: error: โI32dfโ undeclared here
). But in either case, the net result is the same: The compiler will produce an error instead of creating a miscompiled perl executable.
from perl5.
This is at least two different issues.
The first issue is that the locale code is throwing an error (presumably because LC_ALL
is set to an invalid value, or at least what it considers to be invalid).
The second issue is that the code that tries to throw the error crashes. I suspect U32uf
is set to ""
for some reason.
What does perl -V:u32uformat
say on your platform?
from perl5.
What does
perl -V:u32uformat
say on your platform?
$ perl -V:u32uformat
u32uformat='UNKNOWN';
from perl5.
Huh.
Did you compile this perl yourself? If so, can you post the generated config.sh
and config.h
files?
from perl5.
Huh. Did you compile this perl yourself? If so, can you post the generated
config.sh
andconfig.h
files?
It was built as part of OpenWrt router image for my ARM router.
There was a version bump recently to 5.40. Since then the problem has appeared.
config.h:
#define U32uf /**/
from perl5.
Thanks for looking into this.
And i think you are right, it seems OpenWrt generates a custom config.sh file based on
https://github.com/openwrt/packages/blob/master/lang/perl/files/base.config
which explains ansi2knr
๐
So, OpenWrt's Perl package configuration is broken at the moment.
from perl5.
I fixed all outdated symbols and added new ones and now got this:
$ perl
locale.c: 1480: panic: 'C.UTF-8;C;C;C;C;C' needs an '=' to split name=value
; errno=0
Called by locale.c: 4097
Any hint what Perl expects here exactly ?
LC_ALL looks okay to me ๐
From locale.c
:
# ifndef PERL_LC_ALL_USES_NAME_VALUE_PAIRS
if (! name_value) {
/* Get the index of the category in this position */
index = map_LC_ALL_position_to_index[component_number++];
}
else
# endif
{ /* Get the category part when each component is the
* 'category=locale' form */
category_end = strchr(s, '=');
/* The '=' terminates the category name. If no '=', is improper
* form */
if (! category_end) {
error = no_equals;
goto failure;
}
It seems PERL_LC_ALL_USES_NAME_VALUE_PAIRS
is defined ?
This means: d_perl_lc_all_uses_name_value_pairs='define'
from perl5.
I haven't been closely following this conversation, but this value is defined from a Configure probe. I skimmed the conversation and see mention of cross compilation. Could it be that this is a result of a mismatch between things? Platforms use two different methods to denote LC_ALL when not all locale categories have the same locale. The system you ran perl
on uses the positional notation, but the configuration that is being used is expecting name=value notation. Here's some relevant lines from a FreeBSD box that has positional notation
/*#define PERL_LC_ALL_USES_NAME_VALUE_PAIRS / **/
#define PERL_LC_ALL_SEPARATOR "/" /**/
#define PERL_LC_ALL_CATEGORY_POSITIONS_INIT { 1, 2, 3, 4, 5, 6 } /**/
In your case the separator is a semi-colon instead of a slash. It is likely that the 1..6 is correct for your box.
If you changed your config.h
to correspond, locale.c
would not generate this error. But I don't know why the incorrect values were generated.
from perl5.
Yep, figured it out, OpenWrt's d_perl_lc_all_*
and corresponding perl_lc_all_*
weren't set properly in config.sh.
After fixing it everything works as expected.
Thanks!
from perl5.
Related Issues (20)
- 5.40.0 onwards won't build Darwin fat binaries HOT 17
- Segmentation fault in Perl_csighandler3 when used XS with threads. HOT 10
- BBC: Blead Breaks File::Tabular HOT 10
- feature 'class': out of memory error if subclassing a class with an explicit new HOT 3
- t/op/try.t: one test fails during deparsing tests HOT 3
- strftime crashes with a blessed format HOT 3
- [doc] Bug in Perl Threads tutorial section "A Thread Pitfall: Deadlocks"
- BBC: Blead Breaks Mojolicious HOT 3
- Cross compilation HOT 2
- BBC: Blead Breaks CPAN HOT 4
- Class methods can still be replaced outside the class HOT 10
- BBC: Blead Breaks DBIx::Class HOT 2
- Extensive CPAN breakage from two code removal projects HOT 6
- Perl is always configured for AFS on RHEL9 and derivatives
- 0351a629e7 led to build-time failure in Class-MethodCache
- CPAN distributions broken by switch removal HOT 3
- BBC: Scalar-List-Utils-1.65 breaks Tie::RefHash::Weak HOT 10
- Deprecation of GIMME long promised but not yet scheduled
- Script run does not always confine digits to the same set of ten HOT 1
- goto &SUB segfaults with builtin::refaddr, reftype, stringify, etc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl5.