Page 1 of 1

Bochs 2.6.9 hangs for huge guest memory

Posted: Fri Apr 14, 2017 4:21 pm
by xenos
As some of you may have noticed, Bochs 2.6.9 was recently released, and so I decided to give it a try. One of the things I have in my bochsrc.txt is this peculiar memory setup:

Code: Select all

memory: guest=8192, host=64
The idea is that Bochs uses up to 64MB of host memory, but emulates a guest with 8GB memory (this is to test whether high memory areas beyond the 4GB mark are correctly found and used by GRUB / the multiboot kernel). This worked nicely with Bochs 2.6.8, but Bochs 2.6.9 hangs at the memory setup. It does not hang when I set the guest memory to something smaller, like 256MB. Has anyone else experienced this?

Just in case, here's the configure command line I used to build Bochs (on Ubuntu 16.04 LTS):

Code: Select all

./configure --with-x11 --with-sdl2 --enable-pci --enable-cpu-level=6
And I also tried this one with the same result:

Code: Select all

./configure --with-x11 --with-sdl2 --enable-pci --enable-x86-64 --enable-avx
Here's the Bochs log (assuming the first command line - the x86_64 one looks nearly identical, except for the configure options):

Code: Select all

i00000000000:00000000[      ] Bochs x86 Emulator 2.6.9.svn
i00000000000:00000000[      ]   Built from SVN snapshot after release 2.6.9
i00000000000:00000000[      ] Compiled on Apr 11 2017 at 01:13:32
i00000000000:00000000[      ] System configuration
i00000000000:00000000[      ]   processors: 1 (cores=1, HT threads=1)
i00000000000:00000000[      ]   A20 line support: yes
i00000000000:00000000[      ] IPS is set to 4000000
i00000000000:00000000[      ] CPU configuration
i00000000000:00000000[      ]   SMP support: no
i00000000000:00000000[      ]   level: 6
i00000000000:00000000[      ]   APIC support: xapic
i00000000000:00000000[      ]   FPU support: yes
i00000000000:00000000[      ]   MMX support: yes
i00000000000:00000000[      ]   3dnow! support: no
i00000000000:00000000[      ]   SEP support: yes
i00000000000:00000000[      ]   SIMD support: sse2
i00000000000:00000000[      ]   XSAVE support: no
i00000000000:00000000[      ]   AES support: no
i00000000000:00000000[      ]   SHA support: no
i00000000000:00000000[      ]   MOVBE support: no
i00000000000:00000000[      ]   ADX support: no
i00000000000:00000000[      ]   x86-64 support: no
i00000000000:00000000[      ]   MWAIT support: yes
i00000000000:00000000[      ] Optimization configuration
i00000000000:00000000[      ]   RepeatSpeedups support: no
i00000000000:00000000[      ]   Fast function calls: no
i00000000000:00000000[      ]   Handlers Chaining speedups: no
i00000000000:00000000[      ] Devices configuration
i00000000000:00000000[      ]   PCI support: i440FX i430FX
i00000000000:00000000[      ]   Networking: no
i00000000000:00000000[      ]   Sound support: no
i00000000000:00000000[      ]   USB support: no
i00000000000:00000000[      ]   VGA extension support: vbe
i00000000000:00000000[MEM0  ] allocated memory at 0x7f113d595010. after alignment, vector=0x7f113d596000
i00000000000:00000000[MEM0  ] 8192,00MB
i00000000000:00000000[MEM0  ] mem block size = 0x00020000, blocks=65536
And a GDB trace to show where it hangs:

Code: Select all

Program received signal SIGINT, Interrupt.
0x000000000050169f in bx_list_c::add (this=0x204fb90, param=0x2a0c280) at paramtree.cc:1113
1113        while (temp->next)
(gdb) bt
#0  0x000000000050169f in bx_list_c::add (this=0x204fb90, param=0x2a0c280) at paramtree.cc:1113
#1  0x00000000005017d7 in bx_param_num_c::bx_param_num_c (this=0x2a0c280, parent=0x204fb90, name=<optimized out>, label=<optimized out>, description=<optimized out>, min=0, max=4294967295, initial_val=0, is_shadow=0) at paramtree.cc:184
#2  0x00000000004f72aa in BX_MEM_C::register_state (this=0x7ecfc0 <bx_mem>) at misc_mem.cc:317
#3  0x00000000004f76c6 in BX_MEM_C::init_memory (guest=guest@entry=8589934592, host=<optimized out>) at misc_mem.cc:152
#4  0x000000000044c663 in bx_init_hardware () at main.cc:1325
#5  0x000000000044d395 in bx_begin_simulation (argc=<optimized out>, argv=<optimized out>) at main.cc:1017
#6  0x0000000000504edf in bx_text_config_interface (menu=menu@entry=3) at textconfig.cc:416
#7  0x00000000005051da in ci_callback (userdata=<optimized out>, command=<optimized out>) at textconfig.cc:1051
#8  0x00000000004fe9ae in bx_real_sim_c::configuration_interface (this=0x2019210, ignore=<optimized out>, command=CI_START) at siminterface.cc:882
#9  0x000000000044bebb in bxmain () at main.cc:345
#10 0x00007ffff6506830 in __libc_start_main (main=0x4489c0 <main(int, char**)>, argc=5, argv=0x7fffffffe1b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1a8) at ../csu/libc-start.c:291
#11 0x0000000000449579 in _start ()

Re: Bochs 2.6.9 hangs for huge guest memory

Posted: Sat Apr 15, 2017 4:59 pm
by dozniak
It makes sense to report this to bochs developers, not here.

Re: Bochs 2.6.9 hangs for huge guest memory

Posted: Sat Apr 15, 2017 10:27 pm
by xenos
That is my plan. I just wanted to mention it here as well, since Bochs is used mainly by the OsDev community, so that it might be interesting for people here, and I was wondering whether anyone else has encountered this problem. In fact, I already found the solution to a few Bochs bugs in this forum (which also used to be frequented by Bochs developers).