diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2012-07-20 13:18:34 -0400 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-20 16:13:10 -0700 |
commit | 6c8918047009dee7286fb357a8b26fa551da101d (patch) | |
tree | 1a7837322034577c8f628b5ee5f8a44654955954 /configure.ac | |
parent | af7cd3eb5ad447917a8ab2f4aa1d2227bc484c2b (diff) |
Most commands cause glusterd 3.2.7 to crash on Debian Wheezy
When xlators/mgmt/glusterd/src/glusterd-rpc-ops.c is compiled with
-O2 by gcc-4.7.1, the compiler optimizes away all the rsp.foo = bar
statements because rsp goes out of scope at the end of each of
the blocks in the switch statement in glusterd-op_send_cli_response().
That is:
void *cli_rsp = NULL;
switch(foo) {
case BAR:
{
struct bar rsp = {0,};
/* init statements here are optimized away */
rsp.x = 0;
rsp.y = 1;
cli_rsp = &rsp;
}
...
}
/* don't expect cli_rsp to point at anything meaningful here */
This particular idiom hasn't been a problem thus far, e.g. even with
gcc-4.7.0 in Fedora17 also compiling with -O2. That not withstanding,
using this idiom has probably always been on shaky ground; semantically
it is correct that rsp goes out of scope at the end of the block.
Note: I have not surveyed the source to see whether this idiom appears
anywhere else.
Note also that glusterd-op_send_cli_response() has been rewritten around
the refactored gf_cli_rsp for 3.3.x and later and this particular bug is
not in 3.3.x and later releases.
BUG: 837684
Change-Id: I82f61ad2b9827c5b96af14b180a82c3ab350f559
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/3707
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions