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 #99

Closed
elfring opened this issue Sep 16, 2015 · 22 comments
Closed

Completion of error handling #99

elfring opened this issue Sep 16, 2015 · 22 comments
Labels

Comments

@elfring
Copy link

elfring commented Sep 16, 2015

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

@zdenop
Copy link
Contributor

zdenop commented Oct 13, 2018

Feel free to send PR...

@zdenop zdenop closed this as completed Oct 13, 2018
@elfring
Copy link
Author

elfring commented Oct 13, 2018

How do you think about to improve static source code analysis also for this software?

@zdenop
Copy link
Contributor

zdenop commented Oct 13, 2018

As you can see on README we use https://lgtm.com and coverity.com for code analysis.

@elfring
Copy link
Author

elfring commented Oct 13, 2018

Do these analysis tools point also the open issues out which I reported?

@stweil
Copy link
Contributor

stweil commented Oct 13, 2018

Coverity Scan reports some of those errors – unless they are already fixed. :-)
LGTM does not report the mentioned errors.

  • fseek ⇒ InputBuffer constructor, still buggy, not reported
  • malloc ⇒ SquishedDawg::build_node_map, was fixed some time ago
  • pthread_mutex_init ⇒ CCUtilMutex constructor, still buggy, not reported

Which static code analyser would you suggest to detect such errors?

@stweil stweil added the bug label Oct 13, 2018
@elfring
Copy link
Author

elfring commented Oct 13, 2018

I suggest to avoid ignorance of return values a bit more.
Would you like to detect every error situation as early as possible?


@stweil
Copy link
Contributor

stweil commented Oct 13, 2018

Sure, but my question was more specific. There is currently a lot of code which does not follow those principles, and more such code could get merged. Without a lot of man power, it is impossible to detect all missing checks of return values. So it is important to have tools which report violations. Do you know such tools?

@stweil
Copy link
Contributor

stweil commented Oct 13, 2018

As there are still some of the mentioned errors not fixed, I reopen this issue.

@stweil stweil reopened this Oct 13, 2018
@elfring
Copy link
Author

elfring commented Oct 13, 2018

I know a few higher level development tools which can help here.
Which ones would you dare to integrate into the software build process?

@stweil
Copy link
Contributor

stweil commented Oct 13, 2018

Just tell us the names of those tools, then we can decide.

@elfring
Copy link
Author

elfring commented Oct 13, 2018

Examples:

@stweil
Copy link
Contributor

stweil commented Oct 13, 2018

Thank you. I know and used the last two. Coccinelle itself does not find problems – it needs scripts written to do this. Cppcheck did not report missing handling of return values last time when I used it (well, that was some years ago).

@elfring
Copy link
Author

elfring commented Oct 13, 2018

Coccinelle itself does not find problems

This software tool can also find and adjust various questionable source code. It supports the C programming language better than C++ so far.

(well, that was some years ago)

I suggest to try Cppcheck out again to see if this analysis tool was improved in desired ways in the meantime.


Would you like to get help from any additional development tools?

@zdenop
Copy link
Contributor

zdenop commented Oct 24, 2018

@elfring : Will you provide output of your code analyze?
Maybe as new issue (grouped by type) so we can close it with commit? Patches are welcomed too ;-)

@elfring
Copy link
Author

elfring commented Oct 24, 2018

Will the mentioned tools become relevant for your software development process?

@zdenop
Copy link
Contributor

zdenop commented Oct 25, 2018

@elfring : I am sorry, but I did not get point of your question. Primary build system are autotools. Of course I am interested also in support cmake ...

@elfring
Copy link
Author

elfring commented Oct 25, 2018

Did your interest increase for the application of the tool “AspectC++” (together with related information sources for example)?

@zdenop
Copy link
Contributor

zdenop commented Oct 26, 2018

What does it mean practically?
There is basically not intention to extend dependency to another libraries.
Also the main development is done in google, so unless the some approaches are accepted by Ray, it does not make sense to implement it by community...

@stweil
Copy link
Contributor

stweil commented Oct 26, 2018

@elfring, I don't think that Tesseract will switch from C++ to Aspect C++ as that is currently not a common standard. As far as I could see Aspect C++ cannot be used to check the existing code. Nor can Coccinelle because it only supports C but not C++. So only cppcheck remains which can be used in addition to Coverity Scan and LGTM.

The problems with malloc will be addressed by replacing that code with modern C++ data types. See also the planning page in the wiki.

If you have fixes for ignored return values, they are welcome.

@elfring
Copy link
Author

elfring commented Oct 26, 2018

As far as I could see Aspect C++ cannot be used to check the existing code.

I suggest to take another look at the provided technology.
Which systematic development methods do you know for the handling of cross-cutting concerns?

Nor can Coccinelle because it only supports C but not C++.

This tool can be useful for limited source code analysis and corresponding transformations.
Would you like to help in any ways to improve the support for the C++ programming language here?

If you have fixes for ignored return values, …

I would prefer the application of available known methodologies.

@zdenop
Copy link
Contributor

zdenop commented Oct 15, 2019

@elfring: any help with improving code is welcomed. Pointing to new tools/methodology is interesting but... we have limited sources and most of active contributors will probably still continue to use what they are familiar.
So if there is problem with code, you can fix, please create new issue/send PR.

@zdenop zdenop closed this as completed Oct 15, 2019
@elfring
Copy link
Author

elfring commented Oct 15, 2019

It is probably obvious that I am trying for a while to get more software developers familiar also with other helpful methodologies.
🔮 I am curious if their popularity will grow.

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

No branches or pull requests

3 participants