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

Fix hanging matlab errors #166

Open
DavidRitzwoller opened this issue Oct 18, 2018 · 28 comments
Open

Fix hanging matlab errors #166

DavidRitzwoller opened this issue Oct 18, 2018 · 28 comments
Assignees

Comments

@DavidRitzwoller
Copy link
Contributor

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 DavidRitzwoller self-assigned this Oct 18, 2018
DavidRitzwoller added a commit that referenced this issue Oct 19, 2018
@DavidRitzwoller
Copy link
Contributor Author

No work on this in past two weeks

1 similar comment
@DavidRitzwoller
Copy link
Contributor Author

No work on this in past two weeks

@z-y-huang
Copy link

z-y-huang commented Nov 28, 2018

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
Copy link
Contributor Author

DavidRitzwoller commented Dec 18, 2018

no progress in past 2 weeks

6 similar comments
@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@mengsongouyang
Copy link

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

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

3 similar comments
@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past two weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

4 similar comments
@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

no progress in past 2 weeks

@DavidRitzwoller
Copy link
Contributor Author

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

@mengsongouyang
Copy link

No progress in past two weeks.

@zkashner
Copy link

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

@Houdanait
Copy link

Yes ! @zkashner

@Houdanait
Copy link

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

@Houdanait
Copy link

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
Copy link
Contributor

Branch updated from master in 225baef

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

6 participants