fix segfault when running with cython coverage enabled, xref cython#2879
State: closed

We have several functions getting called inside a `with nogil:` block that aren't currently declared as `nogil`.  In the future cython should warn in this type of situation (cython#2879).

Labels:
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=h1) Report
> Merging [#25529](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bd49d2f2af5c44d4f96031757743ba83e6b29408?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/25529/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #25529   +/-   ##
=======================================
  Coverage   91.75%   91.75%           
=======================================
  Files         173      173           
  Lines       52960    52960           
=======================================
  Hits        48595    48595           
  Misses       4365     4365
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.33% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=footer). Last update [bd49d2f...355f7a2](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=h1) Report
> Merging [#25529](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bd49d2f2af5c44d4f96031757743ba83e6b29408?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/25529/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #25529   +/-   ##
=======================================
  Coverage   91.75%   91.75%           
=======================================
  Files         173      173           
  Lines       52960    52960           
=======================================
  Hits        48595    48595           
  Misses       4365     4365
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.33% <ø> (ø)` | :arrow_up: |
| #single | `41.71% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=footer). Last update [bd49d2f...355f7a2](https://codecov.io/gh/pandas-dev/pandas/pull/25529?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

is there any kind of test that causes things to currently segfault?
> is there any kind of test that causes things to currently segfault?

I only found it by compiling with cython coverage enabled.  So nothing with the current set of builds.
can we enable this in our builds?
> can we enable this in our builds?

Enabling coverage makes the tests really slow; I'm pretty sure CI would time out.  Maybe for the nightly build or something?
> Enabling coverage makes the tests really slow; I'm pretty sure CI would time out. Maybe for the nightly build or something?

oh ok, sure, yes please. https://github.com/macpython/pandas-wheels