This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Provide more information in the message for "strxfrm() gets absurd".
authorNicholas Clark <nick@ccl4.org>
Fri, 9 Sep 2011 13:53:06 +0000 (15:53 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 9 Sep 2011 13:53:06 +0000 (15:53 +0200)
Prefix it with "panic", report the two lengths that caused the sanity test
failure, and add the message to perldiag.pod.

locale.c
pod/perldiag.pod
t/porting/diag.t

index 163f412..5893212 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -232,7 +232,8 @@ Perl_new_collate(pTHX_ const char *newcoll)
          const Size_t fb = strxfrm(xbuf, "ab", XFRMBUFSIZE);
          const SSize_t mult = fb - fa;
          if (mult < 1)
-             Perl_croak(aTHX_ "strxfrm() gets absurd");
+             Perl_croak(aTHX_ "panic: strxfrm() gets absurd - a => %"UVuf", ab => %"UVuf,
+                        (UV) fa, (UV) fb);
          PL_collxfrm_base = (fa > (Size_t)mult) ? (fa - mult) : 0;
          PL_collxfrm_mult = mult;
        }
index 0ce1c8d..d4373d6 100644 (file)
@@ -3557,6 +3557,12 @@ scalar's string buffer.
 (P) The sv_insert() routine was told to remove more string than there
 was string.
 
+=item panic: strxfrm() gets absurd - a => %u, ab => %u
+
+(P) The interpreter's sanity check of the C function strxfrm() failed.
+In your current locale the returned transformation of the string "ab" is
+shorter than that of the string "a", which makes no sense.
+
 =item panic: top_env
 
 (P) The compiler attempted to do a goto, or something weird like that.
index a3f6272..eddb535 100644 (file)
@@ -486,7 +486,6 @@ Size magic not implemented
 %s%s on %s %s %s
 Starting Full Screen process with flag=%d, mytype=%d
 Starting PM process with flag=%d, mytype=%d
-strxfrm() gets absurd
 SWASHNEW didn't return an HV ref
 -T and -B not implemented on filehandles
 The flock() function is not implemented on NetWare