qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug 1895080] [NEW] pgb_reserved_va: Assertion `addr == test' failed


From: Hansni Bu
Subject: Re: [Bug 1895080] [NEW] pgb_reserved_va: Assertion `addr == test' failed
Date: Fri, 11 Sep 2020 05:57:55 -0000

> This problem occurs on CentOS-7.5 (64-bit) with qemu-5.1.0, qemu head
> > (commit 9435a8b3dd35f1f926f1b9127e8a906217a5518a) for riscv32-linux-
> > user.
>
> I tried to build qemu-5.1 on CentOS-7.5.1 but as python 3.5 is not
> available, I gave up.
>

Thank you for your effort. I installed python3 with yum:
python3.x86_64                           3.6.8-10.el7              @centos
Then maybe you can specify python3 in configure with
"--python=/bin/python3" in case configure cannot find it.


>
> > Firstly, compile fails:
> > Compiling C object libqemu-riscv32-linux-user.fa.p/linux-user_strace.c.o
> > ../qemu.git/linux-user/strace.c:1210:18: error: ‘FALLOC_FL_KEEP_SIZE’
> undeclared here (not in a function)
> >      FLAG_GENERIC(FALLOC_FL_KEEP_SIZE),
> >
> > I have to add below include to linux-user/strace.c
> > diff --git a/linux-user/strace.c b/linux-user/strace.c
> > index 11fea14fba..22e51d4a8a 100644
> > --- a/linux-user/strace.c
> > +++ b/linux-user/strace.c
> > @@ -7,6 +7,7 @@
> >  #include <sys/mount.h>
> >  #include <arpa/inet.h>
> >  #include <netinet/tcp.h>
> > +#include <linux/falloc.h>
> >  #include <linux/if_packet.h>
> >  #include <linux/netlink.h>
> >  #include <sched.h>
>
> In fact, fallocate(2) says fcntl.h must be included.
> And qemu/osdep.h includes it.
> So you should not have this problem.
>

I tried to save the file after pre-processing, namely strace.i. Though
_GNU_SOURCE is defined and fcntl.h is included, falloc.h is not included,
in which FALLOC_FL_KEEP_SIZE is defined. I'm not sure if it's some
environmental problem.

Thanks.

>
> > Then trying qemu-riscv32 with a simple ELF, I get:
> > linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr == test'
> failed.
> >
> > strace shows that:
> > mmap(0x1000, 4294963200, PROT_NONE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x10000
> > write(2, "qemu-riscv32: ../qemu.git/linux-"..., 103qemu-riscv32:
> ../qemu.git/linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr ==
> test' failed.
> > ) = 103
> >
> > The source code is in the function pgb_reserved_va (linux-
> > user/elfload.c). I think mmap cannot guarantee that the returned pointer
> > (test) equals to the parameter of addr. So is this a bug to assert (addr
> > == test)?
>
> I think Alex Bennée knows better this code than I do, so cc'ing him.
>
> Thnaks
> Laurent
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1895080
>
> Title:
>   pgb_reserved_va: Assertion `addr == test' failed
>
> Status in QEMU:
>   New
>
> Bug description:
>   This problem occurs on CentOS-7.5 (64-bit) with qemu-5.1.0, qemu head
>   (commit 9435a8b3dd35f1f926f1b9127e8a906217a5518a) for riscv32-linux-
>   user.
>
>   Firstly, compile fails:
>   Compiling C object libqemu-riscv32-linux-user.fa.p/linux-user_strace.c.o
>   ../qemu.git/linux-user/strace.c:1210:18: error: ‘FALLOC_FL_KEEP_SIZE’
> undeclared here (not in a function)
>        FLAG_GENERIC(FALLOC_FL_KEEP_SIZE),
>
>   I have to add below include to linux-user/strace.c
>   diff --git a/linux-user/strace.c b/linux-user/strace.c
>   index 11fea14fba..22e51d4a8a 100644
>   --- a/linux-user/strace.c
>   +++ b/linux-user/strace.c
>   @@ -7,6 +7,7 @@
>    #include <sys/mount.h>
>    #include <arpa/inet.h>
>    #include <netinet/tcp.h>
>   +#include <linux/falloc.h>
>    #include <linux/if_packet.h>
>    #include <linux/netlink.h>
>    #include <sched.h>
>
>   Then trying qemu-riscv32 with a simple ELF, I get:
>   linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr == test'
> failed.
>
>   strace shows that:
>   mmap(0x1000, 4294963200, PROT_NONE,
> MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x10000
>   write(2, "qemu-riscv32: ../qemu.git/linux-"..., 103qemu-riscv32:
> ../qemu.git/linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr ==
> test' failed.
>   ) = 103
>
>   The source code is in the function pgb_reserved_va (linux-
>   user/elfload.c). I think mmap cannot guarantee that the returned
>   pointer (test) equals to the parameter of addr. So is this a bug to
>   assert (addr == test)?
>
>   Attached configure script and test ELF file.
>
>   Thanks.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/1895080/+subscriptions
>

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

Title:
  pgb_reserved_va: Assertion `addr == test' failed

Status in QEMU:
  New

Bug description:
  This problem occurs on CentOS-7.5 (64-bit) with qemu-5.1.0, qemu head
  (commit 9435a8b3dd35f1f926f1b9127e8a906217a5518a) for riscv32-linux-
  user.

  Firstly, compile fails:
  Compiling C object libqemu-riscv32-linux-user.fa.p/linux-user_strace.c.o
  ../qemu.git/linux-user/strace.c:1210:18: error: ‘FALLOC_FL_KEEP_SIZE’ 
undeclared here (not in a function)
       FLAG_GENERIC(FALLOC_FL_KEEP_SIZE),

  I have to add below include to linux-user/strace.c
  diff --git a/linux-user/strace.c b/linux-user/strace.c
  index 11fea14fba..22e51d4a8a 100644
  --- a/linux-user/strace.c
  +++ b/linux-user/strace.c
  @@ -7,6 +7,7 @@
   #include <sys/mount.h>
   #include <arpa/inet.h>
   #include <netinet/tcp.h>
  +#include <linux/falloc.h>
   #include <linux/if_packet.h>
   #include <linux/netlink.h>
   #include <sched.h>

  Then trying qemu-riscv32 with a simple ELF, I get:
  linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr == test' failed.

  strace shows that:
  mmap(0x1000, 4294963200, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, 
-1, 0) = 0x10000
  write(2, "qemu-riscv32: ../qemu.git/linux-"..., 103qemu-riscv32: 
../qemu.git/linux-user/elfload.c:2341: pgb_reserved_va: Assertion `addr == 
test' failed.
  ) = 103

  The source code is in the function pgb_reserved_va (linux-
  user/elfload.c). I think mmap cannot guarantee that the returned
  pointer (test) equals to the parameter of addr. So is this a bug to
  assert (addr == test)?

  Attached configure script and test ELF file.

  Thanks.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]