gslab-econ / gslab_python

Python tools for GSLab
MIT License
13 stars 11 forks source link

Fix hanging matlab errors #166

Open DavidRitzwoller opened 6 years ago

DavidRitzwoller commented 6 years ago

This is a follow up to here.

When working here, I noticed that build_matlab hangs when an error is encountered, rather than exiting and returning an error message.

@z-y-huang believes he fixed this bug in a separate project. I will start by testing his solution. He notes

See` Stack Overflow thread here about exceptions. You'll have to adjust based on your logging options, I think.

DavidRitzwoller commented 5 years ago

No work on this in past two weeks

DavidRitzwoller commented 5 years ago

No work on this in past two weeks

z-y-huang commented 5 years ago
process = subprocess.Popen(command.split(), 
                           stdout = subprocess.PIPE, 
                           stderr = subprocess.PIPE, 
                           shell = self.shell)
stdout, stderr = process.communicate()
matlab -nosplash -nodesktop -r run(\'%s\') -logfile %s'

First %s is program, second %s is log.

EDIT: Realized I also have a try/catch in my .m script. If you want the try/catch on the command line, use the following.

matlab -nosplash -nodesktop -r "try run(\'%s\'); catch e, fprintf(getReport(e)); end; quit" -logfile %s'
DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

mengsongouyang commented 5 years ago

Seems that the cross-polar project encounters a similar issue. Details in this post and the followings.

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past 2 weeks

DavidRitzwoller commented 5 years ago

no progress in past two weeks

DavidRitzwoller commented 4 years ago

no progress in past 2 weeks

DavidRitzwoller commented 4 years ago

no progress in past 2 weeks

DavidRitzwoller commented 4 years ago

no progress in past 2 weeks

DavidRitzwoller commented 4 years ago

no progress in past 2 weeks

DavidRitzwoller commented 4 years ago

no progress in past 2 weeks

DavidRitzwoller commented 4 years ago

@mengsongouyang. I'm going to pass you this task for the time being

mengsongouyang commented 4 years ago

No progress in past two weeks.

zkashner commented 4 years ago

@Houdanait if you have some time and are willing to explore this issue that would be awesome!

Houdanait commented 4 years ago

Yes ! @zkashner

Houdanait commented 3 years ago

@zkashner @yu-jia-wang, linking this with fix_latex_error and i might have a suggestion for this

Houdanait commented 3 years ago

Hi @yu-jia-wang, thanks for offering to check that the suggested change for Latex indeed works for Matlab as well. I have tried faking an error on a .m file and it worked. It would be great if we could actually test this on a repo with an existing hanging Matlab issue to make sure this work. We have just merged it to gslab repo so you should be able to check it out. There is now a time out option in ProgramDirective.py (l.115 here ) which should lead to exit when an app is hanging.

Let me know if this worked!! Thanks!

liaochris commented 1 month ago

Branch updated from master in 225baef65b93de61cd7034420c71fdabebf7a7a4