[Barrelfish-users] qemu: only core 0 works
Simon Gerber
simon.gerber at inf.ethz.ch
Tue Oct 21 11:27:26 CEST 2014
Hi Colin,
I've fixed the root cause of the threads example (which was actually an
issue for any multi-threaded program that uses printf): newlib's
sys/lock.h implementation is essentially a no-op. See the attached patch
for a very simple sys/lock.h implementation using Barrelfish's
thread_mutex_* functions (note: I haven't tested this extensively, but
it fixes the threads example and doesn't break the rest of the system).
As an aside: I've took out the printf on line 43 in the threads example
which also makes it work in release2014-08-29 (as does changing the
printf to a debug_printf).
Out of interest: what version of Barrelfish are you currently using?
-- Simon
On 21.10.2014 09:15, Colin Snook cfs wrote:
> Thanks Simon,
>
> By the way, i took out all the printf from the threads example but it still hangs.
>
> I will try some examples from menu.lst
>
> Colin
>
>
>
> On 20 Oct 2014, at 14:26, Simon Gerber <simon.gerber at inf.ethz.ch> wrote:
>
>> Hi Colin,
>>
>> The crash when interactively running programs on cores other than core 0 is a known problem to do with how our terminal sessions are inherited by child processes (we currently can't transfer CNodes between cores, but the sessions are inherited by giving the child process a special CNode with the capabilities it's inheriting). A workaround is to start processes on cores other than 0 using the following in menu.lst:
>>
>> module /x86_64/sbin/hellotest core=1
>>
>> instead of running them from the interactive interface.
>>
>> As far as I can tell the thread example also breaks because it is run in a terminal session. I'm guessing that there is some part of the terminal session code that doesn't play nice with user-space threads. I'm currently looking into that issue.
>>
>> Best,
>> -- Simon
>>
>>
>> On 10.10.2014 13:15, Colin Snook cfs wrote:
>>> Hi,
>>>
>>> Still not getting anywhere..
>>> this is what the threads example does:
>>> (i.e. hangs after all threads started)
>>>
>>>> /x86_64/sbin/examples/xmpl-thread 3
>>> spawnd.0: spawning /x86_64/sbin/examples/xmpl-thread on core 0
>>> xmpl-thread.0: starting 3 threads
>>> xmpl-thread.0: started thread 0
>>> xmpl-thread.0: started thread 1
>>> xmpl-thread.0: started thread 2
>>> this is thread 0 saying hello
>>> xmpl-thread.0: all threads started
>>> QEMU: Terminated
>>> colin at prime-phi-1:~/barrelfish/build$
>>>
>>> Colin
>>>
>>>
>>>
>>> On 9 Oct 2014, at 15:46, Colin Snook cfs <cfs at ecs.soton.ac.uk> wrote:
>>>
>>>> Hi
>>>>
>>>> I am trying to explore the examples code running barrelfish on QEMU but not getting very far.
>>>>
>>>> e.g. should i be able to run hello world on cores other than core 0?
>>>>
>>>> oncore 0 /x86_64/sbin/examples/xmpl-hello works, but
>>>> oncore 1 /x86_64/sbin/examples/xmpl-hello crashes
>>>>
>>>> Thanks Colin
>>>>
>>>> ------
>>>>
>>>>
>>>> colin at prime-phi-1:~/barrelfish/build$ make sim
>>>> qemu-img create hd.img 10M
>>>> Formatting 'hd.img', fmt=raw size=10485760
>>>> qemu-system-x86_64 -smp 3 -m 1024 -net nic,model=e1000 -net user -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -drive id=disk,file=hd.img,if=none -nographic -kernel x86_64/sbin/elver -append 'loglevel=4' -initrd 'x86_64/sbin/cpu loglevel=4,x86_64/sbin/init,x86_64/sbin/mem_serv,x86_64/sbin/monitor,x86_64/sbin/ramfsd boot,x86_64/sbin/skb boot,skb_ramfs.cpio.gz nospawn,x86_64/sbin/kaluga boot,x86_64/sbin/acpi boot,x86_64/sbin/spawnd boot,x86_64/sbin/startd boot,x86_64/sbin/routing_setup boot,x86_64/sbin/pci auto,x86_64/sbin/ahcid auto,x86_64/sbin/rtl8029 auto,x86_64/sbin/e1000n auto,x86_64/sbin/NGD_mng auto,x86_64/sbin/netd auto,x86_64/sbin/serial,x86_64/sbin/fish nospawn,x86_64/sbin/angler serial0.terminal xterm,x86_64/sbin/examples/xmpl-hello,x86_64/sbin/examples/xmpl-thread,x86_64/sbin/examples/xmpl-spawn' -no-kvm
>>>> Kernel starting at address 0xfffffe0009a77000
>>>> Barrelfish CPU driver starting on x86_64 apic_id 0
>>>> kernel 0: Measured 1000000139 APIC timer counts in one RTC second, 11564121 data points.
>>>> kernel 0: Measured 2594754 TSC counts per ms, 99 data points. Average jitter 1286 TSC ticks.
>>>> spawn module: x86_64/sbin/init
>>>> aligning free memory start to 0xb000000 (was 0xac30000): wasting 3904 kB
>>>> Raw MMAP from BIOS
>>>> 0x00000000 - 0x0009ec00 Type: 1 Length: 0x9ec00
>>>> 0x0009ec00 - 0x000a0000 Type: 2 Length: 0x1400
>>>> 0x000f0000 - 0x00100000 Type: 2 Length: 0x10000
>>>> 0x00100000 - 0x3fffd000 Type: 1 Length: 0x3fefd000
>>>> 0x3fffd000 - 0x40000000 Type: 2 Length: 0x3000
>>>> Sorted MMAP
>>>> 0x00000000 - 0x0009ec00 Type: 1 Length: 0x9ec00
>>>> 0x0009ec00 - 0x000a0000 Type: 2 Length: 0x1400
>>>> 0x000f0000 - 0x00100000 Type: 2 Length: 0x10000
>>>> 0x00100000 - 0x3fffd000 Type: 1 Length: 0x3fefd000
>>>> 0x3fffd000 - 0x40000000 Type: 2 Length: 0x3000
>>>> Preprocessed MMAP
>>>> 0x00000000 - 0x0009ec00 Type: 1 Length: 0x9ec00
>>>> 0x0009ec00 - 0x000a0000 Type: 2 Length: 0x1400
>>>> 0x000f0000 - 0x00100000 Type: 2 Length: 0x10000
>>>> 0x00100000 - 0x3fffd000 Type: 1 Length: 0x3fefd000
>>>> 0x3fffd000 - 0x40000000 Type: 2 Length: 0x3000
>>>> Pagealigned MMAP
>>>> 0x00000000 - 0x0009e000 Type: 1 Length: 0x9e000
>>>> 0x0009e000 - 0x000a0000 Type: 2 Length: 0x2000
>>>> 0x000f0000 - 0x00100000 Type: 2 Length: 0x10000
>>>> 0x00100000 - 0x3fffd000 Type: 1 Length: 0x3fefd000
>>>> 0x3fffd000 - 0x40000000 Type: 2 Length: 0x3000
>>>> init: invoked as: init 2097152
>>>> Spawning memory server (x86_64/sbin/mem_serv)...
>>>> Spawning monitor (x86_64/sbin/monitor)...
>>>> monitor: invoked as: x86_64/sbin/monitor 327680
>>>> Init done.
>>>> RAM allocator initialised, 831 MB (of 847 MB) available
>>>> Spawning ramfsd on core 0
>>>> ramfsd.0: pre-populating from boot image...
>>>> ramfsd.0: unpacking Gzipped CPIO skb_ramfs.cpio.gz
>>>> ramfsd.0: ready
>>>> Spawning skb on core 0
>>>> Spawning x86_64/sbin/kaluga on core 0
>>>> Spawning x86_64/sbin/acpi on core 0
>>>> Spawning x86_64/sbin/spawnd on core 0
>>>> Spawning x86_64/sbin/startd on core 0
>>>> Spawning x86_64/sbin/routing_setup on core 0
>>>> Kaluga: parse boot modules...
>>>> Kaluga running on x86.
>>>> Spawnd up.
>>>> spawnd.0: we're bsp. start other cores.
>>>> skb.0: waiting for: all_spawnds_up
>>>> kernel: 0: installing handler for IRQ 0
>>>> Monitor 0: booting x86_64 core 1 as '/x86_64/sbin/cpu loglevel=4'
>>>> Kernel starting at address 0xfffffe001d001000
>>>> Barrelfish CPU driver starting on x86_64 apic_id 1
>>>> kernel 1: Measured 2594589 TSC counts per ms, 99 data points. Average jitter 688 TSC ticks.
>>>> spawn module: monitor
>>>> monitor: invoked as: monitor 0 chanid=0 archid=0
>>>> Spawning spawnd on core 1
>>>> Installing fixed event handler for power button
>>>> Monitor 0: booting x86_64 core 2 as '/x86_64/sbin/cpu loglevel=4'
>>>> Kernel starting at address 0xfffffe001e001000
>>>> Barrelfish CPU driver starting on x86_64 apic_id 2
>>>> kernel 2: Considerable TSC jitter detected! 6825190 ticks on average.
>>>> kernel 2: Measured 6227352 TSC counts per ms, 99 data points. Average jitter 6825190 TSC ticks.
>>>> spawn module: monitor
>>>> monitor: invoked as: monitor 0 chanid=0 archid=0
>>>> Spawnd up.
>>>> Spawning spawnd on core 2
>>>> all 3 monitors up
>>>> monitor: synchronizing clocks
>>>> Kaluga: pci_root_bridge
>>>> spawnd.0: spawning /x86_64/sbin/pci on core 0
>>>> Kaluga: pci_devices
>>>> pci: Unknown commandline option "auto" -- skipping.
>>>> pci.0: No PCIe found, continue.
>>>> startd.0: starting app /x86_64/sbin/serial on core 0
>>>> spawnd.0: spawning /x86_64/sbin/serial on core 0
>>>> startd.0: starting app /x86_64/sbin/angler on core 0
>>>> skb.0: waiting for: pci
>>>> spawnd.0: spawning /x86_64/sbin/angler on core 0
>>>> startd.0: starting app /x86_64/sbin/examples/xmpl-hello on core 0
>>>> spawnd.0: spawning /x86_64/sbin/examples/xmpl-hello on core 0
>>>> startd.0: starting app /x86_64/sbin/examples/xmpl-thread on core 0
>>>> Hello World
>>>> skb.0: waiting for: serial0.terminal
>>>> spawnd.0: spawning /x86_64/sbin/examples/xmpl-thread on core 0
>>>> startd.0: starting app /x86_64/sbin/examples/xmpl-spawn on core 0
>>>> spawnd.0: spawning /x86_64/sbin/examples/xmpl-spawn on core 0
>>>> No bootscript
>>>> usage xmpl-thread num_threads
>>>> Spawnd up.
>>>> xmpl-spawn.0: This is xmpl-spawn on core 0
>>>> xmpl-spawn.0: not spawning any programs
>>>> xmpl-spawn.0: Finished
>>>> spawnd.0: spawning /x86_64/sbin/e1000n on core 0
>>>> ############# starting network with arguments cardname=e1000
>>>> spawnd.0: spawning /x86_64/sbin/netd on core 0
>>>> e1000n.0 in main() ../usr/drivers/e1000/e1000n.c:963
>>>> ERROR: Can't run [e1000n] on core-0 with interrupt enabled, please choose different core
>>>>
>>>> Aborted
>>>> spawnd.0: spawning /x86_64/sbin/NGD_mng on core 0
>>>> owner_lwip_init: Inside lwip_init
>>>> lwip_init_ex: starting......................
>>>> LWIP_other: Inside lwip_init
>>>> #### netd Going ahead with default wait-set
>>>> LWIP: lwip_init: done with sanity check
>>>> LWIP: done with sanity check
>>>> idc_c_port_mng_srv: trying to [e1000_PORTS_MNG]
>>>> skb.0: waiting for: e1000_PORTS_MNG
>>>> NGKDM: card name = e1000
>>>> Started net_dev_manager for [e1000] Q[1] QT[0]
>>>> skb.0: waiting for: e1000_0_FILT
>>>> spawnd.0: spawning /x86_64/sbin/ahcid on core 0
>>>> skb.0: waiting for: pci
>>>> kernel: 0: installing handler for IRQ 1
>>>> kernel: 0: installing handler for IRQ 2
>>>> ahcid: registered device 8086:2922
>>>> spawnd.0: spawning /x86_64/sbin/fish on core 0
>>>> fish v0.2 -- pleased to meet you!
>>>> File /init.fish not found
>>>> available commands:
>>>> help print_cspace quit ps demo
>>>> pixels mnfs oncore reset poweroff
>>>> skb mount ls cd pwd
>>>> touch cat cat2 dd cp
>>>> rm mkdir rmdir setenv src
>>>> printenv free
>>>>> oncore 0 /x86_64/sbin/examples/xmpl-hello
>>>> /x86_6examples/xmpl-hello: file not found: The given name does not exist
>>>>> ^
>>>>> oncore 0 /x86_64/sbin/examples/xmpl-hello
>>>> spawnd.0: spawning /x86_64/sbin/examples/xmpl-hello on core 0
>>>>> Hello World
>>>>
>>>>> oncore 1 /x86_64/sbin/examples/xmpl-hello
>>>> monitor.1 in monitor_cap_create() ../usr/monitor/invocations.c:107
>>>> NYI
>>>> Aborted
>>>> kernel 1: monitor terminated; expect badness!
>>>> _______________________________________________
>>>> Barrelfish-users mailing list
>>>> Barrelfish-users at lists.inf.ethz.ch
>>>> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
>>>
>>>
>>> _______________________________________________
>>> Barrelfish-users mailing list
>>> Barrelfish-users at lists.inf.ethz.ch
>>> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
>>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implemented-newlib-__lock_-functions-for-Barrelfish.patch
Type: text/x-patch
Size: 7194 bytes
Desc: not available
Url : https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20141021/ab5b8d27/attachment.bin
More information about the Barrelfish-users
mailing list