Ticket #7250 (closed bug: fixed)

Opened 8 months ago

Last modified 7 months ago

Documentation of System.Mem.Weak should emphasize finalizers may be run earlier than expected

Reported by: edsko Owned by: simonmar
Priority: high Milestone: 7.6.2
Component: Documentation Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The problem is mentioned in addFinalizer, but not in mkWeak; moreover, the documentation of addFinalizer reads as if this is a problem specific to foreign pointers, which is not (and, unrelated, ForeignPtr?# does not exist anymore).

It would be useful if the problem were highlighted in mkWeak, as it may introduce hard to find bugs in user code in cases where finalizers that are run too early cause problems. The behaviour of mkWeak is highly non-obvious.

Change History

Changed 8 months ago by simonmar

  • owner set to simonmar
  • difficulty set to Unknown
  • priority changed from normal to high
  • milestone set to 7.6.2

Changed 8 months ago by simonmar

  • status changed from new to merge

Fixed:

commit 55594a7ca8d11e65b10cc5b4de7cc5714e2981a5
Author: Simon Marlow <marlowsd@gmail.com>
Date:   Fri Sep 21 16:11:20 2012 +0100

    Add a big warning to the documentation for Weak (#7250)

Changed 7 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged as 77f2692573ade4a89f999ca585081a73edaf7b53

Note: See TracTickets for help on using tickets.