gdb_monitor for NOVA hit Error: __cxa_pure_virtual called

Alexander Tormasov a.tormasov at innopolis.ru
Tue Oct 12 15:57:33 CEST 2021


I am trying gdb debugging for 21.08 (gcc 10.3) for nova x86_64
I compile everything from the scratch using
make -C build/x86_64/ KERNEL=nova BOARD=pc CFLAGS="-g -O0" VERBOSE= run/go_app_dbg
while attempt to run it inside qemu with 2 GB I see a problem in dbg_monitor itself, see below

SeaBIOS (version rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org)


iPXE (http://ipxe.org) 00:02.0 CA00 PCI2.10 PnP PMM+7FF90660+7FEF0660 CA00



Booting from Hard Disk...
Boot failed: could not read the boot disk

Booting from DVD/CD...
Bender: Hello World. NOVA'
hwp config: eeo=na irq=na hwp=na epp=na epb=na

NOVA Microhypervisor v8-5c64bba (x86_64): Oct 12 2021 01:47:36 [gcc 10.3.0] [MBI2]

[ 0] TSC:2014786 kHz BUS:1009035 kHz (measured)
[ 0] CORE:0:0:0 6:f:b:0 [0] Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz

Hypervisor NOVA (API v8)
core     image  [0000000000100000,00000000011bd000)
binaries region [0000000000351000,00000000011bd000) free for reuse
detected physical memory: 0x0000000000000000 - size: 0x000000000009fc00
use      physical memory: 0x0000000000000000 - size: 0x000000000009f000
detected physical memory: 0x0000000000100000 - size: 0x000000007fedf000
use      physical memory: 0x0000000000100000 - size: 0x000000007fedf000
reserved memory: 0x7ef20000 - size: 0x10be2f0 type=-2
reserved memory: 0x9fc00 - size: 0x400 type=2
reserved memory: 0xf0000 - size: 0x10000 type=2
reserved memory: 0x7ffdf000 - size: 0x21000 type=2
reserved memory: 0xb0000000 - size: 0x10000000 type=2
reserved memory: 0xfed1c000 - size: 0x4000 type=2
reserved memory: 0xfffc0000 - size: 0x40000 type=2
reserved memory: 0xfd000000 - size: 0x300000 type=-5
reserved memory: 0x1000000 - size: 0x800000 type=-1
reserved memory: 0x1800000 - size: 0x1c00000 type=-1
reserved memory: 0x7ffe20f8 - size: 0x0 type=-3
Hypervisor reports 1x1 CPU
Warning: CPU has no invariant TSC.
mapping: affinity space -> kernel cpu id - package:core:thread
 remap (0x0) -> 0 - 0:0:0) boot cpu
ROM modules:
 ROM: [000000007f172000,000000007f172701) config
 ROM: [000000000000e000,0000000000012000) core_log
 ROM: [000000007fe32000,000000007ff968e8) gdb_monitor
 ROM: [000000007ff97000,000000007ffdd870) gdbserver_platform.lib.so
 ROM: [000000007f173000,000000007f2084a8) init
 ROM: [000000007f235000,000000007f398c78) ld.lib.so
 ROM: [000000007f399000,000000007f631cb0) libc.lib.so
 ROM: [000000007f632000,000000007f68fb20) libm.lib.so
 ROM: [000000007fdf9000,000000007fe31d58) pc_uart_drv
 ROM: [000000000000c000,000000000000d000) platform_info
 ROM: [000000007f690000,000000007f69ca70) posix.lib.so
 ROM: [000000007f69d000,000000007f8bce58) stdcxx.lib.so
 ROM: [000000007f9f5000,000000007fdf8418) test-go
 ROM: [000000007f209000,000000007f2342d0) timer
 ROM: [000000007f8bd000,000000007f9f4938) vfs.lib.so

36M kernel memory

Genode 21.05-180-geb2f7074f <local changes>
1994 MiB RAM and 63254 caps assigned to init
[init -> gdb_monitor]   0x1000000 .. 0x10ffffff: linker area
[init -> pc_uart_drv] --- UART driver started —
[init -> gdb_monitor] Error: __cxa_pure_virtual called, return addr is 0x12c849

I printed stack trace here:
0x000000000012c849: Linker::Root_object::~Root_object()::{lambda(Linker::Dependency&)#1}::operator()(Linker::Dependency&) const at linker.h:361
0x0000000000136eb9: void Genode::Fifo<Linker::Dependency>::dequeue<Linker::Root_object::~Root_object()::{lambda(Linker::Dependency&)#1}>(Linker::Root_object::~Root_object()::{lambda(Linker::Dependency&)#1} const&) at fifo.h:170
0x0000000000134261: void Genode::Fifo<Linker::Dependency>::dequeue_all<Linker::Root_object::~Root_object()::{lambda(Linker::Dependency&)#1}>(Linker::Root_object::~Root_object()::{lambda(Linker::Dependency&)#1} const&) at fifo.h:182 (discriminator 1)
0x000000000012c8cc: Linker::Root_object::~Root_object() at linker.h:363
0x00000000001305ea: Linker::Binary::Binary(Genode::Env&, Genode::Allocator&, Linker::Config const&, char const*) at main.cc:368 (discriminator 1)
0x0000000000137e5e: void Unmanaged_singleton_constructor::call<Linker::Binary, Genode::Env&, Genode::Heap&, Linker::Config const&, char const*&>(char*, Genode::Env&, Genode::Heap&, Linker::Config const&, char const*&) at unmanaged_singleton.h:58
0x00000000001362d0: Linker::Binary* unmanaged_singleton<Linker::Binary, 8, Genode::Env&, Genode::Heap&, Linker::Config const&, char const*>(Genode::Env&, Genode::Heap&, Linker::Config const&, char const*&&) at unmanaged_singleton.h:87
0x0000000000133245: Component::construct(Genode::Env&) at main.cc:812 (discriminator 4)
0x00000000000a61e6: (anonymous namespace)::Constructor_component::construct() at entrypoint.cc:320
0x00000000000ab265: Genode::Meta::Empty Genode::Meta::call_member<Genode::Meta::Empty, (anonymous namespace)::Constructor_component, Genode::Meta::Empty>((anonymous namespace)::Constructor_component&, Genode::Meta::Empty&, void ((anonymous namespace)::Constructor_component::*)()) at meta.h:464 (discriminator 4)
0x00000000000ab180: Genode::Meta::Empty (anonymous namespace)::Constructor::Rpc_construct::serve<(anonymous namespace)::Constructor_component, Genode::Meta::Empty>((anonymous namespace)::Constructor_component&, Genode::Meta::Empty&) at entrypoint.cc:293
0x00000000000aaf2d: (anonymous namespace)::Constructor::Rpc_construct::Ret_type Genode::Rpc_dispatcher<(anonymous namespace)::Constructor, (anonymous namespace)::Constructor_component>::_do_serve<(anonymous namespace)::Constructor::Rpc_construct>((anonymous namespace)::Constructor::Rpc_construct::Server_args&, Genode::Meta::Overload_selector<(anonymous namespace)::Constructor::Rpc_construct, Genode::Meta::Empty>) at rpc_server.h:146
0x00000000000aaabd: Genode::Rpc_exception_code Genode::Rpc_dispatcher<(anonymous namespace)::Constructor, (anonymous namespace)::Constructor_component>::_do_dispatch<Genode::Meta::Type_list<(anonymous namespace)::Constructor::Rpc_construct> >(Genode::Rpc_opcode, Genode::Ipc_unmarshaller&, Genode::Msgbuf_base&, Genode::Meta::Overload_selector<Genode::Meta::Type_list<(anonymous namespace)::Constructor::Rpc_construct>, Genode::Meta::Type_list<(anonymous namespace)::Constructor::Rpc_construct> >) at rpc_server.h:182
0x00000000000aa92d: Genode::Rpc_dispatcher<(anonymous namespace)::Constructor, (anonymous namespace)::Constructor_component>::dispatch(Genode::Rpc_opcode, Genode::Ipc_unmarshaller&, Genode::Msgbuf_base&) at rpc_server.h:236
0x00000000000aa868: Genode::Rpc_object<(anonymous namespace)::Constructor, (anonymous namespace)::Constructor_component>::dispatch(Genode::Rpc_opcode, Genode::Ipc_unmarshaller&, Genode::Msgbuf_base&) at rpc_server.h:273
0x00000000000c9d4e: Genode::Rpc_entrypoint::_activation_entry()::{lambda(Genode::Rpc_object_base*)#1}::operator()(Genode::Rpc_object_base*) const at rpc_entrypoint.cc:168
0x00000000000cbda4: Genode::Trait::Functor<decltype (&Genode::Rpc_entrypoint::_activation_entry()::{lambda(Genode::Rpc_object_base*)#1}::operator())>::Return_type Genode::Object_pool<Genode::Rpc_object_base>::apply<Genode::Rpc_entrypoint::_activation_entry()::{lambda(Genode::Rpc_object_base*)#1}>(unsigned long, Genode::Trait::Functor) at object_pool.h:147
0x00000000000ca08e: Genode::Rpc_entrypoint::_activation_entry() at rpc_entrypoint.cc:171

run file

#debug go application via gdb
#

set build_components {
core init timer lib/ld
drivers/uart app/gdb_monitor
test/go_app
}

lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"

build $build_components

create_boot_directory

install_config {
<config>
    <parent-provides>
        <service name="ROM" />
        <service name="LOG" />
        <service name="RM" />
        <service name="CPU" />
        <service name="PD" />
        <service name="IRQ" />
        <service name="IO_MEM" />
        <service name="IO_PORT" />
    </parent-provides>
    <default-route>
        <any-service> <parent/> <any-child/> </any-service>
    </default-route>
    <default caps="250" />
    <start name="timer" caps="200">
        <resource name="RAM" quantum="2M"/>
        <provides> <service name="Timer"/> </provides>
    </start>
    <start name="pc_uart_drv" caps="200">
        <resource name="RAM" quantum="2M" />
        <provides>
            <service name="Uart"/>
            <service name="Terminal"/>
        </provides>
        <config>
            <policy label_prefix="gdb_monitor" uart="1" />
        </config>
    </start>
    <start name="gdb_monitor" caps="3500">
        <resource name="RAM" quantum="550M" />
        <provides> <service name="test-go" /> </provides>
        <config  verbose="yes" ld_verbose="yes">
            <target name="test-go" >
                <config verbose="yes" ld_verbose="yes">
                <vfs>
                    <dir name="dev"> <log/> </dir>
                    <rom name="ld.lib.so" label="ld.lib.so"/>
                    <rom name="libc.lib.so" label="libc.lib.so"/>
                    <rom name="vfs.lib.so" label="vfs.lib.so"/>
                    <rom name="libm.lib.so" label="libm.lib.so"/>
                    <rom name="stdcxx.lib.so" label="stdcxx.lib.so"/>
                    <rom name="binary" label="test-go"/>
                    <dir name="proc">
                        <dir name="self">
                            <rom name="exe" label="test-go"/>
                        </dir>
                    </dir>
                </vfs>
                <libc stdout="/dev/log" stderr="/dev/log" />
                </config>
            </target>
            <preserve name="RAM" quantum="180M" />
            <vfs>
                <dir name="dev"> <log/> <terminal/> </dir>
            </vfs>
                <libc stdout="/dev/log" stderr="/dev/log">
                    <mmap local_area_default_size="1610612736" />
                </libc>
        </config>
    </start>
</config>
}

# evaluated by the run tool
proc binary_name_gdbserver_platform_lib_so { } {
return "gdbserver_platform-$::env(KERNEL).lib.so"
}


build_boot_image {
    core init timer ld.lib.so libc.lib.so libm.lib.so posix.lib.so stdcxx.lib.so
    vfs.lib.so test-go
    pc_uart_drv gdb_monitor gdbserver_platform.lib.so
}



any ideas how to fix?



More information about the users mailing list