All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* QEMU v5.2.0: object_new_with_type: assertion failed: (type != NULL)
@ 2021-02-05 11:48 Bharat Bhushan
  2021-02-05 13:03 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Bharat Bhushan @ 2021-02-05 11:48 UTC (permalink / raw
  To: qemu-devel@nongnu.org, qemu-arm@nongnu.org


Hi All,

I am using QEMU version "v5.2.0" and getting below error when running on arm64

$ qemu-system-aarch64 --version

ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)

Running GDB give below information.
Is this something known.

(gdb) run
Starting program: /root/qemu-system-aarch64 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0xfffff703ed90 (LWP 5212)]
**
ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)

Thread 1 "qemu-system-aar" received signal SIGABRT, Aborted.
0x0000fffff73e380c in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x0000fffff73e380c in raise () from /lib64/libc.so.6
#1  0x0000fffff73d0bcc in abort () from /lib64/libc.so.6
#2  0x0000fffff7b7c058 in g_assertion_message () from /lib64/libglib-2.0.so.0
#3  0x0000fffff7b7c0b8 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
#4  0x0000aaaaab2b880c in object_new_with_type (type=<optimized out>) at ../qom/object.c:711
#5  0x0000aaaaab2b8870 in object_new (typename=typename@entry=0xaaaaab50a668 "container") at ../qom/object.c:744
#6  0x0000aaaaab2b9ec4 in object_get_root () at ../qom/object.c:1674
#7  0x0000aaaaab2a4c0c in get_chardevs_root () at ../chardev/char.c:50
#8  0x0000aaaaaaf9f2b4 in chardev_machine_done_hook (notifier=<optimized out>, unused=<optimized out>)
    at ../chardev/chardev-sysemu.c:45
#9  0x0000aaaaab3d4ae8 in module_call_init (type=type@entry=MODULE_INIT_QOM) at ../util/module.c:106
#10 0x0000aaaaab235000 in qemu_init (argc=1, argv=0xfffffffffcb8, envp=<optimized out>) at ../softmmu/vl.c:2916
#11 0x0000aaaaaad9e084 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../softmmu/main.c:49
(gdb)

Thanks
-Bharat


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

* Re: QEMU v5.2.0: object_new_with_type: assertion failed: (type != NULL)
  2021-02-05 11:48 QEMU v5.2.0: object_new_with_type: assertion failed: (type != NULL) Bharat Bhushan
@ 2021-02-05 13:03 ` Philippe Mathieu-Daudé
  2021-02-05 15:55   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-05 13:03 UTC (permalink / raw
  To: Bharat Bhushan, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Paolo Bonzini, Gerd Hoffmann

On 2/5/21 12:48 PM, Bharat Bhushan wrote:
> 
> Hi All,
> 
> I am using QEMU version "v5.2.0" and getting below error when running on arm64
> 
> $ qemu-system-aarch64 --version
> 
> ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
> Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
> 
> Running GDB give below information.
> Is this something known.
> 
> (gdb) run
> Starting program: /root/qemu-system-aarch64 
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> [New Thread 0xfffff703ed90 (LWP 5212)]
> **
> ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
> Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
> 
> Thread 1 "qemu-system-aar" received signal SIGABRT, Aborted.
> 0x0000fffff73e380c in raise () from /lib64/libc.so.6
> (gdb) bt
> #0  0x0000fffff73e380c in raise () from /lib64/libc.so.6
> #1  0x0000fffff73d0bcc in abort () from /lib64/libc.so.6
> #2  0x0000fffff7b7c058 in g_assertion_message () from /lib64/libglib-2.0.so.0
> #3  0x0000fffff7b7c0b8 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
> #4  0x0000aaaaab2b880c in object_new_with_type (type=<optimized out>) at ../qom/object.c:711
> #5  0x0000aaaaab2b8870 in object_new (typename=typename@entry=0xaaaaab50a668 "container") at ../qom/object.c:744

How can you not have "container" registered? libqom is a core part
of QEMU... Cc'ing Gerd for the module initialization.

> #6  0x0000aaaaab2b9ec4 in object_get_root () at ../qom/object.c:1674
> #7  0x0000aaaaab2a4c0c in get_chardevs_root () at ../chardev/char.c:50
> #8  0x0000aaaaaaf9f2b4 in chardev_machine_done_hook (notifier=<optimized out>, unused=<optimized out>)
>     at ../chardev/chardev-sysemu.c:45
> #9  0x0000aaaaab3d4ae8 in module_call_init (type=type@entry=MODULE_INIT_QOM) at ../util/module.c:106
> #10 0x0000aaaaab235000 in qemu_init (argc=1, argv=0xfffffffffcb8, envp=<optimized out>) at ../softmmu/vl.c:2916
> #11 0x0000aaaaaad9e084 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../softmmu/main.c:49
> (gdb)
> 
> Thanks
> -Bharat
> 



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

* Re: QEMU v5.2.0: object_new_with_type: assertion failed: (type != NULL)
  2021-02-05 13:03 ` Philippe Mathieu-Daudé
@ 2021-02-05 15:55   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-02-05 15:55 UTC (permalink / raw
  To: Philippe Mathieu-Daudé, Bharat Bhushan,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Gerd Hoffmann

On 05/02/21 14:03, Philippe Mathieu-Daudé wrote:
> On 2/5/21 12:48 PM, Bharat Bhushan wrote:
>>
>> Hi All,
>>
>> I am using QEMU version "v5.2.0" and getting below error when running on arm64
>>
>> $ qemu-system-aarch64 --version
>>
>> ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
>> Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
>>
>> Running GDB give below information.
>> Is this something known.
>>
>> (gdb) run
>> Starting program: /root/qemu-system-aarch64
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib64/libthread_db.so.1".
>> [New Thread 0xfffff703ed90 (LWP 5212)]
>> **
>> ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
>> Bail out! ERROR:../qom/object.c:711:object_new_with_type: assertion failed: (type != NULL)
>>
>> Thread 1 "qemu-system-aar" received signal SIGABRT, Aborted.
>> 0x0000fffff73e380c in raise () from /lib64/libc.so.6
>> (gdb) bt
>> #0  0x0000fffff73e380c in raise () from /lib64/libc.so.6
>> #1  0x0000fffff73d0bcc in abort () from /lib64/libc.so.6
>> #2  0x0000fffff7b7c058 in g_assertion_message () from /lib64/libglib-2.0.so.0
>> #3  0x0000fffff7b7c0b8 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
>> #4  0x0000aaaaab2b880c in object_new_with_type (type=<optimized out>) at ../qom/object.c:711
>> #5  0x0000aaaaab2b8870 in object_new (typename=typename@entry=0xaaaaab50a668 "container") at ../qom/object.c:744
> 
> How can you not have "container" registered? libqom is a core part
> of QEMU... Cc'ing Gerd for the module initialization.

The problem seems to be that chardev/chardev-sysemu.c's register_types 
is not exactly a QOM hook, it calls qemu_add_machine_init_done_notifier. 
  And for some weird reason machine_init_done is already true when it is 
called.

Bharat, you could try to set a watchpoint on machine_init_done and see 
who sets it to true.  Alternatively you can try to backport 
5a1ee6077b89ee9a803aaf8d1c98004701f63684, which gets rid of the code 
that is involved here.

Paolo

>> #6  0x0000aaaaab2b9ec4 in object_get_root () at ../qom/object.c:1674
>> #7  0x0000aaaaab2a4c0c in get_chardevs_root () at ../chardev/char.c:50
>> #8  0x0000aaaaaaf9f2b4 in chardev_machine_done_hook (notifier=<optimized out>, unused=<optimized out>)
>>      at ../chardev/chardev-sysemu.c:45
>> #9  0x0000aaaaab3d4ae8 in module_call_init (type=type@entry=MODULE_INIT_QOM) at ../util/module.c:106
>> #10 0x0000aaaaab235000 in qemu_init (argc=1, argv=0xfffffffffcb8, envp=<optimized out>) at ../softmmu/vl.c:2916
>> #11 0x0000aaaaaad9e084 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at ../softmmu/main.c:49
>> (gdb)
>>
>> Thanks
>> -Bharat
>>
> 



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

end of thread, other threads:[~2021-02-05 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-05 11:48 QEMU v5.2.0: object_new_with_type: assertion failed: (type != NULL) Bharat Bhushan
2021-02-05 13:03 ` Philippe Mathieu-Daudé
2021-02-05 15:55   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.