mozilla-services / hindsight

Hindsight - light weight data processing skeleton
Mozilla Public License 2.0
668 stars 55 forks source link

build hindsight v0.15.3 error #185

Open wbtlb opened 5 years ago

wbtlb commented 5 years ago

when i buid hindsight v0.15.3, i get an error, any idea?

Scanning dependencies of target hindsight
[  3%] Building C object src/CMakeFiles/hindsight.dir/hindsight.c.o
[  6%] Building C object src/CMakeFiles/hindsight.dir/hs_analysis_plugins.c.o
[  9%] Building C object src/CMakeFiles/hindsight.dir/hs_checkpoint_reader.c.o
[ 12%] Building C object src/CMakeFiles/hindsight.dir/hs_checkpoint_writer.c.o
[ 15%] Building C object src/CMakeFiles/hindsight.dir/hs_config.c.o
[ 18%] Building C object src/CMakeFiles/hindsight.dir/hs_input.c.o
[ 21%] Building C object src/CMakeFiles/hindsight.dir/hs_input_plugins.c.o
[ 25%] Building C object src/CMakeFiles/hindsight.dir/hs_logger.c.o
/root/workspaces/hindsight/src/hs_logger.c: In function ‘hs_log’:
/root/workspaces/hindsight/src/hs_logger.c:62:15: error: variable ‘level’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
   const char *level;
               ^
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/hindsight.dir/hs_logger.c.o] Error 1
make[1]: *** [src/CMakeFiles/hindsight.dir/all] Error 2
make: *** [all] Error 2
trink commented 5 years ago

What os and compiler version?

ruiaylin commented 5 years ago

@trink I met this compile error too . I write the information like bellow

Gcc

[root@10b8436388c8 release]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Cmake

[root@10b8436388c8 release]# cmake --version
cmake version 3.13.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

OS version

CentOS Linux release 7.3.1611 (Core)

the code base is master branch

error info

[ 18%] Building C object src/CMakeFiles/hindsight.dir/hs_input.c.o
[ 21%] Building C object src/CMakeFiles/hindsight.dir/hs_input_plugins.c.o
[ 25%] Building C object src/CMakeFiles/hindsight.dir/hs_logger.c.o
/data/hindsight/src/hs_logger.c: In function 'hs_log':
/data/hindsight/src/hs_logger.c:62:15: error: variable 'level' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
   const char *level;
               ^
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/hindsight.dir/hs_logger.c.o] Error 1
make[1]: *** [src/CMakeFiles/hindsight.dir/all] Error 2
make: *** [all] Error 2
trink commented 5 years ago

I am unable to reproduce this, will you run

Thanks, Trink

ruiaylin commented 5 years ago

hi trink @trink

the information like this:

[ 25%] Building C object src/CMakeFiles/hindsight.dir/hs_logger.c.o
cd /data/hindsight/release/src && /usr/bin/cc -DWITH_OPENSSL -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=600  -std=c99 -pedantic -Werror -Wno-error=deprecated -Wall -Wextra -fPIC -O2   -o CMakeFiles/hindsight.dir/hs_logger.c.o   -c /data/hindsight/src/hs_logger.c
/data/hindsight/src/hs_logger.c: In function 'hs_log':
/data/hindsight/src/hs_logger.c:62:15: error: variable 'level' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
   const char *level;
               ^
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/hindsight.dir/hs_logger.c.o] Error 1
make[2]: Leaving directory `/data/hindsight/release'
make[1]: *** [src/CMakeFiles/hindsight.dir/all] Error 2
make[1]: Leaving directory `/data/hindsight/release'
make: *** [all] Error 2
[root@10b8436388c8 src]# /usr/bin/cc  -DHINDSIGHT_CLI -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=600  -std=c99 -pedantic -Werror -Wno-error=deprecated -Wall -Wextra -fPIC -O2   -o CMakeFiles/hindsight_cli.dir/hs_logger.c.o   -c /data/hindsight/src/hs_logger.c
/data/hindsight/src/hs_logger.c: In function 'hs_log':
/data/hindsight/src/hs_logger.c:62:15: error: variable 'level' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
   const char *level;
               ^
cc1: all warnings being treated as errors
ruiaylin commented 5 years ago

@trink Does this problem fixed? I build hindsight in a docker env( docker image is centos:7) . meet this error every time .

trink commented 5 years ago

Moving the declaration/switch before the fprintf within the lock should quiet the bogus warning. A bit annoying but if it fixes the issue I will merge it. Since you can reproduce it consistently please let me know if this https://github.com/mozilla-services/hindsight/compare/dev...issue_185?expand=1 fixes the issue, thanks. @ruiaylin

ruiaylin commented 5 years ago

@trink Hi trink , sorry for the late reply. And i build the dev code , the error occur again.

[ 15%] Building C object src/CMakeFiles/hindsight_cli.dir/hs_config.c.o
[ 18%] Building C object src/CMakeFiles/hindsight_cli.dir/hs_input.c.o
[ 21%] Building C object src/CMakeFiles/hindsight_cli.dir/hs_input_plugins.c.o
[ 25%] Building C object src/CMakeFiles/hindsight_cli.dir/hs_logger.c.o
/opt/hindsight-dev/src/hs_logger.c: In function 'hs_log':
/opt/hindsight-dev/src/hs_logger.c:62:15: error: variable 'level' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
   const char *level;
               ^
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/hindsight_cli.dir/hs_logger.c.o] Error 1
make[1]: *** [src/CMakeFiles/hindsight_cli.dir/all] Error 2
make: *** [all] Error 2
[root@6c0df8413d42 release]# pwd
/opt/hindsight-dev/release
valerypetrov commented 4 years ago

@ruiaylin I've had the same issue. It has been fixed by upgrading gcc to 7.2.1