[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Undefined behaviour in crond.c
From:       Markus Gothe <nietzsche () lysator ! liu ! se>
Date:       2019-09-03 18:33:02
Message-ID: go2r1ihduv68no4lmjgpsgj7.1567535582404 () lysator ! liu ! se
[Download RAW message or body]

[Attachment #2 (text/html)]

<html><head><meta http-equiv="Content-Security-Policy" content="script-src 'self'; \
img-src * cid: data:;"><style \
id="outgoing-font-settings">#response_container_BBPPID{font-family: initial; \
font-size:initial; color: initial;}</style></head><body contenteditable="false"><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true"> The process created by vfork() needs to _exit() instead of \
showing a potential error since it is an undefined behavior. So are calling the \
functions before execlp().</div><div id="response_container_BBPPID" \
style="outline:none;" dir="auto" contenteditable="true"><br></div><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true">From 'man vfork()':&nbsp;</div><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true">"Standard description (From POSIX.1) The vfork() function has \
the same effect as fork(2), except that the behavior is undefined if the process \
created by vfork() either modifies any data other than a variable of type pid_t used \
to store the return value from vfork(), or returns from the function in which vfork() \
was called, or calls any other function before successfully calling _exit(2) or one \
of the exec(3) family of functions. "</div><div id="response_container_BBPPID" \
style="outline:none;" dir="auto" contenteditable="true"><br></div><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true"><br></div><div id="response_container_BBPPID" \
style="outline:none;" dir="auto" contenteditable="true">TBH it might be better to use \
a fork() or posix_spawn().</div><div id="response_container_BBPPID" \
style="outline:none;" dir="auto" contenteditable="true"><br></div><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true">I recognized this by processes becoming zombies (and after \
some seconds they were reaped).</div><div id="response_container_BBPPID" \
style="outline:none;" dir="auto" contenteditable="true"><br></div><div \
id="response_container_BBPPID" style="outline:none;" dir="auto" \
contenteditable="true">&nbsp;//M<br style="display:initial"><br \
style="display:initial"> <div id="blackberry_signature_BBPPID" name="BB10" \
dir="auto">     <div id="_signaturePlaceholder_BBPPID" name="BB10" dir="auto">Sent \
from my BlackBerry — the most secure mobile device</div> </div></div></body></html>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic