[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

glibc/gettext inconsistancy ?



Hello,

current gettext version in woody is 0.10.40.
glibc is libc6-dev 2.2.5-4

libc package provide /usr/include/libintl.h file which differs from the
file provided in gettext 0.10.40.

The following program fail because it don't try to open
fr_FR/LC_MESSAGES/test.mo
I consider it's important that devlopers could write application and
their related translation files in their own directory (not in system
directory). (and the same way application may be installed in user
directory)

I run this program with $LANG=fr_FR
As strace output show, no .mo file is searched.
The second strace output is done while this program is compiled and
linked with gettext 0.10.35 and it works.

My experiments show that gettext 0.10.35 is ok and gettext 0.10.40 and
0.11.1 failed. Has the method changed to do this ? Where is it
documented ?

#include <libintl.h>
#include <locale.h>
#include <stdio.h>

int main(){
  bindtextdomain("test","");
  textdomain("test");
  printf(gettext("hello\n"));
  return 0;
}

$> strace -v ./a.out
...
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_dev=makedev(33, 2), st_ino=81343, st_mode=S_IFREG|0644,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=80,
st_size=38980, st_atime=2002/04/26-16:26:08,
st_mtime=2002/04/26-12:28:44, st_ctime=2002/04/26-12:28:44}) = 0
old_mmap(NULL, 38980, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0H\222\1"...,
1024) = 1024
fstat64(3, {st_dev=makedev(33, 2), st_ino=156098, st_mode=S_IFREG|0755,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=2264,
st_size=1153816, st_atime=2002/04/26-16:26:08,
st_mtime=2002/03/24-18:00:40, st_ctime=2002/04/26-12:19:06}) = 0
old_mmap(NULL, 1166592, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x4001e000
mprotect(0x40131000, 40192, PROT_NONE)  = 0
old_mmap(0x40131000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,

3, 0x113000) = 0x40131000
old_mmap(0x40137000, 15616, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40137000
close(3)                                = 0
munmap(0x40014000, 38980)               = 0
brk(0)                                  = 0x80496c8
brk(0x80496f8)                          = 0x80496f8
brk(0x804a000)                          = 0x804a000
getcwd("/home/philippe", 4098)          = 15
fstat64(1, {st_dev=makedev(0, 8), st_ino=7, st_mode=S_IFCHR|0620,
st_nlink=1, st_uid=1000, st_gid=5, st_blksize=1024, st_blocks=0,
st_rdev=makedev(136, 5), st_atime=2002/04/26-16:26:08,
st_mtime=2002/04/26-16:26:08, st_ctime=2002/04/26-16:16:43}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40014000
write(1, "hello\n", 6hello
)                  = 6
munmap(0x40014000, 4096)                = 0
_exit(0)                                = ?


--------------------------------------------------------------------------------



$> gcc test.c -I/home/philippe/gettext-0.10.35/bin/include
/home/philippe/gettext-0.10.35/bin/lib/libintl.a
$> strace -v ./a.out
...

open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_dev=makedev(33, 2), st_ino=81343, st_mode=S_IFREG|0644,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=80,
st_size=38980, st_atime=2002/04/26-16:56:13,
st_mtime=2002/04/26-12:28:44, st_ctime=2002/04/26-12:28:44}) = 0
old_mmap(NULL, 38980, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0H\222\1"...,
1024) = 1024
fstat64(3, {st_dev=makedev(33, 2), st_ino=156098, st_mode=S_IFREG|0755,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=2264,
st_size=1153816, st_atime=2002/04/26-16:56:13,
st_mtime=2002/03/24-18:00:40, st_ctime=2002/04/26-12:19:06}) = 0
old_mmap(NULL, 1166592, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x4001e000
mprotect(0x40131000, 40192, PROT_NONE)  = 0
old_mmap(0x40131000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,

3, 0x113000) = 0x40131000
old_mmap(0x40137000, 15616, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40137000
close(3)                                = 0
munmap(0x40014000, 38980)               = 0
brk(0)                                  = 0x804bb48
brk(0x804bb68)                          = 0x804bb68
brk(0x804c000)                          = 0x804c000
getcwd("/home/philippe", 4098)          = 15
open("/home/philippe/gettext-0.10.35/bin/share/locale/locale.alias",
O_RDONLY) = 3
fstat64(3, {st_dev=makedev(34, 2), st_ino=102513, st_mode=S_IFREG|0644,
st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8,
st_size=2005, st_atime=2002/04/26-16:55:50,
st_mtime=2002/04/26-16:48:34, st_ctime=2002/04/26-16:48:34}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40014000
read(3, "# Locale name alias data base\n# "..., 4096) = 2005
brk(0x804d000)                          = 0x804d000
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40014000, 4096)                = 0
open("./locale.alias", O_RDONLY)        = -1 ENOENT (No such file or
directory)
open("/home/philippe//fr_FR/LC_MESSAGES/test.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
************************************HERE :
IT TRIES TO OPEN test.mo**********************************
open("/home/philippe//fr/LC_MESSAGES/test.mo", O_RDONLY) = -1 ENOENT (No

such file or directory)
fstat64(1, {st_dev=makedev(0, 8), st_ino=7, st_mode=S_IFCHR|0620,
st_nlink=1, st_uid=1000, st_gid=5, st_blksize=1024, st_blocks=0,
st_rdev=makedev(136, 5), st_atime=2002/04/26-16:56:13,
st_mtime=2002/04/26-16:56:13, st_ctime=2002/04/26-16:16:43}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40014000
write(1, "hello\n", 6hello
)                  = 6
munmap(0x40014000, 4096)                = 0
_exit(0)                                = ?



        Hope my tests give some help to improve excellent Debian
quality,

--
Philippe Ribet

                         The README file said
              "Requires Windows 95, NT 4.0, or better."
                    So... I installed it on Linux!




-- 
To UNSUBSCRIBE, email to debian-testing-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: