summaryrefslogtreecommitdiff
path: root/sal
AgeCommit message (Collapse)Author
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01Support signal handlers registered with SA_SIGINFOStephan Bergmann
...as is the case for external/breakpad's google_breakpad::ExceptionHandler::SignalHandler (though that one appears to be careful to check that its additional arguments are not garbage, cf. the "Sometime, Breakpad runs inside a process where some other buggy code..." comment in workdir/UnpackedTarball/breakpad/src/client/linux/handler/exception_handler.cc). Seen when JunitTest_framework_complex run under ASan/UBSan happened to trigger an assert, > soffice.bin: vcl/source/app/dbggui.cxx:47: void ImplDbgTestSolarMutex(): Assertion `ImplGetSVData()->mpDefInst->CheckYieldMutex() && "SolarMutex not locked"' failed. > sal/osl/unx/signal.cxx:349:13: runtime error: call to function google_breakpad::ExceptionHandler::SignalHandler(int, siginfo_t*, void*) through pointer to incorrect function type 'void (*)(int)' > (instdir/program/libsofficeapp.so+0xb7eab0): note: google_breakpad::ExceptionHandler::SignalHandler(int, siginfo_t*, void*) defined here > #0 0x7f6cefc21693 in (anonymous namespace)::callSystemHandler(int) sal/osl/unx/signal.cxx:349:13 > #1 0x7f6cefc1f3e1 in (anonymous namespace)::signalHandlerFunction(int) sal/osl/unx/signal.cxx:422:9 > #2 0x7f6cedbc95bf (/lib64/libpthread.so.0+0x115bf) > #3 0x7f6ced20491e in __libc_signal_restore_set /usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:79 > #4 0x7f6ced20491e in __GI_raise /usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/raise.c:55 > #5 0x7f6ced206519 in __GI_abort /usr/src/debug/glibc-2.24-33-ge9e69e4/stdlib/abort.c:89 > #6 0x7f6ced1fcda6 in __assert_fail_base /usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:92 > #7 0x7f6ced1fce51 in __GI___assert_fail /usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:101 > #8 0x7f6cb60cdad5 in ImplDbgTestSolarMutex() vcl/source/app/dbggui.cxx:47:5 > #9 0x7f6cbd337fb9 in DbgTestSolarMutex() tools/source/debug/debug.cxx:74:9 > #10 0x7f6cb3c98abf in vcl::Window::ReleaseGraphics(bool) vcl/source/window/window.cxx:900:5 ... Change-Id: I2625541e0b9e50f9723e61e0cbff0e6c77d0fb9f
2017-01-31Work around GCC -Wunused-resultStephan Bergmann
(cf. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425> "(void) cast doesn't suppress __attribute__((warn_unused_result))"). Interestingly, this only occurs with GCC 7, look like <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70365> "warn_unused_result doesn't warn when the result is a class with a destructor" is fixed now. Change-Id: I7b4a066d0bf59080e47404d718917b5f38a98832
2017-01-27sal: add SAL_NO_ASSERT_DIALOGS variable to redirect...Michael Stahl
... the dialogs that pop up on assert() and abort() to stderr, which should work better in CI builds. Change-Id: I80ec95bae6cc21b8ac27f68ca93aa6c6cce707f4
2017-01-25loplugin: unnecessary destructor oox..saxNoel Grandin
Change-Id: Ie12bfabc92bce04d702f3e77aa5896366e49245e Reviewed-on: https://gerrit.libreoffice.org/33509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-22coverity#1399029 silence Out-of-bounds readCaolán McNamara
Change-Id: I025e416a6a162316d82cfbde9fbfcb0a45e888d5
2017-01-20tweak high/low bit so we're always shifting with an unsigned numberCaolán McNamara
Change-Id: Ic1c3f1f8aa6a16befb348652b0f5c3f82f47e0e7
2017-01-17replace #ifdef SOLARIS with #ifdef __sunMichael Stahl
Check for a macro that is defined by the compiler, we don't really need one defined by the build system. Change-Id: Iccb8e3198396881395c97a6b81690ebe64b7e9d2
2017-01-15FreeBSD PPC: Missing patchPedro Giffuni
Submitted by: Curtis Hamilton (cherry picked from commit 55ffac651c9996916680cdc05b32eb1b091a5ccf) Change-Id: I160ff9369a563d58469682ed96e25c792184708c
2017-01-11loplugin:stringconstant: handle OStringBuffer::appendStephan Bergmann
Change-Id: I283da52c0ee2b63c19e31e9a61ab24997c037a6a
2017-01-11loplugin:externvar (clang-cl)Stephan Bergmann
Change-Id: I81877e46cf95dcc7de16b797fca33658036bf9e8
2017-01-11Some loplugin:conststringvar/stringconstant improvements: salStephan Bergmann
Change-Id: I8b5d81c2b51f846a24fd1f7f9cdd831f1ea54ea5
2017-01-10fix windows buildNoel Grandin
VS2013 does not like stack-allocated arrays with runtime size Change-Id: I58bd3a9feb6e2bef1b4a4f775669e5e3e03de5f7 Reviewed-on: https://gerrit.libreoffice.org/32922 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-10New loplugin:conststringvar: salStephan Bergmann
Change-Id: Ia66415ff9ee67958e84cfff7eda082cdbfc9b9b9
2017-01-10rename SAL_DEBUG_TRACE to SAL_DEBUG_BACKTRACENoel Grandin
since "trace" is such a generic term, this makes it easier to actually find the feature when you need it. And add feature to limit stack depth of the reported backtrace. Change-Id: Iab3e4ceb2e8480e7b5e2b920eb6c5d7631e21c43 Reviewed-on: https://gerrit.libreoffice.org/31752 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09New loplugin:externvar: salStephan Bergmann
Change-Id: Iefc33784f21e7a0b88c8d6308618926e38ab8554
2017-01-05Replace side-effect--only uses of makeStringAndClear() with setLength(0)Stephan Bergmann
Change-Id: Iaf8011f1bd6a10b324653899b7f51458f7d0b68a
2017-01-01ofz#358 SJIS_84 table mnLeadEnd is out by oneCaolán McNamara
sjis 82 and 83 correctly denote the last index available while 84 reports one past the last available index 0x84BE is the last value to map, not 0x84BF Change-Id: Idcadc2d554ee59586f6e2f2775301fe69c94d55a
2016-12-30cleanup tailing backslashesJochen Nitschke
Change-Id: Idb4bfc97e7d758c58118742affd9a9345c7a99f2 Reviewed-on: https://gerrit.libreoffice.org/32491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-23tdf#97283: Merge sal rtl tests to one makefileMatúš Kukan
Change-Id: I1b78276e08feef9b6f49e5abe002391c50a8d2cc Reviewed-on: https://gerrit.libreoffice.org/32143 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Matúš Kukan <matus@libreoffice.org>
2016-12-23tdf#97283: Merge sal osl tests to one makefileMatúš Kukan
Leave sal_osl_security alone because it does not use CPPUNIT_PLUGIN_IMPLEMENT. Change-Id: Iced8bb80c3ae661d371c087d7178a373ffd802e0 Reviewed-on: https://gerrit.libreoffice.org/32142 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Matúš Kukan <matus@libreoffice.org>
2016-12-20Don't malloc between for and execStephan Bergmann
...at least macOS doesn't like that; change from OSL_TRACE (effectively doing nothing unless running a debug build with SAL_LOG=+INFO) to SAL_INFO (calling std::stringstream -> malloc in debug builds, regardless of SAL_LOG env var) in a005fbeddc4e615cfff56a9bd84355f8d42c1c8c "OSL_TRACE->SAL in framework..sal" made the mistake obvious. Change-Id: I43d35524a0861998a1ef58c6f448085a2fb01cd5
2016-12-20keep salinit for non-DESKTOP but not for ANDROID/IOSCaolán McNamara
Change-Id: I6b97345c9d927d1ae1d89f85611c2b5de7b5f0d4
2016-12-20salinit for non-DESKTOP tooCaolán McNamara
Change-Id: Icb368b676199038bf8588b42ef50a2796468d185 Reviewed-on: https://gerrit.libreoffice.org/32228 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-20bootstrap building with --disable-dynloading on standard linuxCaolán McNamara
Change-Id: I5baf70f0053612cba8b74f54aff11ce25cdeb95a Reviewed-on: https://gerrit.libreoffice.org/32202 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-20add an option to pipe log output to fileMarkus Mohrhard
The target file and the option are controlled by SAL_LOG_FILE. The variable should contain the target file in a system dependent notation. Change-Id: Ie1ce9c39740c8b7a989e5af222be21a3e3142084 Reviewed-on: https://gerrit.libreoffice.org/32176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-12-19this textenc hack is for android and disable-dynamic-loadingCaolán McNamara
Change-Id: If2191161e82fc1e05b1442ae4b3b729cc1b8994d Reviewed-on: https://gerrit.libreoffice.org/32038 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-17Make OUStringLiteral more usefulStephan Bergmann
...by: * making the OUStringLiteral ctor non-explicit (to be exploited in a follow-up commit) * adding (LIBO_INTERNAL_ONLY) overloads to OUString/OUStringBuffer functions that can now take OUStringLiteral in addition to taking "real" string literals (Keeping the number of overloads smaller by replacing the ConstCharArrayDetector overloads with ones taking OUStringLiteral (for LIBO_INTERNAL_ONLY, at least) and relying on the now-implicit conversion from "real" string literals to OUStringLiteral unfortunately would not work: Both OUString and OUStringLiteral argubably need implicit conversions from "real" string literals, so any function overloaded for OUString and OUStringLiteral would be ambinguous when called with a "real" string literal. And removing the OUString ctor taking a "real" string literal and relying on an implicit conversion chain from "real" string literal to OUStringLiteral to OUString doesn't work because it would involve two user- provided conversions.) Change-Id: I14433fc1605b048807f60b3a3e14f92221d3a226 Reviewed-on: https://gerrit.libreoffice.org/32097 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-16-Werror,-Wstrict-prototypes (clang-cl)Stephan Bergmann
(sal/inc/rtllifecycle.h only hits on Windows as that is the only platform that happens to actually include it in a C compilation unit, sal/osl/w32/dllentry.c) Change-Id: I2878b52daf713ea45eaa2968cc5d2686b86abfe6
2016-12-16Typo in meant-to-be-overloading function nameStephan Bergmann
Change-Id: I65ab9176b39a436afce23e6bd4423ebf76219166
2016-12-15teach sallogareas plugin to catch inconsistenciesNoel Grandin
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a Reviewed-on: https://gerrit.libreoffice.org/32004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-14I guess FREEBSD doesn't need this implementation of fcvtStephan Bergmann
The only actual use of fcvt across the codebase has been removed in 2002 with 31cb31335f3bf7e6e57d70ca61bf5a2a536d1e6e "GetStringFromDouble: replaced that fcvt() and temporary LocaleDataWrapper instance crap" even before this implementation for FREEBSD was introduce in 2003 with c61bf41c39daa97d30016eedcd7a0b687c2d8558 "INTEGRATION: CWS ooo11rc: join: from ooo11beta2". Change-Id: Ieea9499f001c6eac6383c344afb9050dfc70f43c
2016-12-13Reuse existing sal.osl log areaStephan Bergmann
Change-Id: Ib1fc80c79355322489b7ebd37cbbbbb6614ec67a
2016-12-13fix windows build after OSL_TRACE->SAL changesNoel Grandin
Change-Id: I345343f84f66299e8b91b31af0290ed0c622bf8d
2016-12-13OSL_TRACE->SAL in avmedia..canvasNoel Grandin
Change-Id: Id9077ea29e7028c12f40abfd4c57756c863e3cd9
2016-12-13OSL_TRACE->SAL in framework..salNoel Grandin
Change-Id: I9a897af88aa9f6f7ca98ce521c69b5a4ee8462e9 Reviewed-on: https://gerrit.libreoffice.org/31903 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-12[API CHANGE] Remove salcpprt static libraryStephan Bergmann
...containing replacements for global operator new/delete (that can be linked into executables), but which is no longer used. The mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2012-March/028690.html> "operator new no longer routes through rtl_AllocMemory in libsalcpprt under gbuild link rules" has the details of how this was used on some platforms (but not on others) before the switch to gbuild, and has been "lost" ever since---but apparently a loss not mourned much over the years. For the SDK, c5f974287fd04bb529de145113133b9e35687702 "INTEGRATION: CWS jsc3: #i62434# copy libsalcpprt.a" added the library (under Linux) and 6db9c5af960f9787e33e4addc56bddbb1695a402 "INTEGRATION: CWS jsc3: #i62434# extend link options for executbales to link libsalcpprt.a, LINUX only" added its use to odk/settings/settings.mk, but fc0ca57f2cd649c6330171445a06b80e2143a0e9 "INTEGRATION: CWS jsc21" removed that use again (for no documented reason). So this is an incompatible change, but unlikely to actually affect any users of the SDK. Change-Id: Ia38b4c439f21fca3f5d9af7d1a34054e992054e9 Reviewed-on: https://gerrit.libreoffice.org/31810 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-06Comment cppcheck accessForwarded as harmlessStephan Bergmann
Change-Id: I2692ba63f010b61e7b4c1fe54368f4dac9c42d60
2016-12-06new loplugin/rewriter comparisonwithconstantNoel Grandin
As per sberg' suggestion Limit it to == and !=, because some people like the flow of inequalities like: "0 < a && a < 42" The changes to sal/ were made using the rewriter. The rewriter still has one bug, in pipe.cxx, it managed to pick up some random piece of macro. No idea why. Change-Id: I01305f9c5396a4b6c7421d6e92f1b4b529388e82 Reviewed-on: https://gerrit.libreoffice.org/30962 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-01loplugin:unnecessaryoverride (dtors) in salStephan Bergmann
Change-Id: I498bb634f2a5800f5effab99227aa4699ed91aae
2016-11-29Don't change ustrHostname in case of errorStephan Bergmann
Change-Id: I78e85db2794b01286be49e1be70b53ac4f058cbe
2016-11-25loplugin:stringconstant: look into 'char const * const var = "..."'Stephan Bergmann
Change-Id: I52a97b8ec273509131c2200e47527221cb62d7ee
2016-11-23Remove dead sal/workben/ stuffStephan Bergmann
All this is probably dead for ages, yet it repeatedly got modified over the years by clean-up commits, be they driven by cppunit or grep. Change-Id: I69443f5b25f24bb5735e7179c915f27b4742fcb5
2016-11-22trivial makefile cleanupsMichael Stahl
Change-Id: Ida5bdfa06ecd7907305f4f171ca5ab64260d0259
2016-11-21remove dep on unotest from osl_Pipe testDavid Tardon
Change-Id: I5f5862a684e52bd3d1336fa9f8cffa77cdebbe4c
2016-11-21fix for 'warning C4702: unreachable code'Jochen Nitschke
on windows vista and higher only Change-Id: I19cc63ad7e96b58fa8eb341801f5ad55260abf85 Reviewed-on: https://gerrit.libreoffice.org/31021 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08Use the larger stack size for ASan/UBSan builds on macOS, tooStephan Bergmann
At least on my macOS 10.12.1, PTHREAD_STACK_MIN is 8192 (so stacksize was substantially smaller than 12MB), and without this change there were randomly looking failures in e.g. JunitTest_chart2_unoapi with a -fsanitize=address build. Change-Id: Icfe989a0e5097a9a0ae76c6e0f6ffcca18271245
2016-11-02loplugin:unusedfieldsNoel Grandin
Change-Id: I96634c18ba6600f8f7d5d04a162dcd7e1e312923 Reviewed-on: https://gerrit.libreoffice.org/30474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-01loplugin:oncevar in sal..scriptingNoel Grandin
Change-Id: Id9ab12f3a61eb83a2288b2fd4d99ab77f5833e1b Reviewed-on: https://gerrit.libreoffice.org/30461 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-26sal::detail::logFormat is no longer neededStephan Bergmann
...since 97354578d7195bce927f0c00c4e2ae9cd7344776 "Remove the obsolete functionality originally underlying osl/diagnose.h" Change-Id: I7c920bca9cdddb37fcbbc15d8629d01c21eb0787