You’re confusing the size of the array with the number of elements of the vertex attribute.
Whatever vertex attributes you are enabling (vertex/position/normal/color), they must all have the same number of elements (number of elements != array size).
Vertex color array can have 4 components (RGBA) per vertex, whereas normals always have 3 (XYZ). So the normal array must be (numVerts3) and color array (numVerts4). The array sizes differ, but they have the same number of vertices (elements).
If the attribute arrays do not have the same number of elements, it may result in undefined behavior according to the GL specification. On most decent GL implementations, you might get zeroes (the black you describe) or garbage (essentially zero or non-zero random values as the driver/hardware is accesing memory outside where it should not be allowed). If the graphics drivers are crappy, they may crash the application as happens for you on Mac. On many platforms, this undefined behavior is generally forgiving for backwards compatibility. There are a lot of legacy games/applications out there that would otherwise be unusable.
No no! Really! I think I understand the difference between number of elements and array size (even if I wasn’t clear).
On most decent GL implementations, you might get […] garbage (essentially zero or non-zero random values as the driver/hardware is accesing memory outside where it should not be allowed).
This is what I have on Linux.
So I suppose I just have to garbage the color VBO and this should solve the problem.
Thanks again.
PS: Very nice and interesting web site @remdul. Keep the good work!