model.frame.default() with certain values of 'na.action' can change objects external to the function -- specifically, the "class" attribute of a multivariate time series object that appears in the 'formula' argument of model.frame().
class(EuStockMarkets) # "mts" "ts" "matrix"
mf <- model.frame(EuStockMarkets ~ 1, na.action=na.fail)
Line-by-line debugging of model.frame.default() indicates that the change in the attribute value occurs inside the call
data <- .External2(C_modelframe, formula, rownames, variables,
varnames, extras, extranames, subset, na.action)
So possibly there is some memory management issue within C_modelframe -- I haven't pursued it further.
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
 LC_COLLATE=English_United States.1252
 LC_CTYPE=English_United States.1252
 LC_MONETARY=English_United States.1252
 LC_TIME=English_United States.1252
attached base packages:
 stats graphics grDevices utils datasets methods base
J. R. M. Hosking
I can confirm this; I'll see if I can spot where it happens.
Fixed in R-devel and R-patched as of rev 68565. The problem was that subsetting could mess with the time series characteristics, so the ts attributes were removed; but in this case, no change had happened, so the removal was done to the original data.