Comments (7)
I can't reproduce this messages. I've compiled both versions (2.0.x and 3.0.x) using clang 3.7.1 and gcc 4.9.2 with warning/extra options: -std=c99 -Wall -Wextra -Wshadow -Warray-bounds -pedantic -fwrapv
. Using clang I've compiled without optimizations (-O0
), but using gcc I've compiled with classic -O2
option (optimizations may change warning messages, so this might be important).
My clang (Mac OS X) info:
clang version 3.7.1 (tags/RELEASE_371/final)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
My gcc (Linux debian 8) info:
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 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.
I've also checked the code and those are calling of strcmp
function with short constant string as one of the parameters. This is code such: if (strcmp(name,"..")==0) { ... }
. This code looks correct as long as "name" is correct, but the "name" is external variable of type char*, so it is not possible to check the size. The only way is to assume that there is always zero at the end (correct C string) and in such case strcmp
will never access array past the end.
Nevertheless I would like to reproduce this messages myself, because maybe I will be able to change something in the code to silent these warnings, so I've question. How to reproduce it? Which compiler/operating system should I use?
from moosefs.
This is with GCC-5 which is default in Debian "testing". Merely compiling in Debian "testing" should be enough to reproduce.
gcc-5.real (Debian 5.3.1-10) 5.3.1 20160224
from moosefs.
Still nothing. We have installed debian 'testing'.
uname -a:
Linux debian-testing 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 GNU/Linux
gcc --version:
gcc (Debian 5.3.1-10) 5.3.1 20160224 (...)
I've found something else (false negative of compiler, but still worth fixing), but not even one of your errors.
It's little strange that your compiler only has problems with short strings. Here is fragment of exports.c code:
if (strcmp(p,"ro")==0) {
arec->sesflags |= SESFLAG_READONLY;
o=1;
} else if (strcmp(p,"readonly")==0) {
arec->sesflags |= SESFLAG_READONLY;
o=1;
} else if (strcmp(p,"rw")==0) {
arec->sesflags &= ~SESFLAG_READONLY;
o=1;
} else if (strcmp(p,"readwrite")==0) {
arec->sesflags &= ~SESFLAG_READONLY;
o=1;
}
Construction used for strings "ro" and "rw" is the same as in case of strings "readonly" and "readwrite" and your compiler reports only short ones. Really strange.
I've tried building package (dpkg-buildpackage), classic "./configure && make" and also manually compiled exports.c with explicitly added "-Warray-bounds" option and nothing.
from moosefs.
My bad, I've just realised that MooseFS build system prefer clang over GCC... Those warnings are actually from clang, not from GCC.
Clang version string is this:
Debian clang version 3.6.2-3 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
With GCC I've noticed only the following warnings:
../../mfscommon/datapack.h:50:2: warning: ‘nextcidptr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(*ptr,&val,8);
^
../../mfsmaster/filesystem.c:6462:11: note: ‘nextcidptr’ was declared here
uint8_t *nextcidptr;
^
../../mfsmetadump/main.c:754:4: warning: ‘umaskval’ may be used uninitialized in this function [-Wmaybe-uninitialized]
printf("SESSION|s:%10"PRIu32"|e:#%"PRIu64"|p:%s|r:%10"PRIu32"|f:%02"PRIX8"|u:%03"PRIo16"|g:%"PRIu8"-%"PRIu8"|t:%10"PRIu32"-%10"PRIu32"|m:%10"PRIu32",%10"PRIu32",%10"PRIu32",%10"PRIu32"|d:%10"PRIu32"|c:",sessionid,exportscsum,strip,rootinode,sesflags,umaskval,mingoal,maxgoal,mintrashtime,maxtrashtime,rootuid,rootgid,mapalluid,mapallgid,disconnected);
^
../../mfsmetadump/main.c:663:11: note: ‘umaskval’ was declared here
uint16_t umaskval;
^
from moosefs.
Thanks. I'll check it using clang on debian 'testing'. Warnings from GCC are those "false negatives" I've mentioned. Nevertheless I've fixed them - because I hate warnings :)
from moosefs.
Still nothing. My clang:
Debian clang version 3.6.2-3 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
OS - debian testing. Architecture amd64. No warnings from compiler (clang is probably little better than gcc in case of false negatives - this is probably why it didn't give me any warnings). This is exactly the same version of compiler. Almost unbelievable. Maybe you have some special system-wide settings? Special compiler flags? Did you try to invoke make with V=1? You will see all arguments given to the compiler.
In my case (and exports.c) it look like this:
clang -DHAVE_CONFIG_H -I. -I.. -I../mfscommon -DMFSMAXFILES=16384 -DAPPNAME=mfsmaster -D_GNU_SOURCE -DDEFAULT_SUGID_CLEAR_MODE_EXT -O2 -g -O2 -g -std=c99 -Wall -Wextra -Wshadow -pedantic -fwrapv -MT mfsmaster-exports.o -MD -MP -MF .deps/mfsmaster-exports.Tpo -c -o mfsmaster-exports.o
test -f 'exports.c' || echo './'exports.c
It really bothers me, because I don't like compiler warnings. Usually they mean something, but in this case I can't even reproduce them. And also the code looks correct (or I'm really stupid ;) ).
from moosefs.
I'm closing this issue, because we were not able to reproduce these warnings.
from moosefs.
Related Issues (20)
- supports IPv6 HOT 4
- [BUG] The data displayed by mfs has garbled characters HOT 8
- mfsmaster -a restore hangs with 100% CPU usage HOT 5
- [Question] 2 copys of chunks on one chunkserver HOT 1
- [BUG] Performance impact and write amplification with CHANGELOG_SAVE_MODE = 2 HOT 9
- Do the Master and Chunk servers have to be the same architecture? HOT 3
- chunkserver: High speed rebalance blocks deletions? HOT 7
- [BUG] fuse: bad mount point `/matrix/synapse/storage/media-store/': Input/output error HOT 2
- [FEATURE] Official packages of MooseFS / MooseFS Pro for Debian 12 Bookworm HOT 2
- [BUG] mfsbdev and map + unmap + map on /dev/ndb0 = input/output error HOT 1
- [FEATURE] mfsclient mfstimeout default 0 HOT 1
- mfsmaster register error: No such file or directory HOT 3
- Can't mount MooseFS on Proxmox 8.1 properly. HOT 4
- MooseFS 3.x Erasure Code Support
- [BUG] mfsmaster hung and in unkillable D state HOT 3
- [BUG] DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 2
- [FEATURE] mfsbdev as standard (TCP/Unix Socket) NBD server HOT 1
- [BUG] Empty chunks and copies with different checksums HOT 8
- Recovery data from chunks without metadata :) HOT 4
- [BUG] FUSE mount forces DIRECT I/O mode with Samba
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moosefs.