-
Notifications
You must be signed in to change notification settings - Fork 33
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
Spawn of multiple processes through syspage
fails.
#208
Comments
sypage
fails.syspage
fails.
The "Xdummyfs Ximxrt-multi Xpsh Xspawn_test;1 Xspawn_test;2 Xspawn_test;3 Xspawn_test;4 Xspawn_test;5 " after parsing, the memory content looks like this:
but whileis being parsed each of the Take a close look at the block with Lines 97 to 105 in 54c5d2c
What it actually does, for each processed As a redesign of the Not judging the solution itself, the below temporary hack seems to work: u32 skips = 0; /* bit index */ In for (prog = syspage->progs, i = 0; i < syspage->progssz; i++, prog++) {
if (!(skips & (1u << i)) && !hal_strcmp(cmdline + 1, prog->cmdline)) {
skips |= 1u << i;
argv[0] = prog->cmdline;
res = proc_syspageSpawn(prog, vm_getSharedMap(prog), prog->cmdline, argv);
if (res < 0) {
lib_printf("main: failed to spawn %s (%d)\n", argv[0], res);
}
break;
}
} The result is as expected: So, if there are better solutions that You guys have let's discuss them or if You agree with the presented approach let me prepare PR and commit. |
Description
Spawning multiple processes through
syspage
fails, leading to the number of instances being multiplied to the power of two (see the attached screen shots). I've checkedsyspage
content forwarded fromplo
to thekernel
and it looks ok, thus it seems an issue ofkernel
process spawn. I have verified this only onarmv7m7-imxrt106x
target so it may beNOMMU
specific and may be observed onarmv7m7-imxrt117x
too.This issue may be linked with Jira tasks ([RTOS-1] multiple sysexec usage fails) and [NIL-20], although I've not verifiedpsh
sysexec
behavior, but it looks similar.Simple program which may be used to reproduce:
Aliases are common to all of the cases below, and they are the following:
One instance:
Two instances:
Three instances:
Four instances:
Five instance:
Above and including four spawned instances system stopped responding nether
psh
was working norimxrt-multi
console input. I tried different combination of maps although using (imap=ocram2, dmap=ocram2) any time it looked the same.The text was updated successfully, but these errors were encountered: