segmentation fault (core dumped)

Bug #1652529 reported by Amiya Prakash Das
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Invalid
Undecided
Unassigned

Bug Description

Hi I am trying to run this code, which is an example given in the package. But every time i try to execute this file, i get segmentation fault error. I am using Ubuntu 16.04 LTS and Yade 2016.06a

#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
To run this script you need to have all 10 text files from https://yade-dem.org/wiki/CapillaryTriaxialTest
in the same folder as you run this script in console!

This script shows how to use Law2_ScGeom_CapillaryPhys_Capillarity. The user can switch between hertz and
linear model by setting "model_type"
"""

model_type = 1 #1=Hertz model with capillary forces, else linear model with capillary model

#some parameters:
shear_modulus = 1e5
poisson_ratio = 0.3
young_modulus = 2*shear_modulus*(1+poisson_ratio)
friction = 0.5
angle = atan(friction)
local_damping = 0.01
viscous_normal = 0.021
viscous_shear = 0.8*viscous_normal
lowercorner = Vector3(0,0,0)
uppercorner = Vector3(0.002,0.002,0.004)

#creating a material (FrictMat):
id_SphereMat=O.materials.append(FrictMat(young=young_modulus,poisson=poisson_ratio,density=2500,frictionAngle=angle))
SphereMat=O.materials[id_SphereMat]

#generate particles:
sp=pack.SpherePack()
sp.makeCloud(lowercorner,uppercorner,.0002,rRelFuzz=.3)
O.bodies.append([sphere(c,r,material=SphereMat) for c,r in sp])

#generate boundary:
O.bodies.append(geom.facetBox(uppercorner/2,uppercorner/2,wire=True,fixed=True,material=SphereMat))

#define engines:
if model_type == 1:#hertz model with capillary forces
 O.engines=[
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
  InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
   [Ip2_FrictMat_FrictMat_MindlinCapillaryPhys(label='ContactModel')],#for hertz model only
   [Law2_ScGeom_MindlinPhys_Mindlin()]#for hertz model only
  ),
  Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=10000),#for hertz model only
  NewtonIntegrator(damping=local_damping,gravity=(0,0,-9.81)),
 ]
 ContactModel.betan=viscous_normal
 ContactModel.betas=viscous_shear
 ContactModel.useDamping=True
else:
 O.engines=[
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
  InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
   [Ip2_FrictMat_FrictMat_CapillaryPhys()], #for linear model only
   [Law2_ScGeom_FrictPhys_CundallStrack()], #for linear model only
  ),
  Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=10000),#for linear model only
  NewtonIntegrator(damping=local_damping,gravity=(0,0,-9.81)),
 ]

#set time step and run simulation:
O.dt=0.5*PWaveTimeStep()

from yade import qt
qt.View()
print('Press PLAY button')
#O.run(10000,True)

looking forward to hear soon..!!

Cheers
Amiya

Revision history for this message
Jan Stránský (honzik) wrote : Re: [Yade-dev] [Bug 1652529] [NEW] segmentation fault (core dumped)

Hi Amiya,
thanks for the report. We will try to find the problem, but first we need a
MWE, a mininal WORKING script. The one you provided ends with SyntaxError
because of the first "else" statement.
You can attach files to bug reports, so if you attached the script directly
as a file, it would be perfect
Thanks
Jan

Revision history for this message
Amiya Prakash Das (amiya0703) wrote :

Hi Jan

Thanks for coming back on this problem. The code is given as an example. I have attached the code along this message.

Thanks

Cheers
Amiya

Revision history for this message
Amiya Prakash Das (amiya0703) wrote :

Hi Jan

Please ignore the previous code. Please find the attached code.

Thanks
Amiya

Revision history for this message
Jérôme Duriez (jduriez) wrote :

Hello,

I can not reproduce the bug: I've tried this example [*] (since it is a file from "examples" folder, you may just refer directly to it, so that we're sure it has not been altered) with two recent versions (2016-10-31.git-1b22b1a and the last one 2016-12-20.git-54c46f3) and did not get any crash.

I'm marking thus the bug for now as "invalid", before any new information. You may give us copy of the whole YADE output when you launch this script, for instance.

Jerome

[*] https://github.com/yade/trunk/blob/master/examples/capillaryLaplaceYoung/CapillaryPhys-example.py

Changed in yade:
status: New → Invalid
Revision history for this message
Jérôme Duriez (jduriez) wrote :

Note your issue may also be related with the capillary files you're using. The capillary source code has been updated together with capillary files end of September, 2016.
You have to use compatible yade version and capillary files.

Revision history for this message
Amiya Prakash Das (amiya0703) wrote :

Thanks for coming back on the issue, i am using the latest capillary files and Yade version-2016.06a. And moreover, i have directly taken the script from the example folder in the github. Unfortunately it still doesn't work with the same error. Can you tell me the version on which the script and capillary files are compatible.

Thanks

Cheers
Amiya

Revision history for this message
Jérôme Duriez (jduriez) wrote :

Indeed, with the latest capillary files, you have to use some yade version younger than end of last September (which is not your case now). You could either directly pull the last trunk (see "working with source code" in [*]), or use packaged "yadedaily" which should most probably work as well.

If you're not in a rush, another stable release (i.e. the child of 2016.06a) should be published soon (do not know exactly when). This one would also work

[*] https://yade-dem.org/doc/installation.html

Revision history for this message
Amiya Prakash Das (amiya0703) wrote :

Hi

I tried to run the script on the yadedaily, but still getting the same error.

amiya@Dash:~/Yade/capillary$ yadedaily Capillary.py
Welcome to Yade 2016.06a-24-0557faf~xenial
TCP python prompt on localhost:9000, auth cookie `escuyk'
XMLRPC info provider on http://localhost:21000
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
XmbTextListToTextProperty result code -2
Running script Capillary.py
Segmentation fault (core dumped)

Revision history for this message
Jérôme Duriez (jduriez) wrote :

It turns out yadedaily is older than I thought.. I still confirm this is just yade-version related, the "Welcome to Yade 2016.06a-24" suggesting that this yadedaily is the same as 2016.06a you initially considered..

I do not have a clear understanding of the update frequence of yadedaily (and wonder if it is actually updated these days), but there is a simple test for you to check if your yade version is compatible with the most recent capillary files.

Just type in YADE terminal "CapillaryPhys().dict()" and check whether "nn11" and "nn33" are listed among the attributes of this class:
- Yes => your yade version is younger than last September, you're good to go with the recent capillary files
- No => your yade version is too old, you have to update (directly from github, I'd now recommend).
Or go back to previous capillary files version: they are still on https://www.yade-dem.org/wiki/Special:ListFiles as CapillaryJune2012.tar.gz (I do not recommend it though)

Revision history for this message
ozge (osge) wrote :

Hello Amiya,

Did you sort out your problem ?

Ozge

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.