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

moose.Function field expr seems to be sensitive to ordering of x0, x1, ... #163

Closed
subhacom opened this issue Mar 28, 2015 · 3 comments
Closed
Assignees

Comments

@subhacom
Copy link
Collaborator

Parser is working fine. Following expressions were parsed and added to moose.Function's expr field.

  1. 0.00333333_x0^4/(x0^4 + 0.0007^4)-0.0166667_x1
  2. 0.000041667_x0^4/(x0^4+0.00003^4)-0.08333_x1
  3. 0.166666667_0.00001_x0^4/(x0^4+0.00003^4)-0.0083333*x1

These works fine. However follwing expression causes seg-fault.

  • 0.166666667_x1_x0^4/(x0^4+0.00003^4)-0.0083333*x2

This is parsed by muparser. When changing the order of x0 and x1 in expression, it works well.

  • 0.166666667_x0_x1^4/(x0^4+0.00003^4)-0.0083333*x2

In short, while parsing left to right, if x0, x1, x2 etc appears in ascending oder then it works fine, else it causes seg-fault.

Following is relevant backtrack.

#0  0x00007ffff5378b0a in mu::ParserBase::ParseCmdCodeBulk (this=0x167d518, nOffset=0, nThreadID=0) at /public/dilawars/moose3.0.1/external/muparser/muParserBase.cpp:1093
#1  0x00007ffff53782bc in mu::ParserBase::ParseCmdCode (this=0x167d518) at /public/dilawars/moose3.0.1/external/muparser/muParserBase.cpp:1010
#2  0x00007ffff537b1f7 in mu::ParserBase::ParseString (this=0x167d518) at /public/dilawars/moose3.0.1/external/muparser/muParserBase.cpp:1439
#3  0x00007ffff537bbec in mu::ParserBase::Eval (this=0x167d518) at /public/dilawars/moose3.0.1/external/muparser/muParserBase.cpp:1729
#4  0x00007ffff518cffb in Function::setExpr (this=0x167d488, eref=..., expr=...) at /public/dilawars/moose3.0.1/builtins/Function.cpp:505
#5  0x00007ffff5193a9f in EpFunc1<Function, std::string>::op (this=0xa85cf0, e=..., arg=...) at /public/dilawars/moose3.0.1/basecode/EpFunc.h:72
#6  0x00007ffff5083ed7 in SetGet1<std::string>::set (dest=..., field=..., arg=...) at /public/dilawars/moose3.0.1/pymoose/../basecode/SetGet.h:172
#7  0x00007ffff5055d82 in Field<std::string>::set (dest=..., field=..., arg=...) at /public/dilawars/moose3.0.1/pymoose/../basecode/SetGet.h:249
#8  0x00007ffff50493bf in moose_ObjId_setattro (self=0x7fffed5c8e90, attr='expr', value='0.166666667*x1*x0^4/(x0^4+0.00003^4)-0.0083333*x2')
    at /public/dilawars/moose3.0.1/pymoose/melement.cpp:732
#9  0x00000000004a945b in PyObject_SetAttr (v=v@entry=<moose.Function at remote 0x7fffed5c8e90>, name='expr', value=value@entry='0.166666667*x1*x0^4/(x0^4+0.00003^4)-0.0083333*x2')
    at ../Objects/object.c:1247
```~~~




Reported by: dilawar
@subhacom
Copy link
Collaborator Author

'*' is formatted out in the bug-report.

The seg-fault causing expression should read as following

0.166666667*x1*x0^4/(x0^4+0.00003^4)-0.0083333*x2

Original comment by: dilawar

@subhacom
Copy link
Collaborator Author

  • labels: pymoose --> builtins
  • status: open --> closed-fixed

Original comment by: subhacom

@subhacom
Copy link
Collaborator Author

Fixed. Please check and repoen if issue persists.

Original comment by: subhacom

@subhacom subhacom self-assigned this Aug 22, 2015
dilawar pushed a commit that referenced this issue Jan 5, 2017
b8a8b6d hotfix from branch issue167.
8a6346d Merge branch 'chamcham' of github.com:BhallaLab/moose-core into chamcham
7d4cf8b Changes from master branch. Test on macosx as well as linux. Quantified import to avoid self-recursion. Ran autopep8 on files.
de3d964 Changes from master branch. Test on macosx as well as linux.
9156b89 Fixes for issue #164. Also hotfix for branch chamcham.
e821a9d Fixes due to API change in SBML support.
bb8c850 Fixes to #164.
806605d Fixed the prog -> position. Hotfix for release.
2cba78a Merge branch '3.1.1' of github.com:BhallaLab/moose-core into 3.1.1
82c3024 Fixes to #163.
598433e Related to #204.
48c5535 formating
0cec9d2 spell correction
6d66bc1 function to add and delete solvers to Chemical solver
eefafa9 filename changed
c9208a9 added mooseWriteKkit, moosedeleteChemSolver,mooseaddChemSolver and cleaned up write/ReadSBML as mooseWriteSBML, mooseReadSBML for consistency in moose.py
d462c7e Removed saveModel which doesn't exists anymore
8c5af82 Fixes to issue 129 (#162)
eee822b Fixes to recent build failure on travis.
bdc1436 Alternative implementation of moose.Streamer  (#161)
94444f9 Notify user if python-libsbml is not found.
db41ad5 Merge pull request #157 from dilawar/master
c11cb03 Added recently added C++ files in synapses folder.
5868a2f Added libsbml test. Runs only when python2 is used.
716305c Fixes to boost build failure on travis.
4355f02 Various fixes to libsbml related part.
acf46ff Fixes to lintian errors [ skip ci ]
75c8f34 Similar fixes to writeSBML file.
54f127e Cleanup and fixed pylint error     power( ) -> pow( )     Instead of try catch, check for libsbml at the begining and warn user.
d24b389 Fixes to test_sbml scripts. The basic functions are working.
0430732 BhallaLab/moose-core#156 .  Created writeSBML and readBSML functions in moose.py
c56b347 BhallaLab/moose-core#156 . Removed deprecated sbml functions.
0e09e0b VERSION is a temp file.
29190b6 Merge branch 'master' of github.com:BhallaLab/moose-core
2c8156a Changed the environement variable which cmake uses to search for GSL.
ee4ae8a Merge branch 'master' of github.com:dilawar/moose-core
da93767 Fixes to recent travis failure. All files are now compile with python2 and python3.
0ec89d2 Added test to make sure each python script compiles with python2 as well.
98d6c31 Merge branch 'master' of github.com:BhallaLab/moose-core
3bc4e6c Update .travis.yml
c1f4c84 Adding pre-commit hooks. #189 .
8847b26 Update .travis.yml
6b2fa39 Disabling libsbml on travis. It does not build with clang.
12a72da python-libsbml doesn't build with clang. Allowing failure for clang compiler on travis (test commit).
be83da8 Fixed import statement in genesis. Related to python3 import.
ac29a99 Enable QUIET_MODE for Release. No information is printed onto console when moosemodule is loaded.
6e871fa Changes : 0. Mixed tabs and spaces are turned into 4 spaces. 1. Python code is python3 compatible. 2. Removed libmumbl from source tree. Not in active development.
5916f7f Fixed a typo in travis.
246bc58 Merge commit '04170cb4d5a69b48041a12229181d7e4d2bf5afd'
0390d6a Updated.
993f8f7 Fixed, python2 incompatible print function use.
030aea3 Some updates to fix static hdf5 libraries.
4255ecf This project build pymoose, gui and its examples. TODO: ctest must check each example as well.
c92e761 Builds whole moose project.
d40fbe6 Added some sanity tests for both moose and moogli.
29fd242 Even when format is set, stream!
f96fe68 One test failing on nargis (centos-6). Try it locally.
eb61ab7 ctest script setups its environment. No need to have set environment for each tests.
1b43dc7 This fixes python3 linking problem on openSUSE-Leap. Not sure about travis.
ec15bd2 Linking error with boost-filesystem.
0847eb2 This might or might now work with python3. Taking a shot.
e7a87b8 Some changes in Makefile. Protected some boost related code with USE_BOOST macros.

git-subtree-dir: moose-core
git-subtree-split: b8a8b6d150f89339c6d63971268f0a07546a9ebc
dilawar pushed a commit that referenced this issue Jan 5, 2017
7c9fe23 Fixes to issue #167. (#168)
3f077c1 Resolved merge conflict with Table.h
9b175c8 Major bugfix for Table and derived class Streamer, to fix error introduced by duplicating the 'name' field which is already defined for Neutral. Minor bugfix for melement.cpp
f0d4c02 Update INSTALL.md
2737220 Fixes to issue165 (#166)
a934676 Update .travis.yml
601d06a Fixes to PYTHON3 build failure on travis.
9d9d925 Tested locally for linux. The scripts seems to be fine on openSUSE-42.2
93bbd4f By default travis pick up /opt/bin/python when `which python` is used. Do not use this construct in script. Moved travis related scripts to a hidden folder .travis.
c0d3871 If python3 exists (installed on travis), then check for the compatibility otherwise don't.
65a85da Almost there. Calling script from top of directory.
0db2016 Make trusty default build environment. python3-matplotlib is not available by default.
d8c1c6a setuid to root for linux script.
4c90f04 Some more fixes in travis script.
429420b Cleanup, osx related travis macros.
e287118 Disable OSX build here on master brach. Created issue #165 to build and test for MacOSX.
87aeb1a Travis build scripts for macosx and linux are in ./scripts folder.
24643bc Some more fixes to travis build failure on OSX.
a05826e Fixing brew taps and build dependencies.
ea0ede1 This commit is just to test the OSX build on travis. Unfortunately there is no way to test it offline.
1b6f42a Fixes to travis scripts.
b0baaab Excluded linux and osx build from config file.
626fd30 Testing with OsX support on travis. xcode-8.1. Most likely to break
ab933ad Fixes to recent travis build failure. make all python files python3 compatible in addition to #164.
72afc02 Enabled macosx build on travis. Though allowing failure for now.
bedb51e Fixes for issue #164. Also hotfix for branch chamcham.
e821a9d Fixes due to API change in SBML support.
bb8c850 Fixes to #164.
806605d Fixed the prog -> position. Hotfix for release.
2cba78a Merge branch '3.1.1' of github.com:BhallaLab/moose-core into 3.1.1
82c3024 Fixes to #163.
598433e Related to #204.
48c5535 formating
0cec9d2 spell correction
6d66bc1 function to add and delete solvers to Chemical solver
eefafa9 filename changed
c9208a9 added mooseWriteKkit, moosedeleteChemSolver,mooseaddChemSolver and cleaned up write/ReadSBML as mooseWriteSBML, mooseReadSBML for consistency in moose.py
d462c7e Removed saveModel which doesn't exists anymore
8c5af82 Fixes to issue 129 (#162)
eee822b Fixes to recent build failure on travis.
bdc1436 Alternative implementation of moose.Streamer  (#161)
94444f9 Notify user if python-libsbml is not found.
db41ad5 Merge pull request #157 from dilawar/master
c11cb03 Added recently added C++ files in synapses folder.
5868a2f Added libsbml test. Runs only when python2 is used.
716305c Fixes to boost build failure on travis.
4355f02 Various fixes to libsbml related part.
acf46ff Fixes to lintian errors [ skip ci ]
75c8f34 Similar fixes to writeSBML file.
54f127e Cleanup and fixed pylint error     power( ) -> pow( )     Instead of try catch, check for libsbml at the begining and warn user.
d24b389 Fixes to test_sbml scripts. The basic functions are working.
0430732 BhallaLab/moose-core#156 .  Created writeSBML and readBSML functions in moose.py
c56b347 BhallaLab/moose-core#156 . Removed deprecated sbml functions.
0e09e0b VERSION is a temp file.
29190b6 Merge branch 'master' of github.com:BhallaLab/moose-core
2c8156a Changed the environement variable which cmake uses to search for GSL.
ee4ae8a Merge branch 'master' of github.com:dilawar/moose-core
da93767 Fixes to recent travis failure. All files are now compile with python2 and python3.
0ec89d2 Added test to make sure each python script compiles with python2 as well.
98d6c31 Merge branch 'master' of github.com:BhallaLab/moose-core
3bc4e6c Update .travis.yml
c1f4c84 Adding pre-commit hooks. #189 .
8847b26 Update .travis.yml
6b2fa39 Disabling libsbml on travis. It does not build with clang.
12a72da python-libsbml doesn't build with clang. Allowing failure for clang compiler on travis (test commit).
be83da8 Fixed import statement in genesis. Related to python3 import.
ac29a99 Enable QUIET_MODE for Release. No information is printed onto console when moosemodule is loaded.
6e871fa Changes : 0. Mixed tabs and spaces are turned into 4 spaces. 1. Python code is python3 compatible. 2. Removed libmumbl from source tree. Not in active development.
5916f7f Fixed a typo in travis.
246bc58 Merge commit '04170cb4d5a69b48041a12229181d7e4d2bf5afd'
0390d6a Updated.
993f8f7 Fixed, python2 incompatible print function use.
030aea3 Some updates to fix static hdf5 libraries.
4255ecf This project build pymoose, gui and its examples. TODO: ctest must check each example as well.
c92e761 Builds whole moose project.
d40fbe6 Added some sanity tests for both moose and moogli.
29fd242 Even when format is set, stream!
f96fe68 One test failing on nargis (centos-6). Try it locally.
eb61ab7 ctest script setups its environment. No need to have set environment for each tests.
1b43dc7 This fixes python3 linking problem on openSUSE-Leap. Not sure about travis.
ec15bd2 Linking error with boost-filesystem.
0847eb2 This might or might now work with python3. Taking a shot.
e7a87b8 Some changes in Makefile. Protected some boost related code with USE_BOOST macros.

git-subtree-dir: moose-core
git-subtree-split: 7c9fe237abfcd49b45a3c843567f2c2ddcd67d65
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

1 participant