I have a custom petalinux 2016.3 system running and observe the following: When I compile and run a cpp that uses system() calls like the example under i get:
Oops: kernel access of bad area, sig: 11
CPU: 0 PID: 381 Comm: Application Not tainted 4.6.0 #63
task: ce486500 ti: ce4cc000 task.ti: ce4cc000
I can see all 3 echos in the terminal, but the Oops appears before the "we never get here" printf. It seems like the kernel access of bad area appears when function() returns.
Are there some specific kernel or rootfs modules/settings missing that could make the system behave this way?
I have several thousand lines of code running other library functions and it is only system() that seems to fail.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
void function(){
system("echo hello");
system("echo hello2");
system("echo hello3");
}
int main(int argc, char **argv){
function();
printf("We never get here\n");
return 1;
}
After some more debugging, the problem seemed to come from a library included in the makefile (lEasyBmp).
Why it triggered this exact failure when not used I have not found out. All library files are built and found in the system but if anyone has the same problem, including some libraries might trigger it.