Well after locating where the crash occurs and doing some serach on net, I found the cause is glGenVertexArrays in GL core mode sometimes cause problems with glew so just before glewInit() add the line:
glewExperimental = GL_TRUE;
and it works
I found the answer here:
http://stackoverflow.com/questions/1...texarrays-call
Hope this will help others...