Here is a minimal code that will produce a Segmentation fault.
#include<vector>
int main() {
std::vector<double> a;
a.resize(10);
return 0;
}
Obviously there is nothing wrong with this code. I have run it on several systems without issue, but it produces a segmentation fault on my work pc.
Code is compiled using g++ file.cpp on a system running openSUSE 11.1. I know it is an older OS, but I am not allowed to upgrade or reinstall. The only thing I have permissions for is zypper (the command line utility to install and remove programs).
My assumption is it has something to do with the c++ libraries. I have tried reinstalling everything I can think of related to gcc/g++ and libstdc++, but I still see the same issue.
Has anyone seen something like this before? Any ideas?
Thanks!