Segmentation Fault in KMeans on OSX

### Describe the bug

Hi when I run this code

```
import numpy as np      
from sklearn.cluster import KMeans

X_train = np.random.RandomState(0).random((10, 2))
kmeans = KMeans(n_clusters=3, random_state=0).fit(X_train)
```

EDIT by @ogrisel: inserted `.RandomState(0)` in the above snippet to make the reproducer deterministic.

I get this error

`zsh: segmentation fault  python debugging.py`

This can't be a memory error, it's only a 10x2 matrix, any idea what's wrong?

Python 3.10.4
Anaconda installation
>>> sklearn.__version__
'1.0.2'
>>> numpy.__version__
'1.22.3'


### Steps/Code to Reproduce


```
import numpy as np      
from sklearn.cluster import KMeans

X_train = np.random.random((10, 2))
kmeans = KMeans(n_clusters=3, random_state=0).fit(X_train)
```

### Expected Results

KMeans clusters

### Actual Results

`zsh: segmentation fault  python debugging.py`

This can't be a memory error, it's only a 10x2 matrix, any idea what's wrong?


### Versions

```shell
Python 3.10.4
Anaconda installation
>>> sklearn.__version__
'1.0.2'
>>> numpy.__version__
'1.22.3'
```

COMMENT:
libomp strikes again on the latest Mac M1 upgrade:

The backtrace indicates that the segmentation fault occurred within the OpenMP library (libiomp5.dylib, libomp.dylib), which is used for parallel programming.

One particular thing to note is that you are using the M1 Mac, which is based on the ARM architecture, while most Python libraries are originally written for x86 architecture. Some of these libraries might have issues when running on the ARM architecture, even though they have been recompiled for it.

Here are a few things you could try:

1. **Check Your OpenMP Installation**: You might be using an outdated or incompatible version of the OpenMP library. Try updating it to the latest version compatible with your system. 

2. **Check the Packages Involved**: If you're using a package that heavily relies on parallel processing (e.g., numpy, pandas, scikit-learn, tensorflow), make sure you're using a version of the package that's compatible with your version of OpenMP and your M1 Mac.

3. **Try a Different Python Distribution**: You might have better luck with a different Python distribution. For instance, Miniforge is a distribution that provides conda packages specifically for ARM64 (like the M1), and it includes many popular scientific computing packages.

4. **Use Rosetta 2**: As a workaround, you could try running your Python application under Rosetta 2, which allows you to run software written for Intel chips on Apple's new M1 chips.

To do this, you would open Terminal through Rosetta (you can find this option by pressing `Command+I` when Terminal is highlighted in Finder) and run your Python script from there.

5. **Report a Bug**: If none of the above suggestions help, you might be encountering a bug. If you can create a minimal reproducible example, you could consider reporting it to the maintainers of the library causing the issue. They may be able to provide additional assistance or fix the issue in a future release.

Labels: Bug, Documentation, help wanted, module:cluster, OS:macOS