From 5e5cfc1d8eaae3cffecd6f5962fc12e426bde1ae Mon Sep 17 00:00:00 2001 From: markj Date: Mon, 25 May 2015 02:30:54 +0000 Subject: [PATCH] 3599 dtrace_dynvar tail calls can blow stack Reviewed by: Adam Leventhal Reviewed by: Gordon Ross Approved by: Richard Lowe Author: Bryan Cantrill illumos/illumos-gate@d47448f09aae3aa1a87fc450a0c44638e7ce7b51 --- uts/common/dtrace/dtrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uts/common/dtrace/dtrace.c b/uts/common/dtrace/dtrace.c index 0d2d6f524c2..aa4b1d67e07 100644 --- a/uts/common/dtrace/dtrace.c +++ b/uts/common/dtrace/dtrace.c @@ -21,7 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2015, Joyent, Inc. All rights reserved. * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ @@ -2037,7 +2037,7 @@ dtrace_dynvar(dtrace_dstate_t *dstate, uint_t nkeys, * this hash chain, or another CPU is deleting an element from this * hash chain. The simplest way to deal with both of these cases * (though not necessarily the most efficient) is to free our - * allocated block and tail-call ourselves. Note that the free is + * allocated block and re-attempt it all. Note that the free is * to the dirty list and _not_ to the free list. This is to prevent * races with allocators, above. */ @@ -2050,7 +2050,7 @@ dtrace_dynvar(dtrace_dstate_t *dstate, uint_t nkeys, dvar->dtdv_next = free; } while (dtrace_casptr(&dcpu->dtdsc_dirty, free, dvar) != free); - return (dtrace_dynvar(dstate, nkeys, key, dsize, op, mstate, vstate)); + goto top; } /*ARGSUSED*/ -- 2.45.2