-
Notifications
You must be signed in to change notification settings - Fork 117
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 #9
Comments
actually EDEADLK happens only if specific attributes are passed to PTHREAD_MUTEX_INIT (not our case) |
On Thursday-201508-27 14:30, Andrea Guzzo wrote:
You are assuming here a 100% compliant (nothing missing, nothing added,
|
but are you really suggesting to always check the return value of pthread_mutex_lock() ? ... because this sounds quite unreasonable to me. Or are we talking here about shutting up some specific static analyzer complaining about it ? Because in this case , really, the only problem could be memory corruption, and it's a waste of time to protect from that (since it shouldn't happen and that's it) |
I would prefer that strict error detection will become less optional in important software. Do you find information sources like the following useful?
|
On Thursday-201508-27 14:46, Andrea Guzzo wrote:
Are you religiously opposed to checking return values? |
no ... and you can definitely notice it from the code. so, apart from a blind approach like "everything must be checked" (even if you don't know what we are talking about) , is there any real reason here? do you always check for the return value from pthread_mutex_lock ? ... if yes (and it's not a recursive lock or a try_lock) why? (and maybe point to some example) |
I'm not saying one should check for pthread_mutex_lock() specifically. I'm saying that if something can fail, one should check for it. Arguing "but it cannot fail in this particular case" is in my opinion There is this special biologist word we use for 'stable'. It is 'dead'. -- |
so are you talking "generically" ? ... do you think I don't take into account that things can fail? :) adding the check here means adding it everytime you call pthread_mutex_lock() ... so well ... what are we talking about? |
so are you talking "generically" ? ... do you think I don' take into
Again, you are reading into my messages something I am not saying. There is this special biologist word we use for 'stable'. It is 'dead'. -- |
I'm just trying to understand what should be changed here. |
Can strict error detection become tedious in procedural programming languages like C? There are some software development methodologies evolving which could help you here. |
my guess is that since that mutex is recursive his static analyzer complains about not checking the return value of pthread_mutex_lock() ... but in this case the only thing would be distinguishing between a memory corruption (bad ... your program should crash!) and a EDEADLK reported (which is the normal condition here) ... so if we want to change the code to shut up the static analyzer, just provide a patch for it or say which satic analyzer is complaining so I can test myself (instead of going ahead with riddles) |
elfring, can you point me out to some serious big software which actually checks all calls to the pthread interface (apart for specific reasons) ? |
I hope that open issues around a weakness 252 can also be reduced in this software library for basic data structures. |
lol :D .... now I know you are talking bullshit :)
|
I hope that more complete API exception handling is not rocket science. ;-)
I do understand my source code analysis well.
I'm sorry when I hurt your software development feelings a bit. |
lol! you made my day ;) please attach the output from the analyzer or point out some specific problem. |
I guess that the concrete source code analysis tool does not really matter as long as it seems that you take corresponding suggestions personally. |
I just didn't get anything concrete about some sort of riddle game and reference to guidelines and other not-relevant stuff. |
I suggest to follow good software development practices a bit more. |
thanks, I'll follow your suggestion :) |
A few update candidates are still left over:
|
Does a tool like "Coverity Scan" show any open issues which we discussed here? |
not anymore from what I saw yesterday after 6c07aef |
Will it be interesting then to clarify the issues I mentioned before? |
__attribute__((warn_unused_result))
"?The text was updated successfully, but these errors were encountered: