diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-19 15:03:47 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-19 15:03:47 -0200 |
| commit | 0e60572606684458b18febfcef0bc68235b461f4 (patch) | |
| tree | eec42d018bfbe9402b7109df7f78d49300f90adb /bugs | |
| parent | 621ef9f7675829234e75b0b3e73afc7a1a74aa16 (diff) | |
| download | lua-0e60572606684458b18febfcef0bc68235b461f4.tar.gz lua-0e60572606684458b18febfcef0bc68235b461f4.tar.bz2 lua-0e60572606684458b18febfcef0bc68235b461f4.zip | |
values holded in open upvalues of suspended threads may be
incorrectly collected
Diffstat (limited to 'bugs')
| -rw-r--r-- | bugs | 39 |
1 files changed, 39 insertions, 0 deletions
| @@ -428,6 +428,7 @@ patch = [[ | |||
| 428 | ]], | 428 | ]], |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | |||
| 431 | Bug{ | 432 | Bug{ |
| 432 | what = [[`pc' address is invalidated when a coroutine is suspended]], | 433 | what = [[`pc' address is invalidated when a coroutine is suspended]], |
| 433 | example = [[ | 434 | example = [[ |
| @@ -704,3 +705,41 @@ patch = [[ | |||
| 704 | ]] | 705 | ]] |
| 705 | } | 706 | } |
| 706 | 707 | ||
| 708 | |||
| 709 | Bug{ | ||
| 710 | what = [[values holded in open upvalues of suspended threads may be | ||
| 711 | incorrectly collected]], | ||
| 712 | |||
| 713 | report = [[Spencer Schumann, 31/12/2004]], | ||
| 714 | |||
| 715 | example = [[ | ||
| 716 | local thread_id = 0 | ||
| 717 | local threads = {} | ||
| 718 | |||
| 719 | function fn(thread) | ||
| 720 | thread_id = thread_id + 1 | ||
| 721 | threads[thread_id] = function() | ||
| 722 | thread = nil | ||
| 723 | end | ||
| 724 | coroutine.yield() | ||
| 725 | end | ||
| 726 | |||
| 727 | while true do | ||
| 728 | local thread = coroutine.create(fn) | ||
| 729 | coroutine.resume(thread, thread) | ||
| 730 | end | ||
| 731 | ]], | ||
| 732 | |||
| 733 | patch = [[ | ||
| 734 | * lgc.c: | ||
| 735 | 221,224c221,222 | ||
| 736 | < if (!u->marked) { | ||
| 737 | < markobject(st, &u->value); | ||
| 738 | < u->marked = 1; | ||
| 739 | < } | ||
| 740 | --- | ||
| 741 | > markobject(st, u->v); | ||
| 742 | > u->marked = 1; | ||
| 743 | ]], | ||
| 744 | } | ||
| 745 | |||
