<br><tt><font size=2>Jim Meyering <jim@meyering.net> wrote on 04/15/2010
01:36:21 AM:<br>
<br>
<br>
> "Daniel P. Berrange", libvir-list</font></tt>
<br><tt><font size=2>> <br>
> Stefan Berger wrote:<br>
> > libvir-list-bounces@redhat.com wrote on 04/14/2010 01:40:17 PM:<br>
> ><br>
> >> Please respond to "Daniel P. Berrange"<br>
> >><br>
> >> On Wed, Apr 14, 2010 at 06:02:32PM +0200, Jim Meyering wrote:<br>
> >> > From: Jim Meyering <meyering@redhat.com><br>
[...]</font></tt>
<br><tt><font size=2><br>
> >> >          goto tear_down_tmpebchains;<br>
> >> ><br>
> >> >      for (i = 0; i < nruleInstances;
i++)<br>
> >> > +        sa_assert (inst);<br>
> ><br>
> > Due to this statement here I get segmentation faults for which
there is no<br>
> > reason. I have no idea why that is but I have to deactivate this
<br>
> line for it to<br>
> > work again.<br>
> > The same is not true for the statement further above...  So
strange.<br>
> <br>
> How is STATIC_ANALYSIS defined in config.h?<br>
> <br>
>     $ grep STATIC_AN config.h<br>
>     #define STATIC_ANALYSIS 0</font></tt>
<br>
<br><tt><font size=2>Also 0 here.</font></tt>
<br><tt><font size=2><br>
> <br>
> If it's not 0, then you must have one of these two envvars set:<br>
> <br>
>   test -n "$CCC_ANALYZER_ANALYSIS$COVERITY_BUILD_COMMAND"
&& echo oops</font></tt>
<br>
<br><tt><font size=2>got 'oops' here.</font></tt>
<br><tt><font size=2><br>
> <br>
> How is sa_assert defined for you?<br>
> <br>
>     $ grep -C3 sa_assert src/internal.h<br>
>     # if STATIC_ANALYSIS<br>
>     #  undef NDEBUG /* Don't let a prior NDEBUG definition
cause trouble.  */<br>
>     #  include <assert.h><br>
>     #  define sa_assert(expr) assert (expr)<br>
>     # else<br>
>     #  define sa_assert(expr) /* empty */<br>
>     # endif<br>
> <br>
> With those, the net result in your file should be that<br>
> sa_assert is a no-op.</font></tt>
<br>
<br><tt><font size=2>Yes, I agree. My understanding also.</font></tt>
<br><tt><font size=2><br>
> <br>
> If you're still convinced that the segfault is due to that use<br>
> of sa_assert, please send me preprocessed output for that file, i.e.,<br>
> <br>
>     cd src<br>
>     f=nwfilter_ebiptables_driver<br>
>     touch nwfilter/$f.c<br>
>     la=libvirt_driver_nwfilter_la<br>
>     lo=$la-$f.lo<br>
>     make AM_CPPFLAGS='-E -dD' $lo<br>
>     mv .libs/$la-$f.o $f.i<br>
> <br>
> The cpp-preprocessed output is now in<br>
> <br>
>     src/nwfilter_ebiptables_driver.i<br>
> <br>
> You should be able to see that sa_assert expands to nothing:<br>
> <br>
>     $ grep sa_assert $f.i<br>
>     #define sa_assert(expr)</font></tt>
<br>
<br><tt><font size=2>Well, not quite true. I see the lonely semicolon there
that's the remainder from sa_assert(); -> one would have to write sa_assert(),
which isn't nice, either...</font></tt>
<br>
<br><tt><font size=2>   if (ebiptablesExecCLI(&buf, &cli_status)
|| cli_status != 0)</font></tt>
<br><tt><font size=2>       goto tear_down_tmpebchains;</font></tt>
<br>
<br><tt><font size=2>   for (i = 0; i < nruleInstances; i++)</font></tt>
<br><tt><font size=2>       ;</font></tt>
<br><tt><font size=2>       switch (inst[i]->ruleType)
{</font></tt>
<br>
<br>
<br><tt><font size=2>Regards,</font></tt>
<br><tt><font size=2>    Stefan</font></tt>
<br>
<br>
<br><tt><font size=2><br>
</font></tt>