Re: Ember: Weird Segfault Bug?

73 views
Skip to first unread message
Message has been deleted

Marina Kovaleva

unread,
Jul 8, 2022, 12:49:05 AM7/8/22
to Cantera Users' Group
Hello, 

I am receiving a segmentation violation in ember (please see below full output). 

It seems to specifically occur when using the San Diego mechanism on any ember configuraations or example codes. Curiously, the code will converge and run successfully for ~8 other mechanisms I have tried. The fault occurs for all configurations (please feel free to test on any of the tutorial configurations).

This is a little strange because this is one of the easiest to converge mechanisms I have and have never had issues running it in CHEMKIN or Cantera for the same conditions. Meanwhile, mechanisms that I have had issues converging can be tackled in ember. 

Please can it be possible to have your advice on this? I cannot begin to fathom how to debug this issue.  

Validation completed successfully.
DeprecationWarning: XML_Node::build:
The CTI and XML input file formats are deprecated and will be removed in
Cantera 3.0. Use 'cti2yaml.py' or 'ctml2yaml.py' to convert CTI or XML input
files to the YAML format. See https://cantera.org/tutorials/legacy2yaml.html
for more information.
Writing output file: src/solution/flamelet/strain_flame/prof000000.h5
t = 0.000020 (dt = 2.000e-05) [C: 101]

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

On Thursday, July 7, 2022 at 9:38:44 PM UTC-7 Marina Kovaleva wrote:
Hello, 

I am receiving a segmentation violation in ember (please see below full output). 

It seems to specifically occur when using the San Diego mechanism on any ember configuraations or example codes. Curiously, the code will converge and run successfully for ~8 other mechanisms I have tried. The fault occurs for all configurations (please feel free to test on any of the tutorial configurations).

This is a little strange because this is one of the easiest to converge mechanisms I have and have never had issues running it in CHEMKIN or Cantera for the same conditions. Meanwhile, mechanisms that I have had issues converging can be tackled in ember. 

Please can it be possible to have your advice on this? I cannot begin to fathom how to debug this issue.  

Validation completed successfully.
DeprecationWarning: XML_Node::build:
The CTI and XML input file formats are deprecated and will be removed in
Cantera 3.0. Use 'cti2yaml.py' or 'ctml2yaml.py' to convert CTI or XML input
files to the YAML format. See https://cantera.org/tutorials/legacy2yaml.html
for more information.
Writing output file: src/solution/flamelet/strain_flame/prof000000.h5
t = 0.000020 (dt = 2.000e-05) [C: 101]

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)


Message has been deleted
Message has been deleted

Marina Kovaleva

unread,
Jul 8, 2022, 1:20:53 AM7/8/22
to Cantera Users' Group
Update: Error fixed by manually deleting the comment lines starting with # - pressumably one of these contained an incompatible symbol. 

Ray Speth

unread,
Jul 8, 2022, 9:33:13 AM7/8/22
to Cantera Users' Group
Hi Marina,

I'm not sure I understand what you mean by "the comment lines starting with #". Can you provide a full example, including both the script to run Ember and the corresponding mechanism input file? Also, can you confirm the exact versions of Cantera and Ember that are being used? There's no case where a segfault should be the expected result of an input error -- this should always provide some sort of error message from Cantera or Ember.

Thanks,
Ray

Marina Kovaleva

unread,
Jul 11, 2022, 2:18:02 AM7/11/22
to Cantera Users' Group
Dear Ray, 

Apologies, I originally deleted the mechanism file from this comment thread because I thought I had already found a solution by cleaning the mech file and removing the comments. However, I was wrong and the problem persists. 

Please find attached the mechanism file in question - I am able to run this file in Cantera on virtually any flame configuration, however, the seg fault error occurs for all flame configurations and all possible scripts in ember. The mechanism is a reduced San Diego mech  - relatively standard and commonly used for the fuels being studied in this case. 

Cantera: 2.6.0 
Ember: dev ver 
IDE: Pycharm
Please find attached the full list of dependencies and their versions. 


Please see below an example script where this error occurs: 
conf = Config(Chemistry(mechanismFile = './mech/NH3_SD_full.cti' transportModel = 'Multi'),
Paths(outputDir='solution/temp'),
InitialCondition(fuel='NH3:0.3, H2:0.7',
equivalenceRatio=1.0),
StrainParameters(initial=100,
final=100),
TerminationCondition(tEnd=0.010))
conf.run()

It's strange, right? 

Kind regards,

Marina
NH3_SD_full.cti
requirements.txt
sd_nh3.yaml

Marina Kovaleva

unread,
Jul 17, 2022, 8:58:27 PM7/17/22
to Cantera Users' Group
To follow up on this, I'm not sure how to otherwise print this out from the debugging console, since the programme crashing doesnt give a trace back to the original line, however,  at least I can give some details where the segfault occurs through stepping into it with the debugger: 
the programme starts running the following script: 

if self.strainParameters.rates:
return concrete.multirun()
else:
return concrete.run()

stepping into the concrete.run() function there is a solver.step() function. 
stepping into the solver.step() function, takes you to the TimeSeriesWriter() class __call__ function. 

solver.step() (which calls the __call__ function) completes successfully for 2-100 iterations (iterature number before failure is not always predictable)

then flag = 1 is activated on one of the iterations: 

if flag:
filename = '{}/{}.{}'.format(self.options.paths.outputDir, name,
self.options.outputFiles.fileExtension)
if os.path.exists(filename):
    os.remove(filename)

def exists(path):
"""Test whether a path exists. Returns False for broken symbolic links"""
try:
   os.stat(path)
except (OSError, ValueError):
   return False
return True

this function returns true because the path is a real path, and since the file exists os.remove(filename) is activated to remove the file. The next function that is activated is to open the file with OutputFile class, (line 62 in the TimeSeriesWriter() class __call__ function), but I think since the filename was just deleted, the programme cannot find the file to open. 

with OutputFile(filename) as data:
Screenshot 2022-07-17 at 17.56.22.png

Marina Kovaleva

unread,
Jul 17, 2022, 8:59:51 PM7/17/22
to Cantera Users' Group
Just to note that in this case the flag = 1 was activated for the out.h5 file
Reply all
Reply to author
Forward
0 new messages