libsvga1 broken on amd64
Bug #1368449 reported by
Janus
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
svgalib (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This program compiles (using "gcc lol.c -lvgagl") for amd64, but gets stuck in an infinite loop in vga_setpalette:
#include <vgagl.h>
#include <vga.h>
int main() {
gl_setcontextvg
gl_setpaletteco
return 0;
}
The infinite loop is simply a jump to the same location:
=> 0x00007ffff75ba360 <+304>: jmp 0x7ffff75ba360 <vga_setpalette
On i386, this problem doesn't occur and the program does not infinitely loop.
To post a comment you must log in.
I made a backtrace like this:
apt-get source libsvga1 Skrivebord/ svgalib- 1.4.3/a. out Desktop/ svgalib- 1.4.3/src/ libvga. h:272 Desktop/ svgalib- 1.4.3/src/ libvga. h:272 Desktop/ svgalib- 1.4.3/src/ vgapal. c:63 Desktop/ svgalib- 1.4.3/src/ vgapal. c:162 Desktop/ svgalib- 1.4.3/gl/ palette. c:22 Desktop/ svgalib- 1.4.3/src/ vgapal. c:63
cd svgalib-1.4.3
CFLAGS=-ggdb3 make static
<<make lol.c [the sample program]>>
clang -ggdb3 lol.c -lvgagl -lvga -lm -lx86 -L staticlib
sudo gdb ./a.out
(gdb) r
Starting program: /home/janus/
[svgalib: allocated virtual console #9]
^C
Program received signal SIGINT, Interrupt.
port_in (port=986) at /home/janus/
272 static __inline__ int port_in(int port) { return 0; }
(gdb) bt
#0 port_in (port=986) at /home/janus/
#1 0x00000000004104c2 in set_lut (index=0, red=0, green=0, blue=0)
at /home/janus/
#2 0x000000000041072e in vga_setpalette (index=0, red=0, green=0, blue=0)
at /home/janus/
#3 0x00000000004093d3 in gl_setpalettecolor (c=0, r=0, g=0, b=0)
at /home/janus/
#4 0x0000000000402372 in main () at lol.c:5
(gdb) frame 1
#1 0x00000000004104c2 in set_lut (index=0, red=0, green=0, blue=0)
at /home/janus/
63 while (!(inb(0x3da) & 1)); /* load the dac. Waiting for vertical */
(gdb) p inb
$1 = {int (int)} 0x41036d <port_in>
I am now trying to find out why this while-loop is infinite.