Trivial C++ program crashes
The following program crashes if compiled and run with current nightly build:
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
void some_func(int filedes[]) {
socketpair(AF_UNIX, SOCK_STREAM, 0, filedes);
}
int main(int argc, char **argv) {
return 0;
}
Note that the #include <iostream> is necessary to cause the crash even though nothing from it is used, and the call to socketpair is necessary to cause the crash even though it is never executed.
root@dragonsort ~/prog/simplecc # g++ testme.cc
root@dragonsort ~/prog/simplecc # ./a.out
The current process (pid 1195 `./a.out') crashed and was terminated:
Page fault exception at ip=0x0 (cr2=0x0, err_code=0x14)
Segmentation fault