From 3c4a5ea82176c86adc3219942a033a8ba673a089 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Jan 24 2022 09:05:25 +0000 Subject: Fix compiler warnings from gcc 12 --- diff --git a/0001-Fix-compiler-warnings-about-pointers-used-after-free.patch b/0001-Fix-compiler-warnings-about-pointers-used-after-free.patch new file mode 100644 index 0000000..513fff6 --- /dev/null +++ b/0001-Fix-compiler-warnings-about-pointers-used-after-free.patch @@ -0,0 +1,71 @@ +From 654133bc1158e4815a45dc8dd70023e5fff82424 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Thu, 20 Jan 2022 00:19:08 +0100 +Subject: [PATCH] Fix compiler warnings about pointers used after free: + +.../src/XrdCms/XrdCmsUtils.cc: In function 'XrdCmsUtils::ParseMan(XrdSysError*, XrdOucTList**, char*, char*, int*, bool)': +.../src/XrdCms/XrdCmsUtils.cc:226:43: error: pointer 'newMans_175' may be used after 'operator delete(void*, unsigned long)' [-Werror=use-after-free] + 226 | if (!plus || strcmp(hSpec, newP->text)) isBad = false; + | ~~~~~~^~~~ +.../src/XrdCms/XrdCmsUtils.cc:221:27: note: call to 'operator delete(void*, unsigned long)' here + 221 | delete newP; + | ^~~~ + +.../src/XrdCl/XrdClCopy.cc: In function 'IndexRemote(XrdCl::FileSystem*, std::__cxx11::basic_string, std::allocator >, unsigned short)': +.../src/XrdCl/XrdClCopy.cc:442:17: error: pointer used after 'operator delete(void*, unsigned long)' [-Werror=use-after-free] + 442 | log->Error( AppMsg, "Bad URL: %s", current->Path ); + | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.../src/XrdCl/XrdClCopy.cc:441:14: note: call to 'operator delete(void*, unsigned long)' here + 441 | delete current; + | ^~~~~~~ +--- + src/XrdCl/XrdClCopy.cc | 2 +- + src/XrdCms/XrdCmsUtils.cc | 18 +++++++++--------- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/XrdCl/XrdClCopy.cc b/src/XrdCl/XrdClCopy.cc +index 78d27589c..c2b754bf5 100644 +--- a/src/XrdCl/XrdClCopy.cc ++++ b/src/XrdCl/XrdClCopy.cc +@@ -438,8 +438,8 @@ XrdCpFile *IndexRemote( XrdCl::FileSystem *fs, + current = new XrdCpFile( path.c_str(), badUrl ); + if( badUrl ) + { +- delete current; + log->Error( AppMsg, "Bad URL: %s", current->Path ); ++ delete current; + return 0; + } + +diff --git a/src/XrdCms/XrdCmsUtils.cc b/src/XrdCms/XrdCmsUtils.cc +index 49c448849..8d25973bc 100644 +--- a/src/XrdCms/XrdCmsUtils.cc ++++ b/src/XrdCms/XrdCmsUtils.cc +@@ -223,15 +223,15 @@ bool XrdCmsUtils::ParseMan(XrdSysError *eDest, XrdOucTList **oldMans, + } + oldP = oldP->next; + } +- if (!plus || strcmp(hSpec, newP->text)) isBad = false; +- else {eDest->Say("Config warning: " +- "Cyclic DNS registration for ",newP->text,"\n" +- "Config warning: This cluster will exhibit " +- "undefined behaviour!!!"); +- isBad = true; +- } +- if (!oldP) +- {appList = SInsert(appList, newP); ++ if (!oldP) ++ {if (!plus || strcmp(hSpec, newP->text)) isBad = false; ++ else {eDest->Say("Config warning: " ++ "Cyclic DNS registration for ",newP->text,"\n" ++ "Config warning: This cluster will exhibit " ++ "undefined behaviour!!!"); ++ isBad = true; ++ } ++ appList = SInsert(appList, newP); + if (plus && !hush) Display(eDest, hSpec, newP->text, isBad); + } + } +-- +2.34.1 + diff --git a/0001-Fix-warning-about-uninitialized-variable.patch b/0001-Fix-warning-about-uninitialized-variable.patch new file mode 100644 index 0000000..fe72398 --- /dev/null +++ b/0001-Fix-warning-about-uninitialized-variable.patch @@ -0,0 +1,34 @@ +From 0898ed380a457ff1c0c2547953d0fd36eaeaeebe Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Mon, 17 Jan 2022 09:14:08 +0100 +Subject: [PATCH 1/4] Fix warning about uninitialized variable + +The cond variable is initialized using the mutex before the mutex is +initialized. Changing the order of the members in the class ensures +the mutex is initialized first. + +.../src/./XrdXrootd/XrdXrootdAioTask.hh:70:51: error: member 'XrdXrootdAioTask::aioMutex' is used uninitialized [-Werror=uninitialized] + 70 | : XrdJob(what), aioReady(aioMutex) {} + | ^~~~~~~~ +cc1plus: all warnings being treated as errors +--- + src/XrdXrootd/XrdXrootdAioTask.hh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/XrdXrootd/XrdXrootdAioTask.hh b/src/XrdXrootd/XrdXrootdAioTask.hh +index 2c49ff7d1..c04858bba 100644 +--- a/src/XrdXrootd/XrdXrootdAioTask.hh ++++ b/src/XrdXrootd/XrdXrootdAioTask.hh +@@ -83,8 +83,8 @@ virtual bool CopyL2F(XrdXrootdAioBuff *aioP) = 0; + + static const char* TraceID; + +- XrdSysCondVar2 aioReady; + XrdSysMutex aioMutex; // Locks private data ++ XrdSysCondVar2 aioReady; + XrdXrootdAioBuff* pendQ; + XrdXrootdAioBuff* pendQEnd; // -> Last element in pendQ + +-- +2.34.1 + diff --git a/0001-Fix-warnings-about-allocations-exceeding-maximum-obj.patch b/0001-Fix-warnings-about-allocations-exceeding-maximum-obj.patch new file mode 100644 index 0000000..7b7cf1d --- /dev/null +++ b/0001-Fix-warnings-about-allocations-exceeding-maximum-obj.patch @@ -0,0 +1,125 @@ +From 0dc292fbf63d25c6a9e000a2e66d7e3e0b8db735 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Mon, 24 Jan 2022 06:56:43 +0100 +Subject: [PATCH] Fix warnings about allocations exceeding maximum object size + +In member function 'Init', + inlined from 'Init' at .../src/Xrd/XrdBuffXL.cc:64:6: +.../src/Xrd/XrdBuffXL.cc:90:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] + 90 | bucket = new BuckVec[lg2+1]; + | ^ +/usr/include/c++/12/new: In member function 'Init': +/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here + 128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) + | ^ + +.../src/XrdOuc/XrdOucBuffer.cc: In member function '__ct_base ': +.../src/XrdOuc/XrdOucBuffer.cc:79:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] + 79 | bSlot = new BuffSlot[slots]; + | ^ +/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here + 128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) + | ^ + +.../src/XrdNet/XrdNetUtils.cc: In function 'GetAddrs': +.../src/XrdNet/XrdNetUtils.cc:262:35: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] + 262 | *aVec = new XrdNetAddr[aVsz]; + | ^ +/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here + 128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) + | ^ + +In member function '__ct ', + inlined from '__ct_base ' at .../src/XrdXrootd/XrdXrootdJob.cc:459:29: +.../src/./XrdOuc/XrdOucTable.hh:43:30: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] + 43 | Table = new OucTable[maxe]; + | ^ +/usr/include/c++/12/new: In member function '__ct_base ': +/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here + 128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) + | ^ + +.../src/XrdPosix/XrdPosixAdmin.cc: In member function 'FanOut': +.../src/XrdPosix/XrdPosixAdmin.cc:69:27: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] + 69 | uVec = new XrdCl::URL[i]; + | ^ +/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here + 128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) + | ^ +--- + src/Xrd/XrdBuffXL.cc | 3 ++- + src/XrdNet/XrdNetUtils.cc | 2 +- + src/XrdOuc/XrdOucBuffer.cc | 2 +- + src/XrdOuc/XrdOucTable.hh | 2 +- + src/XrdPosix/XrdPosixAdmin.cc | 2 +- + 5 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/Xrd/XrdBuffXL.cc b/src/Xrd/XrdBuffXL.cc +index f84ef77cb..f769522af 100644 +--- a/src/Xrd/XrdBuffXL.cc ++++ b/src/Xrd/XrdBuffXL.cc +@@ -63,7 +63,8 @@ XrdBuffXL::XrdBuffXL() : bucket(0), totalo(0), pagsz(getpagesize()), slots(0), + + void XrdBuffXL::Init(int maxMSZ) + { +- int lg2, chunksz; ++ unsigned int lg2; ++ int chunksz; + + // If this is a duplicate call, delete the previous setup + // +diff --git a/src/XrdNet/XrdNetUtils.cc b/src/XrdNet/XrdNetUtils.cc +index 0f5eac348..fbc6c5ff7 100644 +--- a/src/XrdNet/XrdNetUtils.cc ++++ b/src/XrdNet/XrdNetUtils.cc +@@ -259,7 +259,7 @@ const char *XrdNetUtils::GetAddrs(const char *hSpec, + // + if (aInfo.aNum4 || aInfo.aNum6) + {aVsz = aInfo.aNum4 + aInfo.aNum6; +- *aVec = new XrdNetAddr[aVsz]; ++ *aVec = new XrdNetAddr[(unsigned int)aVsz]; + FillAddr(aInfo, *aVec); + } + +diff --git a/src/XrdOuc/XrdOucBuffer.cc b/src/XrdOuc/XrdOucBuffer.cc +index 2faee1d51..10f79d999 100644 +--- a/src/XrdOuc/XrdOucBuffer.cc ++++ b/src/XrdOuc/XrdOucBuffer.cc +@@ -76,7 +76,7 @@ XrdOucBuffPool::XrdOucBuffPool(int minsz, int maxsz, + + // Allocate a slot vector for this + // +- bSlot = new BuffSlot[slots]; ++ bSlot = new BuffSlot[(unsigned int)slots]; + + // Complete initializing the slot vector + // +diff --git a/src/XrdOuc/XrdOucTable.hh b/src/XrdOuc/XrdOucTable.hh +index 92058c42b..2805a259c 100644 +--- a/src/XrdOuc/XrdOucTable.hh ++++ b/src/XrdOuc/XrdOucTable.hh +@@ -40,7 +40,7 @@ public: + + XrdOucTable(int maxe) + {int i; +- Table = new OucTable[maxe]; ++ Table = new OucTable[(unsigned int)maxe]; + maxnum = maxe; curnum = 0; avlnum = 0; + for (i = 1; i < maxe; i++) Table[i-1].Fnum = i; + Table[maxe-1].Fnum = -1; +diff --git a/src/XrdPosix/XrdPosixAdmin.cc b/src/XrdPosix/XrdPosixAdmin.cc +index c26571394..2cad5517e 100644 +--- a/src/XrdPosix/XrdPosixAdmin.cc ++++ b/src/XrdPosix/XrdPosixAdmin.cc +@@ -49,7 +49,7 @@ XrdCl::URL *XrdPosixAdmin::FanOut(int &num) + XrdCl::URL *uVec; + XrdNetAddr netLoc; + const char *hName; +- int i; ++ unsigned int i; + + // Make sure admin is ok + // +-- +2.34.1 + diff --git a/0001-Server-Prevent-SEGV-on-busy-systems-due-to-missing-l.patch b/0001-Server-Prevent-SEGV-on-busy-systems-due-to-missing-l.patch new file mode 100644 index 0000000..34f0cab --- /dev/null +++ b/0001-Server-Prevent-SEGV-on-busy-systems-due-to-missing-l.patch @@ -0,0 +1,161 @@ +From 7615d866986131f3548b5863b38872a2e4dc58d9 Mon Sep 17 00:00:00 2001 +From: Andrew Hanushevsky +Date: Thu, 20 Jan 2022 23:22:09 -0800 +Subject: [PATCH] [Server] Prevent SEGV on busy systems due to missing lock + call for background jobs. + +--- + src/XrdXrootd/XrdXrootdJob.cc | 50 +++++++++++++++++++++++++++++------ + 1 file changed, 42 insertions(+), 8 deletions(-) + +diff --git a/src/XrdXrootd/XrdXrootdJob.cc b/src/XrdXrootd/XrdXrootdJob.cc +index 1b2703d96..467323de5 100644 +--- a/src/XrdXrootd/XrdXrootdJob.cc ++++ b/src/XrdXrootd/XrdXrootdJob.cc +@@ -37,6 +37,7 @@ + #include "Xrd/XrdScheduler.hh" + #include "XrdOuc/XrdOucProg.hh" + #include "XrdOuc/XrdOucStream.hh" ++#include "XrdSys/XrdSysError.hh" + #include "XrdSys/XrdSysPlatform.hh" + #include "XrdSys/XrdSysRAtomic.hh" + #include "XrdXrootd/XrdXrootdJob.hh" +@@ -99,6 +100,12 @@ static const int argvnum = sizeof(theArgs)/sizeof(theArgs[0]); + /* G l o b a l F u n c t i o n s */ + /******************************************************************************/ + ++namespace XrdXrootd ++{ ++extern XrdSysError eLog; ++} ++using namespace XrdXrootd; ++ + extern XrdSysTrace XrdXrootdTrace; + + int XrdXrootdJobWaiting(XrdXrootdJob2Do *item, void *arg) +@@ -152,10 +159,15 @@ XrdXrootdJob2Do::~XrdXrootdJob2Do() + /******************************************************************************/ + /* D o I t */ + /******************************************************************************/ ++ ++#define jobInfo theJob->JobName<<' '<<(theArgs[1] ? theArgs[1] : "")\ ++ <<(theArgs[2] ? " " : "")<<(theArgs[2] ? theArgs[2] : "") + + void XrdXrootdJob2Do::DoIt() + { ++ static const char *TraceID = "jobXeq"; + XrdXrootdJob2Do *jp = 0; ++ const char *endStat = " completed"; + char *lp = 0; + int i, rc = 0; + +@@ -163,9 +175,11 @@ void XrdXrootdJob2Do::DoIt() + // perform the actual function and get the result and send to any async clients + // + if (Status != Job_Cancel) +- {if ((rc = theJob->theProg->Run(&jobStream, theArgs[1], theArgs[2], ++ {TRACE(REQ, "Job "<theProg->Run(&jobStream, theArgs[1], theArgs[2], + theArgs[3], theArgs[4]))) + {Status = Job_Cancel; ++ endStat= " failed"; + lp = jobStream.GetLine(); + theJob->myMutex.Lock(); + } +@@ -173,15 +187,22 @@ void XrdXrootdJob2Do::DoIt() + rc = theJob->theProg->RunDone(jobStream); + theJob->myMutex.Lock(); + if ((rc && rc != -EPIPE) || (rc == -EPIPE && (!lp || !(*lp)))) +- Status = Job_Cancel; ++ {Status = Job_Cancel; endStat = " failed";} + else if (Status != Job_Cancel) + {Status = Job_Done; + for (i = 0; i < numClients; i++) + if (!Client[i].isSync) {sendResult(lp); break;} + } + } ++ } else { ++ endStat = " cancelled"; ++ theJob->myMutex.Lock(); + } + ++// Produce a trace record ++// ++ TRACE(REQ, "Job "< than the max allowed, then redrive a waiting job + // if in fact we represent a legitimate job slot (this could a phantom slot + // due to ourselves being cancelled. +@@ -313,7 +334,7 @@ XrdOucTList *XrdXrootdJob2Do::lstClient() + /* v e r C l i e n t */ + /******************************************************************************/ + +-int XrdXrootdJob2Do::verClient(int dodel) ++int XrdXrootdJob2Do::verClient(int dodel) // Caller must have theJob->myMutex + { + int i, j, k; + +@@ -330,9 +351,16 @@ int XrdXrootdJob2Do::verClient(int dodel) + // + if (!numClients && dodel) + {XrdXrootdJob2Do *jp = theJob->JobTable.Remove(JobNum); +- if (jp->Status == XrdXrootdJob2Do::Job_Waiting) theJob->numJobs--; +- delete jp; +- return 0; ++ if (jp) ++ {if (jp->Status == XrdXrootdJob2Do::Job_Waiting) theJob->numJobs--; ++ delete jp; ++ return 0; ++ } else { ++ char ebuff[80]; ++ snprintf(ebuff, sizeof(ebuff), "Unable to find %s job %d;", ++ theJob->JobName, JobNum); ++ eLog.Emsg("Job2Do", ebuff, "job slot disabled!"); ++ } + } + return numClients; + } +@@ -341,7 +369,7 @@ int XrdXrootdJob2Do::verClient(int dodel) + /* R e d r i v e */ + /******************************************************************************/ + +-void XrdXrootdJob2Do::Redrive() ++void XrdXrootdJob2Do::Redrive() // Caller must have theJob->myMutex held + { + XrdXrootdJob2Do *jp; + int Start = 0; +@@ -364,10 +392,12 @@ void XrdXrootdJob2Do::Redrive() + /******************************************************************************/ + /* s e n d R e s u l t */ + /******************************************************************************/ ++ ++// Caller must have theJob->myMutex locked. + + void XrdXrootdJob2Do::sendResult(char *lp, int caned, int jrc) + { +- static const char *TraceID = "sendResult"; ++ static const char *TraceID = "jobSendResult"; + static const kXR_int32 Xcan = static_cast(htonl(kXR_Cancelled)); + XrdXrootdReqID ReqID; + struct iovec jobVec[6]; +@@ -619,6 +649,8 @@ int XrdXrootdJob::Schedule(const char *jkey, + /* C l e a n U p */ + /******************************************************************************/ + ++// The caller must have myMutex locked ++ + void XrdXrootdJob::CleanUp(XrdXrootdJob2Do *jp) + { + int theStatus = jp->Status; +@@ -641,6 +673,8 @@ void XrdXrootdJob::CleanUp(XrdXrootdJob2Do *jp) + /* s e n d R e s u l t */ + /******************************************************************************/ + ++// Caller must have myMutex locked. ++ + int XrdXrootdJob::sendResult(XrdXrootdResponse *resp, + const char *rpfx, + XrdXrootdJob2Do *job) +-- +2.34.1 + diff --git a/0002-Fix-warning-about-dereferncing-null-pointer.patch b/0002-Fix-warning-about-dereferncing-null-pointer.patch new file mode 100644 index 0000000..09c04e2 --- /dev/null +++ b/0002-Fix-warning-about-dereferncing-null-pointer.patch @@ -0,0 +1,39 @@ +From 1780fc12fb947a2bda22007a715527a18621a6cb Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Mon, 17 Jan 2022 09:21:23 +0100 +Subject: [PATCH 2/4] Fix warning about dereferncing null pointer + +In member function 'XrdCl::ChunkHandler::ToPgInfo(XrdCl::AnyObject*, XrdCl::PageInfo*&)', + inlined from 'XrdCl::ChunkHandler::HandleResponse(XrdCl::XRootDStatus*, XrdCl::AnyObject*)' at .../src/XrdCl/XrdClXCpSrc.cc:58:17: +.../src/XrdCl/XrdClXCpSrc.cc:97:66: error: 'this' pointer is null [-Werror=nonnull] + 97 | *chunk = PageInfo( rsp->offset, rsp->length, rsp->buffer ); + | ^ +In file included from .../src/./XrdCl/XrdClFileSystem.hh:32, + from .../src/./XrdCl/XrdClFile.hh:28, + from .../src/./XrdCl/XrdClXCpSrc.hh:28, + from .../src/XrdCl/XrdClXCpSrc.cc:25: +.../src/./XrdCl/XrdClXRootDResponses.hh: In member function 'XrdCl::ChunkHandler::HandleResponse(XrdCl::XRootDStatus*, XrdCl::AnyObject*)': +.../src/./XrdCl/XrdClXRootDResponses.hh:962:15: note: in a call to non-static member function 'XrdCl::PageInfo::operator=(XrdCl::PageInfo&&)' + 962 | PageInfo& operator=( PageInfo &&pginf ); + | ^~~~~~~~ +cc1plus: all warnings being treated as errors +--- + src/XrdCl/XrdClXCpSrc.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/XrdCl/XrdClXCpSrc.cc b/src/XrdCl/XrdClXCpSrc.cc +index 532df79a4..c68fbc499 100644 +--- a/src/XrdCl/XrdClXCpSrc.cc ++++ b/src/XrdCl/XrdClXCpSrc.cc +@@ -94,7 +94,7 @@ class ChunkHandler: public ResponseHandler + { + ChunkInfo *rsp = nullptr; + response->Get( rsp ); +- *chunk = PageInfo( rsp->offset, rsp->length, rsp->buffer ); ++ chunk = new PageInfo( rsp->offset, rsp->length, rsp->buffer ); + response->Set( ( int* )0 ); + } + } +-- +2.34.1 + diff --git a/0003-Fix-warning-about-comparing-arrays.patch b/0003-Fix-warning-about-comparing-arrays.patch new file mode 100644 index 0000000..33c8bcf --- /dev/null +++ b/0003-Fix-warning-about-comparing-arrays.patch @@ -0,0 +1,30 @@ +From 62337be8ada4692bfd10eceaa042e3c4a553ece8 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Mon, 17 Jan 2022 09:24:46 +0100 +Subject: [PATCH 3/4] Fix warning about comparing arrays + +Cast the arrays to pointers to avoid the warning + +.../src/XrdPosix/XrdPosixXrootd.cc:955:22: error: comparison between two arrays [-Werror=array-compare] + 955 | if (dp32->d_name != dp64->d_name) + | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ +--- + src/XrdPosix/XrdPosixXrootd.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/XrdPosix/XrdPosixXrootd.cc b/src/XrdPosix/XrdPosixXrootd.cc +index 517dc07ec..cedb3ca40 100644 +--- a/src/XrdPosix/XrdPosixXrootd.cc ++++ b/src/XrdPosix/XrdPosixXrootd.cc +@@ -952,7 +952,7 @@ struct dirent* XrdPosixXrootd::Readdir(DIR *dirp) + if (!(dp64 = Readdir64(dirp))) return 0; + + dp32 = (struct dirent *)dp64; +- if (dp32->d_name != dp64->d_name) ++ if ((char*)dp32->d_name != (char*)dp64->d_name) + {dp32->d_ino = dp64->d_ino; + #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__GNU__) && !(defined(__FreeBSD_kernel__) && defined(__GLIBC__)) + dp32->d_off = dp64->d_off; +-- +2.34.1 + diff --git a/0004-Do-not-give-up-ownership-of-ChunkInfo.patch b/0004-Do-not-give-up-ownership-of-ChunkInfo.patch new file mode 100644 index 0000000..0d88bab --- /dev/null +++ b/0004-Do-not-give-up-ownership-of-ChunkInfo.patch @@ -0,0 +1,24 @@ +From 86d40e79b4ece53d9e5c2dfb6b40ff77888ebad6 Mon Sep 17 00:00:00 2001 +From: Mattias Ellert +Date: Tue, 18 Jan 2022 16:01:34 +0100 +Subject: [PATCH 4/4] Do not give up ownership of ChunkInfo + +--- + src/XrdCl/XrdClXCpSrc.cc | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/XrdCl/XrdClXCpSrc.cc b/src/XrdCl/XrdClXCpSrc.cc +index c68fbc499..c19332c74 100644 +--- a/src/XrdCl/XrdClXCpSrc.cc ++++ b/src/XrdCl/XrdClXCpSrc.cc +@@ -95,7 +95,6 @@ class ChunkHandler: public ResponseHandler + ChunkInfo *rsp = nullptr; + response->Get( rsp ); + chunk = new PageInfo( rsp->offset, rsp->length, rsp->buffer ); +- response->Set( ( int* )0 ); + } + } + +-- +2.34.1 + diff --git a/xrootd.spec b/xrootd.spec index 5e4f370..aeab40b 100644 --- a/xrootd.spec +++ b/xrootd.spec @@ -19,7 +19,7 @@ Name: xrootd Epoch: 1 Version: 5.4.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Extended ROOT file server License: LGPLv3+ @@ -33,6 +33,17 @@ Patch1: 0001-Fix-compilation-on-GCC-4.8.patch Patch2: 0001-Add-missing-include.patch # https://github.com/xrootd/xrootd/pull/1575 Patch3: 0001-Define-ENODATA-if-not-defined.patch +# https://github.com/xrootd/xrootd/pull/1592 +Patch4: 0001-Fix-warning-about-uninitialized-variable.patch +Patch5: 0002-Fix-warning-about-dereferncing-null-pointer.patch +Patch6: 0003-Fix-warning-about-comparing-arrays.patch +Patch7: 0004-Do-not-give-up-ownership-of-ChunkInfo.patch +# https://github.com/xrootd/xrootd/pull/1598 +Patch8: 0001-Fix-compiler-warnings-about-pointers-used-after-free.patch +# https://github.com/xrootd/xrootd/pull/1600 +Patch9: 0001-Fix-warnings-about-allocations-exceeding-maximum-obj.patch +# Backport from upstream - fixes a gcc 12 compiler warning +Patch10: 0001-Server-Prevent-SEGV-on-busy-systems-due-to-missing-l.patch BuildRequires: gcc-c++ %if %{?rhel}%{!?rhel:0} == 7 @@ -292,8 +303,25 @@ This package contains the API documentation of the xrootd libraries. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build +%if %{?fedora}%{!?fedora:0} >= 36 +# Mark some warnings from gcc 12 as not errors +# These are likely bogus - hopefully they can be fixed in gcc updates +%set_build_flags +CXXFLAGS="${CXXFLAGS} -Wno-error=array-bounds -Wno-error=restrict" +%ifarch %{arm} +CXXFLAGS="${CXXFLAGS} -Wno-error=use-after-free" +%endif +%endif + %cmake3 \ %if %{?fedora}%{!?fedora:0} >= 36 -DWITH_OPENSSL3:BOOL=ON \ @@ -659,6 +687,9 @@ fi %doc %{_pkgdocdir} %changelog +* Mon Jan 24 2022 Mattias Ellert - 1:5.4.0-4 +- Fix compiler warnings from gcc 12 + * Sat Jan 22 2022 Fedora Release Engineering - 1:5.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild