Bug 56892

Summary: a2ps fails on german systems
Product: [Retired] Red Hat Linux Reporter: Need Real Name <achim.gaedke>
Component: a2psAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: bernd.bartmann, fabioortlieb
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-10 09:36:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
german locale output of "a2ps -o file.ps /etc/hosts"
none
C locale output of "a2ps -o file.ps /etc/hosts" none

Description Need Real Name 2001-11-29 17:33:28 UTC
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 17:46:54 UTC
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 12:22:14 UTC
This is probably the same as my bug report 56881.

Comment 3 Need Real Name 2001-11-30 21:24:14 UTC
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 15:10:49 UTC
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 20:00:39 UTC
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 20:57:40 UTC
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 20:59:54 UTC
Created attachment 39327 [details]
german locale output of "a2ps -o file.ps /etc/hosts"

Comment 8 Bernd Bartmann 2001-12-02 21:02:34 UTC
Created attachment 39328 [details]
C locale output of "a2ps -o file.ps /etc/hosts"

Comment 9 Need Real Name 2001-12-02 22:31:44 UTC
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 15:11:31 UTC
This bug looks like the same things as bug #53715.


Comment 11 Bernd Bartmann 2002-01-09 16:39:43 UTC
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 21:31:42 UTC
Yes, I do have the same problem!


Comment 13 Tim Waugh 2002-01-10 09:36:27 UTC

*** This bug has been marked as a duplicate of 40532 ***

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