From: Date: November 7 2008 9:01am Subject: bzr commit into mysql-5.1 branch (msvensson:2721) Bug#39180 List-Archive: http://lists.mysql.com/commits/58143 X-Bug: 39180 Message-Id: <20081107080147.8DE7613412A@pilot> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/msvensson/mysql/6.2/ 2721 Magnus Svensson 2008-11-07 Bug#39180 Segfault in Logger::Log causes ndbd to hang indefinately - part2 modified: BUILD/SETUP.sh storage/ndb/src/cw/cpcd/Process.cpp storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp storage/ndb/src/mgmsrv/Services.cpp storage/ndb/src/ndbapi/ObjectMap.cpp support-files/compiler_warnings.supp per-file messages: BUILD/SETUP.sh -Wno-format-zero-length is only valid in C, set it only for C compiler storage/ndb/src/cw/cpcd/Process.cpp Fix warning storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp Fix warning storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp Fix warning storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp Fix warning storage/ndb/src/mgmsrv/Services.cpp Fix warning storage/ndb/src/ndbapi/ObjectMap.cpp Fix warning support-files/compiler_warnings.supp Ignore zero szie format string warnings === modified file 'BUILD/SETUP.sh' --- a/BUILD/SETUP.sh 2008-11-06 19:42:24 +0000 +++ b/BUILD/SETUP.sh 2008-11-07 08:01:33 +0000 @@ -93,7 +93,7 @@ if [ "x$warning_mode" != "xpedantic" ]; warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W" warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare" warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label" - warnings="$warnings -Wunused-value -Wunused-variable -Wno-format-zero-length" + warnings="$warnings -Wunused-value -Wunused-variable" # Make "printf like format specifier warnings" into error #warnings="$warnings -Werror=format" @@ -102,7 +102,7 @@ if [ "x$warning_mode" != "xpedantic" ]; # warnings="$global_warnings -Wshadow" # C warnings - c_warnings="$warnings -Wunused-parameter" + c_warnings="$warnings -Wunused-parameter -Wno-format-zero-length" # C++ warnings cxx_warnings="$warnings" # cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo" === modified file 'storage/ndb/src/cw/cpcd/Process.cpp' --- a/storage/ndb/src/cw/cpcd/Process.cpp 2006-12-23 19:20:40 +0000 +++ b/storage/ndb/src/cw/cpcd/Process.cpp 2008-11-07 08:01:33 +0000 @@ -308,7 +308,7 @@ CPCD::Process::do_exec() { } int f = fds[i]= open(redirects[i]->c_str(), flags, mode); if(f == -1){ - logger.error("Cannot redirect %d to/from '%s' : %s\n", i, + logger.error("Cannot redirect %ld to/from '%s' : %s\n", i, redirects[i]->c_str(), strerror(errno)); _exit(1); } === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2008-11-06 16:35:05 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2008-11-07 08:01:33 +0000 @@ -18896,7 +18896,7 @@ Dblqh::validate_filter(Signal* signal) start += 3; break; default: - infoEvent("Invalid filter op: 0x%x pos: %d", + infoEvent("Invalid filter op: 0x%x pos: %ld", * start, start - (signal->theData + 1)); return false; === modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2008-11-06 10:08:40 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2008-11-07 08:01:33 +0000 @@ -11638,7 +11638,7 @@ Dbtc::validate_filter(Signal* signal) start += 3; break; default: - infoEvent("Invalid filter op: 0x%x pos: %d", + infoEvent("Invalid filter op: 0x%x pos: %ld", * start, start - (signal->theData + 1)); return false; === modified file 'storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp' --- a/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp 2008-04-22 19:36:05 +0000 +++ b/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp 2008-11-07 08:01:33 +0000 @@ -262,7 +262,7 @@ Ndbd_mem_manager::init(bool alloc_less_m m_resource_limit[0].m_min = pages; } - g_eventLogger->info("Ndbd_mem_manager::init(%d) min: %dMb initial: %dMb", + g_eventLogger->info("Ndbd_mem_manager::init(%d) min: %ldMb initial: %ldMb", alloc_less_memory, (sizeof(Alloc_page)*m_resource_limit[0].m_min)>>20, (sizeof(Alloc_page)*pages)>>20); === modified file 'storage/ndb/src/mgmsrv/Services.cpp' --- a/storage/ndb/src/mgmsrv/Services.cpp 2008-08-05 12:07:35 +0000 +++ b/storage/ndb/src/mgmsrv/Services.cpp 2008-11-07 08:01:33 +0000 @@ -614,7 +614,7 @@ MgmApiSession::getConfig(Parser_t::Conte m_output->println("get config reply"); m_output->println("result: Ok"); - m_output->println("Content-Length: %d", strlen(tmp_str)); + m_output->println("Content-Length: %ld", strlen(tmp_str)); m_output->println("Content-Type: ndbconfig/octet-stream"); SLEEP_ERROR_INSERTED(2); m_output->println("Content-Transfer-Encoding: base64"); === modified file 'storage/ndb/src/ndbapi/ObjectMap.cpp' --- a/storage/ndb/src/ndbapi/ObjectMap.cpp 2008-04-22 19:36:05 +0000 +++ b/storage/ndb/src/ndbapi/ObjectMap.cpp 2008-11-07 08:01:33 +0000 @@ -53,7 +53,7 @@ int NdbObjectIdMap::expand(Uint32 incSiz else { NdbMutex_Unlock(m_mutex); - g_eventLogger->error("NdbObjectIdMap::expand: realloc(%u*%u) failed", + g_eventLogger->error("NdbObjectIdMap::expand: realloc(%u*%lu) failed", newSize, sizeof(MapEntry)); return -1; } === modified file 'support-files/compiler_warnings.supp' --- a/support-files/compiler_warnings.supp 2007-11-21 18:42:50 +0000 +++ b/support-files/compiler_warnings.supp 2008-11-07 08:01:33 +0000 @@ -69,6 +69,9 @@ db_vrfy.c : .*comparison is always false .*/ndb/.* : .*unused variable.* .*/ndb/.* : .*defined but not used.* +# Ignore warning produced by passing "" to a printf like function +.*/ndb/.* : zero-length printf format string + # # Unexplanable (?) stuff #