* pthreads-win32 and Coverity
@ 2008-06-05 20:00 Robert Kindred
0 siblings, 0 replies; only message in thread
From: Robert Kindred @ 2008-06-05 20:00 UTC (permalink / raw)
To: pthreads-win32
Everyone:
Has anyone on this mailing list heard of Coverity? I
am evaluating it in a desperate attempt to find a bug in
my code. When I run it in debug mode, nothing breaks. When
my program runs in release mode, it gets an access violation
after a couple of days running, which could be anything.
Anyway, one of the things Coverity uncovered is called
FORWARD NULL. Here is an example below from ptw32_throw.c,
line 84:
Event var_compare_op: Added "sp" due to comparison "sp == 0"
At conditional (1): "sp == 0" taking true path
68 if (NULL == sp || sp->implicit)
69 {
70 /*
71 * We're inside a non-POSIX initialised Win32 thread
72 * so there is no point to jump or throw back to. Just do an
73 * explicit thread exit here after cleaning up POSIX
74 * residue (i.e. cleanup handlers, POSIX thread handle etc).
75 */
76 unsigned exitCode = 0;
77
78 switch (exception)
79 {
80 case PTW32_EPS_CANCEL:
81 exitCode = (unsigned) PTHREAD_CANCELED;
82 break;
At conditional (2): "exception == 1" taking true path
83 case PTW32_EPS_EXIT:
Event var_deref_op: Variable "sp" tracked as NULL was dereferenced.
84 exitCode = (unsigned) sp->exitStatus;;
85 break;
86 }
In other words, if sp shows to be null at line 68, it should not be
dereferenced at line 84. I can show some others, but I am not sure
if they are significant.
Let me know what you think,
Robert Kindred
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-06-05 20:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-05 20:00 pthreads-win32 and Coverity Robert Kindred
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).