Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awk:fatal:cannot_open_file`page_slab'for_reading(No_such_file_or_directory) #105

Open
zhoujie2022 opened this issue May 7, 2022 · 0 comments

Comments

@zhoujie2022
Copy link

The error is because of multiple shell run at the same time.

normal process is
-> create file(cnt=page-types -Nl -b $1 | tee page_$1 | wc -l) -> get value(page=awk -v line=${rand} 'NR == line {print $1}' page_$1) -> remove file(rm -f page_$1)

but the real is
->thread 1 create page_slab -> thread 2 create page_slab -> thread 1 get value -> thread 1 remove page_slab -> thread 2 get value -> awk:fatal:cannot_open_file`page_slab'for_reading(No_such_file_or_directory)

In pfa/inject:
function get_free_page()
{
local rand=0
cnt=page-types -Nl -b $1 | tee page_$1 | wc -l
if [ $cnt -gt 1 ]; then
rand=$(expr $RANDOM % $cnt + 1)
if [ ${rand} -eq 1 ]; then
# skip the title line of output
((rand++))
fi
page=awk -v line=${rand} 'NR == line {print $1}' page_$1
echo 0x${page}
else
echo 0
fi
rm -f page_$1
}

Change the mce-log/tests/test to do test at one time, and the result is OK.
diff test_org test
49c49
< ./inject $conf &

./inject $conf

./test pfa ""
++++++++++++ running pfa test +++++++++++++++++++
mcelog: no process found
+++ start the injection for page-account.conf +++
inject for page type slab at physical address 0x817c87000 [ NO. 0 ]
inject for page type slab at physical address 0x817c87000 [ NO. 1 ]
+++ start the injection for page-hard.conf +++
inject for page type slab at physical address 0x183319000 [ NO. 0 ]
inject for page type slab at physical address 0x183319000 [ NO. 1 ]
+++ start the injection for page-soft-then-hard.conf +++
inject for page type slab at physical address 0x241c53000 [ NO. 0 ]
+++ start the injection for page-soft.conf +++
inject for page type slab at physical address 0x818a35000 [ NO. 0 ]
inject for page type slab at physical address 0x818a35000 [ NO. 1 ]

./test_org pfa ""
++++++++++++ running pfa test +++++++++++++++++++
mcelog: no process found
+++ start the injection for page-account.conf +++
inject for page type slab at physical address 0x1351c0000 [ NO. 0 ]
inject for page type slab at physical address 0x1351c0000 [ NO. 1 ]
+++ start the injection for page-hard.conf +++
+++ start the injection for page-soft-then-hard.conf +++
inject for page type slab at physical address 0x102788000 [ NO. 0 ]
inject for page type slab at physical address 0x102788000 [ NO. 1 ]
awk: fatal: cannot open file page_slab' for reading (No such file or directory) inject for page type slab at physical address 0x000 [ NO. 0 ] ../../input/GENPAGE: line 15: printf: 0x: invalid hex number ../../input/GENPAGE: line 23: printf: 0x: invalid hex number +++ start the injection for page-soft.conf +++ root@lkp-skl-d05 /lkp/benchmarks/mce-log/tests# awk: fatal: cannot open file page_buddy' for reading (No such file or directory)
inject for page type slab at physical address 0x1a0ee6000 [ NO. 0 ]
inject for page type slab at physical address 0x1a0ee6000 [ NO. 1 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant