Re: race-condition in ram_fs and fs_query?
Hi All, Reading release-notes 18.08 it states that RAM_FS and VFS are supposed to be equal. However, I don't get any errors when I replace my ram_fs config with this vfs: It perfectly reports the filename and contents in the report_rom. :-) Now the next step: create a dynamic ROM to start the pdf_view component on demand. Any pointers to run files that help me get going? Cheers, Guido. On 5/20/19 1:27 PM, Guido Witmond wrote: Hi Genodians, I'm working on my HnH19-project to create a component listening on a shared filesystem to open each pdf file into a separate instance of mupdf. Goal is to tie the share to a linux-vm in vbox so firefox and thunderbird can have a simple 'cp' command to get pdfs rendered outside that vm. I add a RAM-FS, FS-QUERY and REPORT-ROM to mupdf.run. The file gets put in the ram-fs, fs-query should pick that up and report it to the report-rom. I change the test-scenario to copy a pdf into the share and start the pdf-viewer. The viewer picks up the pdf and renders it. So far so good. The problem is that while the 'add'-test copies the file, it gets detected by fs_query but fs_query thinks it's gone: [init -> test -> add] --- noux started --- [init -> fs_query] Error: failed to watch '//foo.pdf' [init -> fs_query] Warning: could not obtain content of nonexistent file foo.pdf (The error comes from gems/vfs.h L556, the warning from fs_query/main.cc L80.) Fs_quey does send a new report but does not show the file, it show an empty directory. [init -> report_new_pdf] report 'fs_query -> listing' [init -> report_new_pdf] [init -> report_new_pdf] [init -> report_new_pdf] However, a ls -laR shows it's there: [init -> test -> ls-after] /dest: [init -> test -> ls-after] total 1 [init -> test -> ls-after] drwxr-xr-x 0 root 0 0 Jan 1 00:00 . [init -> test -> ls-after] drwxr-xr-x 0 root 0 0 Jan 1 00:00 .. [init -> test -> ls-after] -rwxrwxrwx 0 root 0 8192 Jan 1 00:00 foo.pdf Now the race condition: When I set the fs-query option to show the content to "no", it gives the same error: failed to watch '//foo.pdf' but it now it does send the file name to the report: [init -> report_new_pdf] So it seems that somehow that fs_query watch learns there is a file while the contents are not yet committed. Accessing that triggers a file-not-found error. Did I discover a race condition or am I doing something wrong? With regards, Guido. PS. I added the complete run-file and logs for completeness. (log-1 shows the contents-flag to no). PPS. I'm testing with Qemu in a linux VM on my AMD nixos host. ___ Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users ___ Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users
race-condition in ram_fs and fs_query?
Hi Genodians, I'm working on my HnH19-project to create a component listening on a shared filesystem to open each pdf file into a separate instance of mupdf. Goal is to tie the share to a linux-vm in vbox so firefox and thunderbird can have a simple 'cp' command to get pdfs rendered outside that vm. I add a RAM-FS, FS-QUERY and REPORT-ROM to mupdf.run. The file gets put in the ram-fs, fs-query should pick that up and report it to the report-rom. I change the test-scenario to copy a pdf into the share and start the pdf-viewer. The viewer picks up the pdf and renders it. So far so good. The problem is that while the 'add'-test copies the file, it gets detected by fs_query but fs_query thinks it's gone: [init -> test -> add] --- noux started --- [init -> fs_query] Error: failed to watch '//foo.pdf' [init -> fs_query] Warning: could not obtain content of nonexistent file foo.pdf (The error comes from gems/vfs.h L556, the warning from fs_query/main.cc L80.) Fs_quey does send a new report but does not show the file, it show an empty directory. [init -> report_new_pdf] report 'fs_query -> listing' [init -> report_new_pdf] [init -> report_new_pdf] [init -> report_new_pdf] However, a ls -laR shows it's there: [init -> test -> ls-after] /dest: [init -> test -> ls-after] total 1 [init -> test -> ls-after] drwxr-xr-x 0 root 00 Jan 1 00:00 . [init -> test -> ls-after] drwxr-xr-x 0 root 00 Jan 1 00:00 .. [init -> test -> ls-after] -rwxrwxrwx 0 root 0 8192 Jan 1 00:00 foo.pdf Now the race condition: When I set the fs-query option to show the content to "no", it gives the same error: failed to watch '//foo.pdf' but it now it does send the file name to the report: [init -> report_new_pdf] So it seems that somehow that fs_query watch learns there is a file while the contents are not yet committed. Accessing that triggers a file-not-found error. Did I discover a race condition or am I doing something wrong? With regards, Guido. PS. I added the complete run-file and logs for completeness. (log-1 shows the contents-flag to no). PPS. I'm testing with Qemu in a linux VM on my AMD nixos host. including /home/guido/genode/tool/run/power_on/qemu including /home/guido/genode/tool/run/log/qemu including /home/guido/genode/tool/run/image/iso including /home/guido/genode/tool/run/boot_dir/nova including /home/guido/genode/repos/mupdf-gw/run/mupdf-gw.run building targets: app/pdf_view server/ram_fs app/fs_query app/sequence spawn make app/pdf_view server/ram_fs app/fs_query app/sequence make[1]: Entering directory '/home/guido/genode/build/qemu_x86_64' checking library dependencies... [00;33m Library [0mldso-startup [00;33m Library [0mlibc-stdlib [00;33m Library [0mlibc-string [00;33m Library [0mlibc-locale [00;33m Library [0mlibc-inet [00;33m Library [0mlibc-stdio [00;33m Library [0mlibc-stdtime [00;33m Library [0mlibc-gdtoa [00;33m Library [0mlibc-regex [00;33m Library [0mlibc-gen [00;33m Library [0mlibc-setjmp [00;33m Library [0mlibc-compat [00;33m Library [0mlibc-mem [00;33m Library [0mlibc-resolv [00;33m Library [0mlibc-nameser [00;33m Library [0mlibc-isc [00;33m Library [0mmupdf_host_tools [00;33m Library [0mld [00;33m Library [0mlibc-rpc [00;33m Library [0mlibc-net [00;33m Library [0mbase [01;33m Program [0mapp/sequence/sequence [01;33m Program [0mserver/ram_fs/ram_fs [00;33m Library [0mvfs [01;33m Program [0mapp/fs_query/fs_query [00;33m Library [0mlibc [00;33m Library [0mzlib [00;33m Library [0mjpeg [00;33m Library [0mfreetype [00;33m Library [0mlibm [00;33m Library [0mlibpng [00;33m Library [0mopenjpeg [00;33m Library [0mjbig2dec [00;33m Library [0mmupdf [01;33m Program [0mapp/pdf_view/pdf_view make[1]: Leaving directory '/home/guido/genode/build/qemu_x86_64' genode build completed checking configuration syntax CHECK init using 'core-nova.o' as 'core.o' install bootloader creating ISO image... xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project. spawn qemu-system-x86_64 -no-kvm -display sdl -cpu core2duo -m 1536 -serial mon:stdio -cdrom var/run/mupdf-gw.iso -machine q35 warning: TCG doesn't support requested feature: CPUID.01H:EDX.vme [bit 1] Bender: Hello World. NOVA Microhypervisor v8-6ea1179 (x86_64): Apr 23 2019 21:58:39 [gcc 6.3.0] [MBI2] [ 0] TSC:3211945 kHz BUS:1005565 kHz (measured) [ 0] CORE:0:0:0 6:f:b:0 [0] Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz Hypervisor reports 1x1 CPU [0m [34mWarning: CPU has no invariant TSC.[0m CPU ID (genode->kernel:package:core:thread) remapping[0m remap (0->0:0:0:0) boot cpu[0m Hypervisor info page