Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object was probably modified after being freed #614

Closed
vitillo opened this issue Oct 8, 2014 · 4 comments
Closed

object was probably modified after being freed #614

vitillo opened this issue Oct 8, 2014 · 4 comments

Comments

@vitillo
Copy link

vitillo commented Oct 8, 2014

The snippet below is causing some random crashes with pymc 2.3.3 and 2.3.4:

python(33611,0x7fff717e6310) malloc: *** error for object 0x10c7d83a8: incorrect checksum for freed object - object was probably modified after being freed.
import numpy as np
import pymc as pm

data = np.array([8,4,6,3,1,4,4,6,4,2,2,1,1,4,3,3,2,6,3,4])
prior = pm.distributions.Beta("prior", alpha=3.5, beta=6.5)
stories = pm.distributions.Binomial("stories", n=10, p=prior, value=data, observed=True)

model = pm.Model([prior, stories])
mcmc = pm.MCMC(model)
mcmc.sample(40000, 10000, 1)
@fonnesbeck
Copy link
Member

I get the same with this notebook. No idea why. This one also uses the binomial model--perhaps there's a problem in that likelihood?

python(73992,0x7fff77888300) malloc: *** error for object 0x1098bd3c8: incorrect checksum for freed    object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

@fonnesbeck
Copy link
Member

I think the issue may be when the size of the binomial probability is not the same size as the data; in other words, when you use a scalar value. Making the parameter vector-valued seems to work around the bug. Must be a problem with the binomial likelihood.

fonnesbeck pushed a commit that referenced this issue Dec 20, 2014
@fonnesbeck
Copy link
Member

Please test the current 2.3 branch for a fix.

@twiecki twiecki added the v.2 label Feb 12, 2015
@twiecki
Copy link
Member

twiecki commented Feb 12, 2015

Probably works.

@twiecki twiecki closed this as completed Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants