Skip to contentSkip to conversation

x86_64 host curses interface: spacing/garbling

Qemu-devel Anthony Liguori 4 participants 15 messages Jun 2, 2010 – Jun 27, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

This patch should address the problem. I've submitted it to qemu-devel.

** Patch added: "0001-Fix-console_write_ch-on-64-bit-big-endian-hosts.patch"
http://launchpadlibrarian.net/49569832/0001-Fix-console_write_ch-on-64-bit-big-endian-hosts.patch

** Changed in: qemu
Status: New => In Progress

Signature · 22 lines
x86_64 host curses interface: spacing/garbling
https://bugs.launchpad.net/bugs/568614
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: In Progress

Bug description:
Environment:
Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

Steps to reproduce:
1. Have a host system running 64-bit Linux.
2. Start a qemu VM with the -curses flag.

Expected results:
Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

Actual results:
Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

The attached patch fixes this problem on 0.12.3 on my installation without changing behavior on a 32-bit machine.  I don't know enough of the semantics of console_ch_t to know if this is the "correct" fix or if there should be, say, an extra cast somewhere instead.
#2 lore raw
In reply to a message not in the archive

Perhaps you have found an endianness bug as well, but my issue is with word size (my host is a 64-bit Intel). I manually applied the patch to a 0.12.3 build, and I am still seeing the problem with the curses console.

It seems that the console_ch_t type is used in a number of different contexts. The console.c and console.h files use console_ch_t fairly uniformly. However, the `screen' array in curses.c is cast to both uint8_t* and chtype* (unsigned int* according to my curses library) and passed as console_ch_t* (unsigned long*) to vga_hw_text_update. That's three different bit-sizes on my machine... is it possible that the problem lies here?

Signature · 22 lines
x86_64 host curses interface: spacing/garbling
https://bugs.launchpad.net/bugs/568614
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: In Progress

Bug description:
Environment:
Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

Steps to reproduce:
1. Have a host system running 64-bit Linux.
2. Start a qemu VM with the -curses flag.

Expected results:
Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

Actual results:
Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

The attached patch fixes this problem on 0.12.3 on my installation without changing behavior on a 32-bit machine.  I don't know enough of the semantics of console_ch_t to know if this is the "correct" fix or if there should be, say, an extra cast somewhere instead.
#3 lore raw
In reply to a message not in the archive

Hi Devin,

Can you test if this bug still exists with 0.14 (or better still, a git build)?

Brad

Signature · 28 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.
#4 lore raw
In reply to a message not in the archive

I just compiled from git and the problem persists.

I will reiterate that the issue appears to be with the word size of the types used, not with endianness; see comment 4. I have not dug any further into the QEMU code to see if I find a more "correct-looking" solution than the quick patch I have attached to this bug.

Signature · 28 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.
#5 lore raw
In reply to a message not in the archive

any news on that bug?

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#6 lore raw
In reply to a message not in the archive

If I remember correctly, the type is unsigned long because it needs to match "chtype" as declared in curses.h. On some implementations of curses it may be declared differently, we really should use the "chtype" type directly but console.h is also used when the use of curses was disabled in qemu config.

I'm pretty sure the curses support has been tested on machines of both endianness at one point, but mostly with ncurses only.

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#7 lore raw
In reply to a message not in the archive

I just checked out the ncurses source - it looks like the type of "chtype" actually depends on how ncurses is configured at build time:

curses.h.in:
#if @cf_cv_enable_lp64@ && defined(_LP64)
typedef unsigned chtype;
typedef unsigned mmask_t;
#else
typedef unsigned @cf_cv_typeof_chtype@ chtype;
typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t;
#endif

So even if Qemu targets only ncurses, we can't assume that chtype is anything in particular.

In light of that, I guess this bug boils down to "let's use chtype directly," which (naively) seems like it could be #ifdef'd pretty easily.

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#8 lore raw
In reply to a message not in the archive

This is probably the source of the problem. As you say it'd be best to use chtype directly if it can be done cleanly, unfortunately it looks like it'll add a curses specific snippet in console.h, but so be it. The only other option is to add a conversion step in curses.c and give up zero-copy passing screen data to curses, which I'd like to avoid.

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#9 lore raw
In reply to a message not in the archive

How about using CONFIG_CURSES? If we --enable-curses, then we know we have curses.h and chtype. If we --disable-curses, then we don't care.

Patch attached. It's a no-op if curses is disabled, and it fixes the issue on my machine with curses enabled. I had to undef the color constants from curses.h so we didn't conflict with enum color_names in console.c.

** Patch added: "ifdef CONFIG_CURSES, use chtype"
https://bugs.launchpad.net/qemu/+bug/568614/+attachment/2195896/+files/chtype.diff

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#10 lore raw
In reply to a message not in the archive

for which version is the last patch?
also 12.3?

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#11 lore raw
In reply to a message not in the archive

Pretty sure it was the latest Arch package: 0.14.1. Did you have trouble applying it?

I can run back and make a patch against git if you can't use this.

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#12 lore raw
In reply to a message not in the archive

no I don't believe it was your fault
I couldn't get the code compile even without your patch...

man this sucks... i had hoped it would be upstream with 0.15 but I might have to try to compile it by myself again

thanks ;)

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#13 lore raw
In reply to a message not in the archive

Alright, I've sent a patch to qemu-devel. Let's see what happens now...

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#14 lore raw
In reply to a message not in the archive

ahhhh it worked, just tried it with latest stable 0.15 git !!! finally you are my hero! =)

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  In Progress

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions
#15 lore raw
In reply to a message not in the archive

Fix had been included here:
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=df00bed0fa30a6f5712
... so closing this bug ticket now.

** Changed in: qemu
Status: In Progress => Fix Released

Signature · 31 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/568614

Title:
  x86_64 host curses interface: spacing/garbling

Status in QEMU:
  Fix Released

Bug description:
  Environment:
  Arch Linux x86_64, kernel 2.6.33, qemu 0.12.3

  Steps to reproduce:
  1. Have a host system running 64-bit Linux.
  2. Start a qemu VM with the -curses flag.

  Expected results:
  Text displayed looks as it would on a real text-mode display, and VM is therefore usable.

  Actual results:
  Text displayed contains an extra space between characters, causing text to flow off the right and bottom sides of the screen. This makes the curses interface unintelligible.

  The attached patch fixes this problem on 0.12.3 on my installation
  without changing behavior on a 32-bit machine.  I don't know enough of
  the semantics of console_ch_t to know if this is the "correct" fix or
  if there should be, say, an extra cast somewhere instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/568614/+subscriptions