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

abnormal exit 4 #381

Open
xrdavies opened this issue Oct 13, 2018 · 3 comments
Open

abnormal exit 4 #381

xrdavies opened this issue Oct 13, 2018 · 3 comments
Labels
monitoring This issue is not reproducible, need more infomation.

Comments

@xrdavies
Copy link
Contributor

Version: 0.3.0

Platform: Mac OS 10.13

Description:

When tried to load test net storage files, it reported exit 4 in the subprocess.

The code

static void angelize(void)
{
#if !defined(_WIN32) && !defined(_WIN64)
	int stat = 0;
	pid_t childpid;
	while((childpid = fork())) {
		signal(SIGINT, SIG_IGN);
		signal(SIGTERM, SIG_IGN);
		if(childpid > 0) while(waitpid(childpid, &stat, 0) == -1) {
			if(errno != EINTR) {
				xdag_err("abort on error");
				abort();
			}
		}
		if(stat >= 0 && stat <= 5) {
			xdag_err("exit %d", stat);
			exit(stat);
		}
		sleep(10);
	}
#endif
}

The storage files:
http://corpopool.com/download/xdagtest.tar.gz

@sgaragagghu
Copy link
Contributor

sgaragagghu commented Oct 18, 2018

on linux i don't have this issue, at which block number it happens?

if i understood it correctly
this should happen only if child exited with success
:

		if(stat >= 0 && stat <= 5) {
			xdag_err("exit %d", stat);
			exit(stat);
		}

in other cases it does another fork, restart (that's why when xdag crash it usually restart)
stat value is implementation dependent, so it cannot be read directly,
https://linux.die.net/man/2/waitpid here the macros to read stat correctly.
But i don't know what he mean with stat >= 0 && stat <= 5, it may be the argument of exit() of the child.. so it should be WEXITSTATUS(stat) >= 0 && WEXITSTATUS(stat) <= 5...

@xrdavies
Copy link
Contributor Author

@sgaragagghu
According to the explanation of waitpid, the least significant 8 bits store the signal.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/exit.c?h=v4.18.16

Tried to catch the stats with

if(WIFSIGNALED(stat)) {
			printf("killed by signal %d\n", WTERMSIG(stat));
		}

and it's signal 4.

xdag> killed by signal 4

signal 4 is #define SIGILL 4 /* illegal instruction (not reset when caught) */

Still have no idea what causes this signal yet.

@sgaragagghu
Copy link
Contributor

interesting... it doesn't happen on linux (at least on my computer) so it hard is for me to catch the cause of the issue :/

@xrdavies xrdavies added the help wanted Extra attention is needed label Oct 31, 2018
@xrdavies xrdavies added monitoring This issue is not reproducible, need more infomation. and removed help wanted Extra attention is needed labels Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monitoring This issue is not reproducible, need more infomation.
Projects
None yet
Development

No branches or pull requests

2 participants