Feature #9761

TRY_WITH_GC with ruby_gc_stress

Added by _ wanabe about 1 year ago. Updated about 1 year ago.

[ruby-core:62103]
Status:Closed
Priority:Normal
Assignee:-

Description

I hope TRY_WITH_GC() may use ruby_gc_stress value.

Currently, ruby_gc_stress doesn't affect simple xmalloc()/xrealloc()/xcalloc().
It is usefull to make these functions under gc-stress.
For example, #9657 is difficult to reproduce on trunk because there is not object creation but memory allocation after BigDecimal_new().

try_with_gc-with-gc_stress.patch Magnifier (691 Bytes) _ wanabe, 04/20/2014 01:39 AM

xrealloc-with-gc_stress.patch Magnifier (456 Bytes) _ wanabe, 04/21/2014 03:20 PM


Related issues

Related to Ruby trunk - Bug #9859: An object with 6 instance variables causes SEGV Closed 05/23/2014

Associated revisions

Revision 45653
Added by Nobuyoshi Nakada about 1 year ago

gc.c: GC.stress after realloc

  • gc.c (objspace_malloc_increase): run GC after realloc not only malloc and calloc by GC.stress. [Feature #9761]

Revision 45653
Added by Nobuyoshi Nakada about 1 year ago

gc.c: GC.stress after realloc

  • gc.c (objspace_malloc_increase): run GC after realloc not only malloc and calloc by GC.stress. [Feature #9761]

Revision 45655
Added by Nobuyoshi Nakada about 1 year ago

gc.c: full mark after malloc/realloc

  • gc.c (objspace_malloc_increase): run full mark if 0x04 bit is set in ruby_gc_stress. [Feature #9761]

Revision 45655
Added by Nobuyoshi Nakada about 1 year ago

gc.c: full mark after malloc/realloc

  • gc.c (objspace_malloc_increase): run full mark if 0x04 bit is set in ruby_gc_stress. [Feature #9761]

History

#1 Updated by _ wanabe about 1 year ago

  • Description updated (diff)

#2 Updated by Nobuyoshi Nakada about 1 year ago

  • Description updated (diff)
  • Category set to core
  • Status changed from Open to Feedback

Patches are welcome.

#3 Updated by _ wanabe about 1 year ago

I have written but I have not been able to avoid both temporary assignment and duplication of garbage_collect_with_gvl().

#4 Updated by _ wanabe about 1 year ago

  • Category set to core

#5 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Feedback

Seems objspace_malloc_increase() already runs GC after xmalloc and xcalloc if ruby_gc_stress is set.
You may want it to run after xrealloc too?
Or to run full marking?

#6 Updated by _ wanabe about 1 year ago

Nobuyoshi Nakada wrote:

Seems objspace_malloc_increase() already runs GC after xmalloc and xcalloc if ruby_gc_stress is set.
You may want it to run after xrealloc too?
Or to run full marking?

Sorry for my poor code reading...
It is enough to add a case of xrealloc for my concern, reproducing #9657.

Anyone can close/reject this ticket if you think this is far from the original proposal.

#7 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45653.


gc.c: GC.stress after realloc

  • gc.c (objspace_malloc_increase): run GC after realloc not only malloc and calloc by GC.stress. [Feature #9761]

#8 Updated by Nobuyoshi Nakada 11 months ago

  • Related to Bug #9859: An object with 6 instance variables causes SEGV added

Also available in: Atom PDF