we don't need the reg or store libraries for fuzzing

possibly other configations too, but just for fuzzing for the moment

from looking at:
https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_libreoffice/latest
and see what is built but is 0% coverage and uninteresting to be non-0

Change-Id: Ia7afdfc033dd8a705d85c76b246dc5dfb259b063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-02-13 14:59:48 +00:00
parent 1db5b87fe6
commit ca1c8b4471
4 changed files with 24 additions and 4 deletions

View file

@ -17,6 +17,8 @@
#include <utility>
#include <vector>
#include <config_fuzzers.h>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/container/ElementExistException.hpp>
@ -1364,7 +1366,9 @@ void cppuhelper::ServiceManager::readRdbFile(
static_cast< cppu::OWeakObject * >(this));
}
SAL_INFO("cppuhelper", "Ignored optional " << uri);
} catch (css::registry::InvalidRegistryException & e) {
}
#if !ENABLE_FUZZERS
catch (css::registry::InvalidRegistryException & e) {
if (!readLegacyRdbFile(uri)) {
throw css::uno::DeploymentException(
"InvalidRegistryException: " + e.Message,
@ -1375,8 +1379,10 @@ void cppuhelper::ServiceManager::readRdbFile(
throw;
}
}
#endif
}
#if !ENABLE_FUZZERS
bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) {
Registry reg;
switch (reg.open(uri, RegAccessMode::READONLY)) {
@ -1511,6 +1517,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings(
strings->push_back(names.getElement(i).copy(prefix.getLength()));
}
}
#endif
void cppuhelper::ServiceManager::insertRdbFiles(
std::vector< OUString > const & uris,

View file

@ -12,13 +12,19 @@ $(eval $(call gb_Library_Library,unoidl))
$(eval $(call gb_Library_add_defs,unoidl,-DLO_DLLIMPLEMENTATION_UNOIDL))
$(eval $(call gb_Library_add_exception_objects,unoidl, \
unoidl/source/legacyprovider \
unoidl/source/sourcefileprovider \
unoidl/source/sourcetreeprovider \
unoidl/source/unoidl \
unoidl/source/unoidlprovider \
))
# drop legacy provider for fuzzing
ifeq (,$(filter FUZZERS,$(BUILD_TYPE)))
$(eval $(call gb_Library_add_exception_objects,unoidl, \
unoidl/source/legacyprovider \
))
endif
$(eval $(call gb_Library_add_grammars,unoidl, \
unoidl/source/sourceprovider-parser \
))

View file

@ -14,6 +14,8 @@
#include <utility>
#include <vector>
#include <config_fuzzers.h>
#include <osl/file.h>
#include <osl/file.hxx>
#include <osl/mutex.hxx>
@ -21,7 +23,9 @@
#include <rtl/ustring.hxx>
#include <unoidl/unoidl.hxx>
#if !ENABLE_FUZZERS
#include "legacyprovider.hxx"
#endif
#include "sourcefileprovider.hxx"
#include "sourcetreeprovider.hxx"
#include "unoidlprovider.hxx"
@ -211,11 +215,16 @@ rtl::Reference< Provider > Manager::loadProvider(OUString const & uri) {
try {
return new detail::UnoidlProvider(uri);
} catch (FileFormatException & e) {
#if !ENABLE_FUZZERS
SAL_INFO(
"unoidl",
"FileFormatException \"" << e.getDetail() << "\", retrying <" << uri
<< "> as legacy format");
return new detail::LegacyProvider(*this, uri);
#else
(void)e;
return nullptr;
#endif
}
}

View file

@ -148,8 +148,6 @@ fuzzer_core_libraries = \
i18nlangtag \
xmlreader \
unoidl \
reg \
store \
gcc3_uno \
salhelper \
sal \