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

Signal is not handled twice with a specific order of headers. #9

Open
hadichahine opened this issue Apr 16, 2020 · 0 comments
Open

Comments

@hadichahine
Copy link

Consider the following program:

#include "e4c.h"
#include <stdio.h>
#include <stdlib.h>

void run(){
	e4c_using_context(E4C_TRUE){
		try{
			int *s = NULL;
			*s = 0;
		}catch(BadPointerException){
			printf("signal handled\n");
		}
	}
}

void main(){
	run();
	run();
}

The first signal is handled while the second is not. It crashes the program with SIGSEGV. This also happens in the case of ArithemticException (dividing by zero for instance).
Place "e4c.h" after the standard headers and the program works as it should do.

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