GNU bug report logs -
#10742
The resulting output is as follows, which I think is wrong.
Previous Next
Reported by: Alírio Eyng <alirioeyng <at> ig.com.br>
Date: Tue, 7 Feb 2012 00:33:01 UTC
Severity: normal
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
Full log
Message #20 received at 10742 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Alírio,
Sorry for the delay!
Alírio Eyng <eae_9 <at> hotmail.com> skribis:
> bash-4.1# meta/guile -c '(setlocale LC_ALL "") (pk (fluid-ref %default-port-encoding))'
> Backtrace:
> In ice-9/boot-9.scm:
> 149: 2 [catch #t #<catch-closure 81d9580> ...]
> 157: 1 [#<procedure 80c92a8 ()>]
> In unknown file:
> ?: 0 [catch-closure]
>
> ERROR: In procedure catch-closure:
> ERROR: Throw to key `decoding-error' with args `("scm_from_stringn" "input locale conversion error" 22 #vu8(40 115 101 116 108 111 99 97 108 101 32 76 67 95 65 76 76 32 34 34 41 32 40 112 107 32 40 102 108 117 105 100 45 114 101 102 32 37 100 101 102 97 117 108 116 45 112 111 114 116 45 101 110 99 111 100 105 110 103 41 41))'.
Hmm. 22 here is EINVAL, returned by u32_conv_from_encoding, and
probably coming from iconv_open(3) or iconv(3).
Can you try this patch and tell us what gets written?
[Message part 2 (text/x-patch, inline)]
diff --git a/libguile/script.c b/libguile/script.c
index 83daf8a..3d22923 100644
--- a/libguile/script.c
+++ b/libguile/script.c
@@ -388,6 +388,7 @@ locale_arguments_to_string_list (int argc, char **const argv)
const char *encoding;
encoding = environ_locale_charset ();
+ printf ("encoding: `%s'\n", encoding);
for (i = argc - 1, lst = SCM_EOL;
i >= 0;
i--)
[Message part 3 (text/plain, inline)]
Can you show the output of ‘ldd --version’?
Finally, can you try the program below? Compile it as indicated in the
file, and run it as:
$ LD_PRELOAD=iconv.so guile -c 1
It will print the series of iconv_open(3) calls that are made, and
hopefully the one that fails.
Thanks,
Ludo’.
[iconv.c (text/x-csrc, inline)]
/* Display looked up environment variables.
Compile as shown at the bottom of this file.
Run with:
$ LD_PRELOAD=./iconv_open.so some-program
Written by Ludovic Courtès <ludo-mXXj517/zsQ <at> public.gmane.org>. Hereby placed under the
LGPLv3+.
*/
#include <stdio.h>
#include <gnu/lib-names.h>
#include <dlfcn.h>
#include <errno.h>
static void *glibc;
static char * (*glibc_iconv_open) (const char *, const char *);
static void load_glibc (void) __attribute__ ((__constructor__));
static void
load_glibc (void)
{
glibc = dlopen (LIBC_SO, RTLD_LAZY);
glibc_iconv_open = dlsym (glibc, "iconv_open");
}
char *
iconv_open (const char *to, const char *from)
{
char *result;
errno = 0;
result = glibc_iconv_open (to, from);
printf ("iconv_open (\"%s\", \"%s\") = %p (%m)\n",
to, from, result);
return result;
}
/*
Local Variables:
compile-command: "gcc -Wall -shared -fPIC -o iconv.so iconv.c"
End:
*/
This bug report was last modified 13 years and 145 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.