Skip to content

[IO] Fix out of bounds read in TClassEdit#7920

Merged
eguiraud merged 1 commit intoroot-project:masterfrom
eguiraud:fix_outofbounds_read
Apr 20, 2021
Merged

[IO] Fix out of bounds read in TClassEdit#7920
eguiraud merged 1 commit intoroot-project:masterfrom
eguiraud:fix_outofbounds_read

Conversation

@eguiraud
Copy link
Copy Markdown
Contributor

When doing I/O of RVec objects, TClassEdit::STLArgs was accessing
an element one after the end of a static array. asan rightly complains.

This commit fixes #7903,
which contains more details.

@eguiraud eguiraud requested review from hageboeck and pcanal April 19, 2021 13:37
@eguiraud eguiraud self-assigned this Apr 19, 2021
@eguiraud eguiraud requested a review from Axel-Naumann as a code owner April 19, 2021 13:37
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

Copy link
Copy Markdown
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fix the current bug. What I'm not sure about is whether there might be more cases that have to be handled?

@eguiraud
Copy link
Copy Markdown
Contributor Author

We test RVec I/O and it works. Unless Philippe knows off the top of his head, we'll fix other bugs when we encounter them.

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-04-19T15:21:56.583Z] FAILED: core/thread/G__Thread.cxx lib/Thread.pcm
  • [2021-04-19T15:21:56.843Z] /Users/sftnight/build/workspace/root-pullrequests-build/build/include/ROOT/TReentrantRWLock.hxx:26:10: fatal error: 'tbb/enumerable_thread_specific.h' file not found

@eguiraud eguiraud force-pushed the fix_outofbounds_read branch from f821720 to 031146e Compare April 19, 2021 15:50
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora31/noimt.
Running on root-fedora-31-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T15:51:37.101Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  • [2021-04-19T15:51:40.093Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora30/cxx14.
Running on root-fedora30-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T15:51:39.582Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  • [2021-04-19T15:51:39.582Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1014/python3.
Running on macphsft17.dyndns.cern.ch:/build/jenkins/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T16:06:48.207Z] /build/jenkins/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
  • [2021-04-19T16:06:48.207Z] /build/jenkins/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-2.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T15:54:30.617Z] /mnt/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  • [2021-04-19T15:54:30.888Z] /mnt/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T16:52:05.647Z] /data/sftnight/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  • [2021-04-19T16:52:11.007Z] /data/sftnight/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T18:17:40.702Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  • [2021-04-19T18:17:45.695Z] /home/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on mac11.0/cxx17.
Running on macphsft23.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Warnings:

  • [2021-04-19T17:59:04.987Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
  • [2021-04-19T17:59:05.811Z] /Users/sftnight/build/workspace/root-pullrequests-build/root/core/foundation/src/TClassEdit.cxx:565:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]

When doing I/O of RVec objects, TClassEdit::STLArgs was accessing
an element one after the end of a static array. asan rightly complains.

This commit fixes root-project#7903,
which contains more details.
@eguiraud eguiraud force-pushed the fix_outofbounds_read branch from 031146e to 6e30d2d Compare April 20, 2021 10:04
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/DenseMapInfo.h(52,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\Frontend\HeaderIncludeGen.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Frontend\obj.clangFrontend.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\utility(102,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\DeclCXX.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/PointerIntPair.h(165,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\lib\Transforms\Scalar\SROA.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Transforms\Scalar\LLVMScalarOpts.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\CodeGen\CGCoroutine.cpp(674,62): fatal error C1060: compiler is out of heap space [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\CodeGen\obj.clangCodeGen.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\type_traits(1420,45): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\lib\Target\NVPTX\NVPTXUtilities.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Target\NVPTX\LLVMNVPTXCodeGen.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility(545,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\Frontend\Rewrite\FrontendActions.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\Frontend\Rewrite\obj.clangRewriteFrontend.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/ADT/STLExtras.h(899,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\lib\Transforms\IPO\LowerTypeTests.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Transforms\IPO\LLVMipo.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\include\llvm/Support/Casting.h(124,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\AST\CommentSema.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\AST\obj.clangAST.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\lib\Transforms\Utils\Local.cpp(2957,1): fatal error C1060: compiler is out of heap space [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\lib\Transforms\Utils\LLVMTransformUtils.vcxproj]
  • [2021-04-20T11:43:08.155Z] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\type_traits(229,1): fatal error C1060: compiler is out of heap space (compiling source file C:\build\workspace\root-pullrequests-build\root\interpreter\llvm\src\tools\clang\lib\CodeGen\BackendUtil.cpp) [C:\build\workspace\root-pullrequests-build\build\interpreter\llvm\src\tools\clang\lib\CodeGen\obj.clangCodeGen.vcxproj]

And 50 more

@eguiraud
Copy link
Copy Markdown
Contributor Author

Windows failure is unrelated, I finally got it right, merging

@eguiraud eguiraud merged commit 47facd6 into root-project:master Apr 20, 2021
@eguiraud eguiraud deleted the fix_outofbounds_read branch April 20, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid read in TClassEdit

4 participants