Bug 56892 - a2ps fails on german systems
a2ps fails on german systems
Status: CLOSED DUPLICATE of bug 40532
Product: Red Hat Linux
Classification: Retired
Component: a2ps (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
: 541014 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-29 12:33 EST by Need Real Name
Modified: 2010-05-08 16:52 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-10 04:36:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
german locale output of "a2ps -o file.ps /etc/hosts" (17.45 KB, text/plain)
2001-12-02 15:59 EST, Bernd Bartmann
no flags Details
C locale output of "a2ps -o file.ps /etc/hosts" (17.44 KB, text/plain)
2001-12-02 16:02 EST, Bernd Bartmann
no flags Details

  None (edit)
Description Need Real Name 2001-11-29 12:33:28 EST
Description of Problem:

a2ps produces an postscript document that is not understood by gv if german locale is set.

Version-Release number of selected component (if applicable):

Program versions:
gv 3.5.8
GNU a2ps 4.13

RPM versions:
gv-3.5.8-13
a2ps-4.13b-15

All updates until now (Nov. 29th 2001) are applied.

How Reproducible:

Only under german environment:

[achim@localhost achim]$ locale
LANG=de_DE
LC_CTYPE="de_DE"
LC_NUMERIC="de_DE"
LC_TIME="de_DE"
LC_COLLATE="de_DE"
LC_MONETARY="de_DE"
LC_MESSAGES="de_DE"
LC_PAPER="de_DE"
LC_NAME="de_DE"
LC_ADDRESS="de_DE"
LC_TELEPHONE="de_DE"
LC_MEASUREMENT="de_DE"
LC_IDENTIFICATION="de_DE"
LC_ALL=
[achim@localhost achim]$ a2ps amex-adresse -o amex-adresse.ps
[amex-adresse (unformatiert): 1 Seite auf einem Blatt]
[Insgesamt: 1 Seite auf einem Blatt] in die Datei `amex-adresse.ps' geschrieben
gv amex-adresse.ps 

A message window appears:

Error Message:

Error: /undefinedGNU Ghostscript 6.51: Unrecoverable error, exit code 1
 in 15,000000
Operand stack:
   th
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1028/1476(ro)(G)--   --dict:0/20(G)--   --dict:84/200(L)--   -


The document was:

American Express Int. INC
Theodor-Heuss-Allee 112
60486 Frankfurt
Faxnummer: 069 9797 1500

so there is no real "german" encoding problem and it does not depend on the text.

I will append the postscript file to the report.
Comment 1 Need Real Name 2001-11-29 12:46:54 EST
It seems to be imposible to attach a file with Opera, please download it from
http://www.zaik.uni-koeln.de/~achim/amex-adresse.ps
Comment 2 Bernd Bartmann 2001-11-30 07:22:14 EST
This is probably the same as my bug report 56881.
Comment 3 Need Real Name 2001-11-30 16:24:14 EST
Ok, I tried to choose english as session locale:



[achim@localhost achim]$ locale

LANG=en.ISO-8859-1

LC_CTYPE="en.ISO-8859-1"

LC_NUMERIC="en.ISO-8859-1"

LC_TIME="en.ISO-8859-1"

LC_COLLATE="en.ISO-8859-1"

LC_MONETARY="en.ISO-8859-1"

LC_MESSAGES="en.ISO-8859-1"

LC_PAPER="en.ISO-8859-1"

LC_NAME="en.ISO-8859-1"

LC_ADDRESS="en.ISO-8859-1"

LC_TELEPHONE="en.ISO-8859-1"

LC_MEASUREMENT="en.ISO-8859-1"

LC_IDENTIFICATION="en.ISO-8859-1"

LC_ALL=



a2ps results in a core dump...



[achim@localhost achim]$ ulimit -S -c unlimited

[achim@localhost achim]$ a2ps -1 partitionen -o partitionen.ps

Segmentation fault (core dumped)

[achim@localhost achim]$ gdb /usr/bin/a2ps --core=core        

... and so on...



(gdb) bt 

#0  0x400cb62b in strncmp (s1=0x0, s2=0x8083841 "ja", n=2)

    at ../sysdeps/generic/strncmp.c:64

#1  0x0804afe4 in strcpy () at ../sysdeps/generic/strcpy.c:31

#2  0x40065306 in __libc_start_main (main=0x804adf0 <strcpy+4472>, argc=5, 

    ubp_av=0xbffffa14, init=0x8049640, fini=0x8079270 <strverscmp+25484>, 

    rtld_fini=0x4000d2cc <_dl_fini>, stack_end=0xbffffa0c)

    at ../sysdeps/generic/libc-start.c:129



I think there is need of extra testing....
Comment 4 Need Real Name 2001-12-01 10:10:49 EST
The coredump does not give any clue to the position in source, so I've rebuilt it with CFLAGS="-g -O0" from the source rpm

here is the "real" backtrace:
#0  0x400cb62b in strncmp (s1=0x0, s2=0x808ff29 "ja", n=2)
    at ../sysdeps/generic/strncmp.c:64
#1  0x0804b6bb in main (argc=5, argv=0xbffffa14) at main.c:1024

The corresponding line is

  /* Process special case: Japanese Document */
  if (! strncmp (locale, "ja", 2) )
    job->requested_encoding_name = xstrdup ("euc-jp");

The variable locale is NULL.

These lines come from the a2ps-4.13-autoenc.patch, I could not find out the author of this patch.
Comment 5 Need Real Name 2001-12-02 15:00:39 EST
The core dump happens if LC_* or LANG is set to a value that does not appear with `locale -a`. That happens even if you use values from the gdm chooser.

But still the generated postscript file causes errors with gv with any other locale except english ones...
Comment 6 Bernd Bartmann 2001-12-02 15:57:40 EST
100% reproducible here on my german system.

[bart@riker bart]$ locale
LANG=de_DE@euro
LC_CTYPE="de_DE@euro"
LC_NUMERIC="de_DE@euro"
LC_TIME="de_DE@euro"
LC_COLLATE="de_DE@euro"
LC_MONETARY="de_DE@euro"
LC_MESSAGES="de_DE@euro"
LC_PAPER="de_DE@euro"
LC_NAME="de_DE@euro"
LC_ADDRESS="de_DE@euro"
LC_TELEPHONE="de_DE@euro"
LC_MEASUREMENT="de_DE@euro"
LC_IDENTIFICATION="de_DE@euro"
LC_ALL=

When using the above locale settings it also doesn't work for me. After
"LC_ALL=C ; export LC_ALL" I get this settings:
[bart@riker tmp]$ locale
LANG=de_DE@euro
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

In both cases I tried a simple "a2ps -o file.ps /etc/hosts". It only works with
LC_ALL=C. With the german locale neither gv nor my postscript printer like the
a2ps output. I have attached the two files created by a2ps. By using "diff -u
file1.ps file2.ps" I found out that when using the german locale floating point
number in the postscript output contain a comma instead of a dot. This is
correct for the german locale but not in a postscript source code.
Comment 7 Bernd Bartmann 2001-12-02 15:59:54 EST
Created attachment 39327 [details]
german locale output of "a2ps -o file.ps /etc/hosts"
Comment 8 Bernd Bartmann 2001-12-02 16:02:34 EST
Created attachment 39328 [details]
C locale output of "a2ps -o file.ps /etc/hosts"
Comment 9 Need Real Name 2001-12-02 17:31:44 EST
Great, thats the reason!
I think, it is the best way to implement an own function for floating point numbers in postscript documents instead of switching the locale. I hope someone will do it soon. Thanks for help.
Comment 10 Tim Waugh 2002-01-09 10:11:31 EST
This bug looks like the same things as bug #53715.
Comment 11 Bernd Bartmann 2002-01-09 11:39:43 EST
Sorry guys, but I can't have a look at bug #53715: Permission denied. Even when
I log in with my normal Bugzilla account I'm not allowed to see this bug.
Comment 12 Need Real Name 2002-01-09 16:31:42 EST
Yes, I do have the same problem!
Comment 13 Tim Waugh 2002-01-10 04:36:27 EST

*** This bug has been marked as a duplicate of 40532 ***
Comment 14 Brian Pepple 2010-05-08 16:52:46 EDT
*** Bug 541014 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.