libsvga1 broken on amd64

Bug #1368449 reported by Janus on 2014-09-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
svgalib (Ubuntu)

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() {
return 0;

The infinite loop is simply a jump to the same location:
=> 0x00007ffff75ba360 <+304>: jmp 0x7ffff75ba360 <vga_setpalette+304>

On i386, this problem doesn't occur and the program does not infinitely loop.

Janus (ysangkok+launchpad) wrote :

I made a backtrace like this:

apt-get source libsvga1
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/Skrivebord/svgalib-1.4.3/a.out
[svgalib: allocated virtual console #9]
Program received signal SIGINT, Interrupt.
port_in (port=986) at /home/janus/Desktop/svgalib-1.4.3/src/libvga.h:272
272 static __inline__ int port_in(int port) { return 0; }
(gdb) bt
#0 port_in (port=986) at /home/janus/Desktop/svgalib-1.4.3/src/libvga.h:272
#1 0x00000000004104c2 in set_lut (index=0, red=0, green=0, blue=0)
    at /home/janus/Desktop/svgalib-1.4.3/src/vgapal.c:63
#2 0x000000000041072e in vga_setpalette (index=0, red=0, green=0, blue=0)
    at /home/janus/Desktop/svgalib-1.4.3/src/vgapal.c:162
#3 0x00000000004093d3 in gl_setpalettecolor (c=0, r=0, g=0, b=0)
    at /home/janus/Desktop/svgalib-1.4.3/gl/palette.c:22
#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/Desktop/svgalib-1.4.3/src/vgapal.c:63
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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers