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

Completion of error handling #43

Closed
elfring opened this issue Nov 5, 2012 · 2 comments
Closed

Completion of error handling #43

elfring opened this issue Nov 5, 2012 · 2 comments

Comments

@elfring
Copy link

elfring commented Nov 5, 2012

I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.

Would you like to add more error handling for return values from functions like the following?

@stedolan
Copy link
Contributor

Hrm. jq does not handle memory exhaustion gracefully. There's nothing much it can do in such a situation, so possibly the best approach would be to replace calls to malloc/realloc with calls to a wrapper that prints a message and abort()s if allocation fails.

Are there other errors that jq doesn't handle properly?

@tischwa
Copy link

tischwa commented Dec 16, 2012

1st let me say, that jq is really great!

2nd, regarding the malloc issue, I would go with the wrapper, print some message to stderr and be done with it.

I ran into this already on a 4GB machine while processing a big json file. Tracking down the SEGV finally showed, that malloc returned a NULL pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants