Skip to content

Conversation

@hahnjo
Copy link
Member

@hahnjo hahnjo commented Aug 15, 2022

The overload taking a path opens the file and then mmap its contents. This can cause bus errors when another process truncates the file while we are trying to read it. Instead just read the first 1024 bytes, which should be enough for identify_magic to do its work.

(cherry picked from commit 588e13c)

Backport of PR #11174

The overload taking a path opens the file and then mmap its contents.
This can cause bus errors when another process truncates the file
while we are trying to read it. Instead just read the first 1024 bytes,
which should be enough for identify_magic to do its work.

(cherry picked from commit 588e13c)
@hahnjo hahnjo self-assigned this Aug 15, 2022
@hahnjo hahnjo requested a review from Axel-Naumann as a code owner August 15, 2022 11:47
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac1015/cxx17, mac11/cxx14, windows10/cxx14
How to customize builds

@hahnjo hahnjo changed the title [cling] Try to avoid crashes in llvm::identify_magic [cling] Try to avoid crashes in llvm::identify_magic [v6.26] Aug 15, 2022
@hahnjo hahnjo merged commit f9681d0 into root-project:v6-26-00-patches Aug 15, 2022
@hahnjo hahnjo deleted the cling-identify-v626 branch August 15, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants