qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
@ 2024-01-31  8:13 Zhang Wen
  2024-02-01 12:11 ` Michael Tokarev
  0 siblings, 1 reply; 10+ messages in thread
From: Zhang Wen @ 2024-01-31  8:13 UTC (permalink / raw)
  To: qemu-trivial
  Cc: pbonzini, marcandre.lureau, berrange, thuth, philmd, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

With this patch, qemu requires keyboard-config when libxkbcommon is 
found on the system. So if the qemu is configured when libxkbcommon is 
installed but not keyboard-config, the configure stage will produce an 
error message, thus avoid coredump in the build stage.

[-- Attachment #2: 0001-requires-xkeyboard-config-when-libxkbcommon-is-avail.patch --]
[-- Type: text/plain, Size: 1213 bytes --]

From e0b1e479e8a82f7a7940ca70b5136bf10e36756b Mon Sep 17 00:00:00 2001
From: Zhang Wen <zhw2101024@gmail.com>
Date: Fri, 26 Jan 2024 17:09:10 +0800
Subject: [PATCH] requires xkeyboard-config when libxkbcommon is available to
 avoid build error

Signed-off-by: Zhang Wen <zhw2101024@gmail.com>
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index d0329966f1..233c006754 100644
--- a/meson.build
+++ b/meson.build
@@ -1093,6 +1093,7 @@ else
   xkbcommon = dependency('xkbcommon', required: get_option('xkbcommon'),
                          method: 'pkg-config')
 endif
+xkeyboard_config = dependency('xkeyboard-config')
 
 slirp = not_found
 if not get_option('slirp').auto() or have_system
@@ -3978,7 +3979,7 @@ subdir('qga')
 if xkbcommon.found()
   # used for the update-keymaps target, so include rules even if !have_tools
   qemu_keymap = executable('qemu-keymap', files('qemu-keymap.c', 'ui/input-keymap.c') + genh,
-                           dependencies: [qemuutil, xkbcommon], install: have_tools)
+                           dependencies: [qemuutil, xkbcommon, xkeyboard_config], install: have_tools)
 endif
 
 if have_tools
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-01-31  8:13 building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump Zhang Wen
@ 2024-02-01 12:11 ` Michael Tokarev
  2024-02-01 12:49   ` Michael Tokarev
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Tokarev @ 2024-02-01 12:11 UTC (permalink / raw)
  To: Zhang Wen, qemu-trivial
  Cc: pbonzini, marcandre.lureau, berrange, thuth, philmd, qemu-devel

31.01.2024 11:13, Zhang Wen:
> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed 
> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.

I'm not sure what you're talking about.  What *is* keyboard-config anyway?

On a debian system there's no such thing.  There's keyboard-configuration
package but it has nothing to do with that.  It looks like if we apply
such patch, it will be impossible to build qemu on debian.

/mjt


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-01 12:11 ` Michael Tokarev
@ 2024-02-01 12:49   ` Michael Tokarev
  2024-02-01 12:57     ` Peter Maydell
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Tokarev @ 2024-02-01 12:49 UTC (permalink / raw)
  To: Zhang Wen, qemu-trivial
  Cc: pbonzini, marcandre.lureau, berrange, thuth, philmd, qemu-devel

01.02.2024 15:11, Michael Tokarev wrote:
> 31.01.2024 11:13, Zhang Wen:
>> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed 
>> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.
> 
> I'm not sure what you're talking about.  What *is* keyboard-config anyway?
> 
> On a debian system there's no such thing.  There's keyboard-configuration
> package but it has nothing to do with that.  It looks like if we apply
> such patch, it will be impossible to build qemu on debian.

Aha, I found it.  On debian it is /usr/share/pkgconfig/keyboard-config.pc,
which is a part of xkb-data package.  And libxkbcommon Depends on xkb-data.
It looks like the distribution here is wrong, there should be no libxkbcommon
without xkb-data which includes keyboard-config.

/mjt


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-01 12:49   ` Michael Tokarev
@ 2024-02-01 12:57     ` Peter Maydell
  2024-02-01 12:59       ` Michael Tokarev
  2024-02-06  6:35       ` Zhang Wen
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Maydell @ 2024-02-01 12:57 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Zhang Wen, qemu-trivial, pbonzini, marcandre.lureau, berrange,
	thuth, philmd, qemu-devel

On Thu, 1 Feb 2024 at 12:50, Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 01.02.2024 15:11, Michael Tokarev wrote:
> > 31.01.2024 11:13, Zhang Wen:
> >> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed
> >> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.
> >
> > I'm not sure what you're talking about.  What *is* keyboard-config anyway?
> >
> > On a debian system there's no such thing.  There's keyboard-configuration
> > package but it has nothing to do with that.  It looks like if we apply
> > such patch, it will be impossible to build qemu on debian.
>
> Aha, I found it.  On debian it is /usr/share/pkgconfig/keyboard-config.pc,
> which is a part of xkb-data package.  And libxkbcommon Depends on xkb-data.
> It looks like the distribution here is wrong, there should be no libxkbcommon
> without xkb-data which includes keyboard-config.

Are we talking about "keyboard-config" or "xkeyboard-config" here?
The commit message says "keyboard-config" but the patch itself
says "xkeyboard-config".

Zhang: it would be helpful if you could tell us which distro
you are building on where you see this problem.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-01 12:57     ` Peter Maydell
@ 2024-02-01 12:59       ` Michael Tokarev
  2024-02-06  6:35       ` Zhang Wen
  1 sibling, 0 replies; 10+ messages in thread
From: Michael Tokarev @ 2024-02-01 12:59 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Zhang Wen, qemu-trivial, pbonzini, marcandre.lureau, berrange,
	thuth, philmd, qemu-devel

01.02.2024 15:57, Peter Maydell пишет:
> On Thu, 1 Feb 2024 at 12:50, Michael Tokarev <mjt@tls.msk.ru> wrote:
>>
>> 01.02.2024 15:11, Michael Tokarev wrote:
>>> 31.01.2024 11:13, Zhang Wen:
>>>> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed
>>>> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.
>>>
>>> I'm not sure what you're talking about.  What *is* keyboard-config anyway?
>>>
>>> On a debian system there's no such thing.  There's keyboard-configuration
>>> package but it has nothing to do with that.  It looks like if we apply
>>> such patch, it will be impossible to build qemu on debian.
>>
>> Aha, I found it.  On debian it is /usr/share/pkgconfig/keyboard-config.pc,
>> which is a part of xkb-data package.  And libxkbcommon Depends on xkb-data.
>> It looks like the distribution here is wrong, there should be no libxkbcommon
>> without xkb-data which includes keyboard-config.
> 
> Are we talking about "keyboard-config" or "xkeyboard-config" here?
> The commit message says "keyboard-config" but the patch itself
> says "xkeyboard-config".

It is xkeyboard-config.pc, - I hit the same trap with the wrong commit
message.

$ dpkg -L xkb-data | fgrep .pc
/usr/share/pkgconfig/xkeyboard-config.pc
$ dpkg -s libxkbcommon0 | grep Depends
Depends: xkb-data, libc6 (>= 2.33)

/mjt


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-01 12:57     ` Peter Maydell
  2024-02-01 12:59       ` Michael Tokarev
@ 2024-02-06  6:35       ` Zhang Wen
  2024-02-06  7:08         ` Michael Tokarev
  2024-02-08 11:52         ` Peter Maydell
  1 sibling, 2 replies; 10+ messages in thread
From: Zhang Wen @ 2024-02-06  6:35 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Michael Tokarev, qemu-trivial, pbonzini, marcandre.lureau,
	berrange, thuth, philmd, qemu-devel

Peter Maydell <peter.maydell@linaro.org> 于2024年2月1日周四 20:57写道:
>
> On Thu, 1 Feb 2024 at 12:50, Michael Tokarev <mjt@tls.msk.ru> wrote:
> >
> > 01.02.2024 15:11, Michael Tokarev wrote:
> > > 31.01.2024 11:13, Zhang Wen:
> > >> With this patch, qemu requires keyboard-config when libxkbcommon is found on the system. So if the qemu is configured when libxkbcommon is installed
> > >> but not keyboard-config, the configure stage will produce an error message, thus avoid coredump in the build stage.
> > >
> > > I'm not sure what you're talking about.  What *is* keyboard-config anyway?
> > >
> > > On a debian system there's no such thing.  There's keyboard-configuration
> > > package but it has nothing to do with that.  It looks like if we apply
> > > such patch, it will be impossible to build qemu on debian.
> >
> > Aha, I found it.  On debian it is /usr/share/pkgconfig/keyboard-config.pc,
> > which is a part of xkb-data package.  And libxkbcommon Depends on xkb-data.
> > It looks like the distribution here is wrong, there should be no libxkbcommon
> > without xkb-data which includes keyboard-config.
>
> Are we talking about "keyboard-config" or "xkeyboard-config" here?
> The commit message says "keyboard-config" but the patch itself
> says "xkeyboard-config".
>
> Zhang: it would be helpful if you could tell us which distro
> you are building on where you see this problem.
>
> thanks
> -- PMM

I'm so sorry for the misspelling in my initial post and the confusion
caused by that.
I'm building my own system following the Linux From Scratch package, which is at
https://www.linuxfromscratch.org.
I accidently built libxkbcommon package but not xkeyboard-config
package, and then
while building qemu I saw this problem. it's a little difficult to
find the root cause from
this error message, so I sent this patch to seek for help from upstream.

-- 
Key fingerprint:
419F 72F3 F3A9 36EE 1B72  B00B C1C3 4BD4 FDA3 362F


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-06  6:35       ` Zhang Wen
@ 2024-02-06  7:08         ` Michael Tokarev
  2024-02-06  7:50           ` Zhang Wen
  2024-02-08 11:52         ` Peter Maydell
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Tokarev @ 2024-02-06  7:08 UTC (permalink / raw)
  To: Zhang Wen, Peter Maydell
  Cc: qemu-trivial, pbonzini, marcandre.lureau, berrange, thuth, philmd,
	qemu-devel

06.02.2024 09:35, Zhang Wen:
...
> I'm so sorry for the misspelling in my initial post and the confusion
> caused by that.

That's no problem, things happen.

> I'm building my own system following the Linux From Scratch package, which is at
> https://www.linuxfromscratch.org.
> I accidently built libxkbcommon package but not xkeyboard-config
> package, and then
> while building qemu I saw this problem. it's a little difficult to
> find the root cause from
> this error message, so I sent this patch to seek for help from upstream.

Okay, so it is mostly a self-built/self-installed linux.  That works too.

So how the problem manifests itself?  What the actual error message is?
You mentioned some segfault iirc, care to share some details?

It's not a problem at all to pick this change up, but I'd love to know
more details about this first :)

Thanks,

/mjt


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-06  7:08         ` Michael Tokarev
@ 2024-02-06  7:50           ` Zhang Wen
  2024-02-08  2:00             ` Zhang Wen
  0 siblings, 1 reply; 10+ messages in thread
From: Zhang Wen @ 2024-02-06  7:50 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Peter Maydell, qemu-trivial, pbonzini, marcandre.lureau, berrange,
	thuth, philmd, qemu-devel

> So how the problem manifests itself?  What the actual error message is?
> You mentioned some segfault iirc, care to share some details?
I'm doing a rebuild, and will attach the error message and coredump
file here in one or two days.

-- 
Key fingerprint:
419F 72F3 F3A9 36EE 1B72  B00B C1C3 4BD4 FDA3 362F


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-06  7:50           ` Zhang Wen
@ 2024-02-08  2:00             ` Zhang Wen
  0 siblings, 0 replies; 10+ messages in thread
From: Zhang Wen @ 2024-02-08  2:00 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Peter Maydell, qemu-trivial, pbonzini, marcandre.lureau, berrange,
	thuth, philmd, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 121 bytes --]

Here's my error message and core file attached.

-- 
Key fingerprint:
419F 72F3 F3A9 36EE 1B72  B00B C1C3 4BD4 FDA3 362F

[-- Attachment #2: err.log --]
[-- Type: application/octet-stream, Size: 264 bytes --]

Generating pc-bios/keymaps/ar with a custom command
FAILED: pc-bios/keymaps/ar
/sources/qemu/qemu-8.2.0/build/qemu-keymap -f pc-bios/keymaps/ar -l ara
xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb
ninja: build stopped: subcommand failed.

[-- Attachment #3: core.qemu-keymap --]
[-- Type: application/octet-stream, Size: 9048064 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump
  2024-02-06  6:35       ` Zhang Wen
  2024-02-06  7:08         ` Michael Tokarev
@ 2024-02-08 11:52         ` Peter Maydell
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2024-02-08 11:52 UTC (permalink / raw)
  To: Zhang Wen
  Cc: Michael Tokarev, qemu-trivial, pbonzini, marcandre.lureau,
	berrange, thuth, philmd, qemu-devel

On Tue, 6 Feb 2024 at 06:35, Zhang Wen <zhw2101024@gmail.com> wrote:
> I'm building my own system following the Linux From Scratch package, which is at
> https://www.linuxfromscratch.org.
> I accidently built libxkbcommon package but not xkeyboard-config
> package, and then
> while building qemu I saw this problem.

I found this interesting commit in FreeBSD:
https://svnweb.freebsd.org/ports?view=revision&revision=490981
"Add a run time dependency on x11/xkeyboard-config in x11/libxkbcommon.

 While not strictly necessary, this is recommended upstream, since almost all
 uses of libxkbcommon also needs xkeyboard-config.  This is similar to how it
 is done in other distributions.

 This solves issues when graphics/xpdf4 is installed without a desktop or
 graphical environment, as well as other places."

That suggests that the intention of X11 upstream is that if
a distro provides libxkbcommon then it should also provide
xkeyboard-config, and if the distro doesn't do that then various
things will not work correctly, not just QEMU.

Looking at the Linux From Scratch website I see that their
libxkbcommon page
https://www.linuxfromscratch.org/blfs/view/svn/general/libxkbcommon.html
says:

# Required
# xkeyboard-config-2.41 (runtime)

So LFS agrees that xkeyboard-config is a required dependency.

My inclination is therefore to say that "libxkbcommon is present
but one of its required dependencies is missing" is not really
a situation we need to change QEMU to handle.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-08 11:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31  8:13 building qemu on a system with libxkbcommon installed but not xkeyboard-config produces an core dump Zhang Wen
2024-02-01 12:11 ` Michael Tokarev
2024-02-01 12:49   ` Michael Tokarev
2024-02-01 12:57     ` Peter Maydell
2024-02-01 12:59       ` Michael Tokarev
2024-02-06  6:35       ` Zhang Wen
2024-02-06  7:08         ` Michael Tokarev
2024-02-06  7:50           ` Zhang Wen
2024-02-08  2:00             ` Zhang Wen
2024-02-08 11:52         ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).