Opened 9 years ago

Closed 8 years ago

#10258 closed enhancement (fixed)

Block interrupts during malloc

Reported by: jdemeyer Owned by: jdemeyer
Priority: major Milestone: sage-4.7
Component: c_lib Keywords: malloc sage_malloc
Cc: Merged in: sage-4.7.alpha1
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

Allow to temporarily suspend interrupts and do this in sage_malloc() and friends (an interrupt during malloc() will mess up the heap, this happens sometimes with a "fixed" #9564!)

Patch chain: #9678, #10061, #10258, #10030, #10018, #9640

Attachments (1)

10258_sage_malloc.patch (29.3 KB) - added by jdemeyer 8 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Owner changed from tba to jdemeyer

comment:2 Changed 8 years ago by jdemeyer

  • Description modified (diff)
  • Keywords c_lib removed
  • Status changed from new to needs_work

comment:3 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-feature to sage-4.6.2
  • Status changed from needs_work to needs_review

comment:4 Changed 8 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

comment:5 follow-up: Changed 8 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Nice!

There are some examples in the documentation that use malloc, for example doc/en/numerical_sage/ctypes_examples.rst. We should convert these to sage_malloc as well, probably in #10109.

comment:6 in reply to: ↑ 5 Changed 8 years ago by jdemeyer

Replying to vbraun:

Nice!

There are some examples in the documentation that use malloc, for example doc/en/numerical_sage/ctypes_examples.rst. We should convert these to sage_malloc as well, probably in #10109.

You are right that some documentation uses malloc. But that seems to be pure C code. So changing malloc to sage_malloc would imply linking against -Lcsage and possibly adding some sig_on()/sig_off() machinery and possibly more complications...

Changed 8 years ago by jdemeyer

comment:7 Changed 8 years ago by jdemeyer

Rebased patch

comment:8 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-4.6.2 to sage-4.7

comment:9 Changed 8 years ago by jdemeyer

  • Merged in set to sage-4.7.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.