Opened 5 years ago

Closed 4 years ago

## #24288 closed defect (duplicate)

# Failing tests in sage.rings.bernmm due to cysignals error on SAGE_DEBUG=yes

Reported by: | Erik Bray | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |

Component: | packages: standard | Keywords: | |

Cc: | Jeroen Demeyer | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description (last modified by )

When running these tests (and possible others; need to check) I'm getting a lot of error messages + tracebacks from Cysignals on a debug build:

sage -t src/sage/rings/bernmm.pyx ********************************************************************** File "src/sage/rings/bernmm.pyx", line 67, in sage.rings.bernmm.bernmm_bern_rat Failed example: lst1 = [ bernoulli(2*k, algorithm='bernmm', num_threads=2) for k in [2932, 2957, 3443, 3962, 3973] ] Expected nothing Got: <BLANKLINE> *** ERROR *** sig_unblock() with sig_on_count = 1, block_sigint = 0 /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/cysignals/signals.so(+0x4eab)[0x7f48f55f7eab] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/ext/memory.so(+0x24d5)[0x7f48b35f24d5] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/ext/memory.so(+0x2122)[0x7f48b35f2122] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/ext/memory.so(+0x247f)[0x7f48b35f247f] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/ext/memory.so(+0x2320)[0x7f48b35f2320] /home/embray/src/sagemath/sage/local/lib/libgmp.so.23(__gmpz_realloc+0x5a)[0x7f48f4a5fbdb] /home/embray/src/sagemath/sage/local/lib/libgmp.so.23(__gmpz_mul_ui+0x94)[0x7f48f4a59bad] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/rings/bernmm.so(_ZN6bernmm6workerEPv+0x1bc)[0x7f4895cfa91a] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/rings/bernmm.so(_ZN6bernmm8bern_ratEP12__mpq_structli+0x4c6)[0x7f4895cfafbb] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/rings/bernmm.so(+0xbbdc)[0x7f4895ceebdc] /home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/rings/bernmm.so(+0xb96c)[0x7f4895cee96c] /home/embray/src/sagemath/sage/local/lib/libpython2.7.so.1.0(PyCFunction_Call+0xbd)[0x7f48fabd911f] ...

I trimmed the traceback after this point since it appears to just be Python's stack.

It seems likely to do with the use of `sig_realloc`

inside GMP/MPIR in a multi-threaded environment, whereas we know cysignals is not currently thread safe. We should probably disable its use before calling this multi-threaded procedure...

### Change History (11)

### comment:1 Changed 5 years ago by

Description: | modified (diff) |
---|

### comment:2 Changed 5 years ago by

Milestone: | sage-8.1 → sage-8.2 |
---|

### comment:3 Changed 5 years ago by

### comment:4 Changed 5 years ago by

Milestone: | sage-8.2 → sage-8.3 |
---|

### comment:5 Changed 4 years ago by

Milestone: | sage-8.3 → sage-wishlist |
---|

### comment:7 Changed 4 years ago by

Milestone: | sage-wishlist → sage-duplicate/invalid/wontfix |
---|---|

Resolution: | → duplicate |

Status: | new → closed |

This is fixed in the experimental branch https://github.com/sagemath/cysignals/pull/109

### comment:8 Changed 4 years ago by

Milestone: | sage-duplicate/invalid/wontfix |
---|---|

Resolution: | duplicate |

Status: | closed → new |

Interesting. Is there a separate ticket in Sage for this? Even though the issue is for cysignals to fix, it's still an issue in Sage as well until/unless Sage depends on a cysignals that has the fix.

### comment:10 Changed 4 years ago by

Report Upstream: | N/A → Fixed upstream, but not in a stable release. |
---|

### comment:11 Changed 4 years ago by

Milestone: | → sage-duplicate/invalid/wontfix |
---|---|

Report Upstream: | Fixed upstream, but not in a stable release. → Fixed upstream, in a later stable release. |

Resolution: | → duplicate |

Status: | new → closed |

Fixed by #27070

**Note:**See TracTickets for help on using tickets.

This is still a problem I'm seeing. It goes away when building cysignals without debug, but that's just because the messages aren't being displayed. The underlying problem is probably still there.