Bug 15193 - aalib linux and slang modes are broken on sparc32.
aalib linux and slang modes are broken on sparc32.
Status: CLOSED RAWHIDE
Product: Red Hat Powertools
Classification: Retired
Component: aalib (Show other bugs)
7.1
sparc Linux
low Severity medium
: ---
: ---
Assigned To: Tim Powers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-02 19:46 EDT by Bert de Bruijn
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-07 11:30:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bert de Bruijn 2000-08-02 19:46:07 EDT
-driver linux and -driver slang modes are broken for 3 aalib programs I
tried: aview, aafire, and bb (all from the rawhide powertools).

the curses driver works as expected.

(I'm testing on a sparc32 machine with cgSix framebuffer)
Comment 1 Tim Powers 2000-08-03 14:52:18 EDT
Are you using the packages on 6.2? If so, keep in mind that the stuff in rawhide
is *not* binary compatible with 6.x releases. If you are doing this, rebuild the
packages on your machine.
Comment 2 Bert de Bruijn 2000-08-03 18:53:04 EDT
This is on a rawhide machine, all packages upgraded manually from 6.2 to rawhide
(dated about 2000-08-01, just before pinstripe was released for i386.).
(BTW, you can't install a clean rawhide on sparc32 because redhat doesn't
provide install/upgrade boot images for this architecture.)
I've rebuilt the aalib package from source to see whether the compile generated
strange errors, but it didn't. And it still doesn't work.
Comment 3 Tim Powers 2000-08-04 12:00:51 EDT
Is it segfaulting, dumping core ? Can you describe in detail what's happening
when you try to use the -driver flag? Does it work without the flag?
Comment 4 Bert de Bruijn 2000-08-05 11:55:48 EDT
No core dump. Just wrong output on the screen (color when it shouldn't give
color, but the amount of characters sent to the screen seems to be correct).
If I can get a digital camera to my desktop, I can provide you with a sample of
how it looks. Or would a copy of /dev/fb0, /dev/vcsa1, /dev/vcs1 help ?
(btw, under strace it works just fine, with every driver selection. same thing
when logged in through the network with ssh localhost)
I don't know which driver aview/bb/aafire pick when you don't ask for a specific
one, but the output is the same as with the slang and linux drivers, so it's one
of those two.
Comment 5 Bert de Bruijn 2000-08-05 18:45:52 EDT
I made two screenshots of an "aview" session, one in curses mode and one in
slang mode (the "linux" driver does the same thing as the slang driver).
http://www.ccl.kuleuven.ac.be/~bob/aview-curses.png
http://www.ccl.kuleuven.ac.be/~bob/aview-slang.png
(while making these screenshots, I found another bug in a sparc32 package:
raw2gif, from the libungif-progs rpm, doesn't work on sparc (dumps core, no
image output). Copying the raw image file to an i386 linux box and running the
same version of raw2gif there does work.)

These images were made by doing
dd if=/dev/fb0 of=/tmp/screendump.raw bs=1
raw2gif -s 1152 892 /tmp/screendump.raw > /tmp/screendump.gif
convert /tmp/screendump.gif /tmp/screendump.png
Comment 6 Bert de Bruijn 2000-08-05 20:51:49 EDT
I found a solution for the aalib problem, but it will have to be integrated in
the sources as an architecture dependent #ifdef (or similar).
The character/attribute byte-pairs in /dev/vcsa* are ordered attribute,character
on sparc, but character,attribute on intel.
So in aalib, those two bytes have to be written in an arch-specific order. With
the following change (ie. putc() the character byte after the attribute byte
instead of vice versa), bb/aafire/aview work perfectly in linux and slang driver
mode on Linux/sparc :

--- /usr/src/redhat/BUILD/aalib-1.2/aalinux.c-orig      Sun Aug  6 02:11:04 2000
+++ /usr/src/redhat/BUILD/aalib-1.2/aalinux.c-sparc  Sun Aug  6 02:11:37 2000
@@ -112,11 +112,11 @@
     {0x07, 0x08, 0x0f, 0x0f, 0x70, 0x17};
     fseek(vc, 4, 0);
     for (x = 0; x < end; x++) {
-       putc(c->textbuffer[x], vc);
        if (c->attrbuffer[x] < 7)
            putc(data[c->attrbuffer[x]], vc);
        else
            putc(0x27, vc);
+       putc(c->textbuffer[x], vc);
     }
     fflush(vc);
 }

Comment 7 Tim Powers 2000-08-05 23:33:44 EDT
Thanks for the patch. I'll be sure to put it in tomorrow. As for the bug with
libungif, can you please file a bug for the distro with that component so that
it gets to the package owner quickly (and so that we can track the status of the
bug)? 

Thanks again for the patch. I'll try to get you a SRPM tomorrow that you can use
and test.

Tim
Comment 8 Tim Powers 2000-08-07 11:30:52 EDT
OK. I lied. I didn't get to it yesterday, but I got to it today. The patch I
included is below, I am now marking this as resolved. If you have anymore
problems please reopen the bug:

--- aalib-1.2/aalinux.c.sparc	Mon Aug  7 11:04:29 2000
+++ aalib-1.2/aalinux.c	Mon Aug  7 11:06:02 2000
@@ -112,11 +112,11 @@
     {0x07, 0x08, 0x0f, 0x0f, 0x70, 0x17};
     fseek(vc, 4, 0);
     for (x = 0; x < end; x++) {
-	putc(c->textbuffer[x], vc);
-	if (c->attrbuffer[x] < 7)
-	    putc(data[c->attrbuffer[x]], vc);
-	else
-	    putc(0x27, vc);
+	   if (c->attrbuffer[x] < 7)
+	     putc(data[c->attrbuffer[x]], vc);
+	   else
+	     putc(0x27, vc);
+       putc(c->textbuffer[x], vc);
     }
     fflush(vc);
 }

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