13
$\begingroup$

Bug introduced in 10.0.0 and fixed in 10.0.1


In version 10.0.0 under Windows I am observing the following behavior:

Do[Module[{foo}, foo[x_] := 1; foo[0]], {10}] Names["foo$*"] 
{"foo$593", "foo$594", "foo$595", "foo$596", "foo$597", "foo$598", "foo$599", "foo$600", "foo$601", "foo$602"} 

I am aware that in past versions Module Symbols were sometimes not garbage collected but never in such a simple case as this as far as I know. The code above returns {} in version 7, as one would expect.

Do I have something wrong with my configuration or is this behavior reproducible?
Assuming the latter is there an explanation for this other than a bug?

$\endgroup$
3
  • 1
    $\begingroup$ I get the same behavior on OS X 10.9 with Mathematica 10.0.0. Using Mathematica 9.0.1.0 I get an empty list. $\endgroup$ Commented Aug 28, 2014 at 16:03
  • 8
    $\begingroup$ That's a known bug. $\endgroup$ Commented Aug 28, 2014 at 16:21
  • 5
    $\begingroup$ The interesting question is if 10.0.0 is more buggy than 9.0.0 was. I rarely use 10.0.0. Both kernel and FrontEnd are inferior to 9.0.1 (where comparable). Of course there are some exciting new features in 10, but I just wait for 10.0.1 $\endgroup$ Commented Aug 28, 2014 at 17:26

1 Answer 1

5
$\begingroup$

This bug is fixed in V10.0.1.0 but the behavior is different based on evaluation sequence. If both expressions are in a single cell you get the expected empty list:

Do[Module[{foo}, foo[x_] := 1; foo[0]], {100}]; Names["foo$*"] 
{} 

If they are evaluated one at a time in different cells you get a single foo$ symbol regardless of how many times the Do loop is evaluated:

Do[Module[{foo}, foo[x_] := 1; foo[0]], {1000}] 

Then evaluate

Names["foo$*"] 

you get

{"foo$"} 
$\endgroup$
9
  • $\begingroup$ I don't have 10.0.1 or Mathematica with me now, but what you're describing doesn't seem unexpected. I think if you re-evaluate the top cell a second time, you should see {"foo$"} in the output. $\endgroup$ Commented Sep 17, 2014 at 6:13
  • $\begingroup$ @rm-rf. I don't see {foo$} no matter how many times I evaluate the first cell. $\endgroup$ Commented Sep 17, 2014 at 8:07
  • $\begingroup$ In MMa 8.0.4 in the both cases I get empty list {}. $\endgroup$ Commented Oct 21, 2014 at 4:13
  • 1
    $\begingroup$ @AlexeyPopkov. Yeah, that's what you should get but somehow in 10.0.1 on Windows I don't. But on Linux it works fine. $\endgroup$ Commented Oct 21, 2014 at 4:27
  • $\begingroup$ Have you reported it? $\endgroup$ Commented Oct 21, 2014 at 4:31

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.