Commit Graph

445 Commits

Author SHA1 Message Date
Sergiu Deitsch
8775a454c1
feat: make headers self-contained (#1030) 2024-01-04 21:03:55 +01:00
Sergiu Deitsch
dfce35c97c
fix: cleanup exports (#1029)
Reduce unnecessary utility function exports.
2024-01-04 16:57:18 +01:00
Sergiu Deitsch
cafba580ec
feat: use standard atomics and call_once (#1026) 2024-01-04 01:18:36 +01:00
Sergiu Deitsch
54b2c17172
fix: make log severity type safe (#1025) 2024-01-04 00:35:40 +01:00
Sergiu Deitsch
51e7a439dc
feat(demangle): use cxx abi demangler (#1023) 2024-01-03 19:24:35 +01:00
Sergiu Deitsch
bdd14b6ab1
fix(demangle): place symbols in anonymous namespace (#1022) 2024-01-03 16:49:43 +01:00
Sergiu Deitsch
70285fddc7
feat: use chrono (#1020) 2024-01-03 16:00:24 +01:00
Sergiu Deitsch
0032896711
feat: use standard threads (#1019) 2024-01-03 02:24:52 +01:00
Sergiu Deitsch
645d0a5d5f
fix(demangle): support decltype(nullptr) and pack expansion (#1018) 2024-01-02 22:31:00 +01:00
Sergiu Deitsch
45d7978daf
fix(tests): prevent clang from optimizing new away (#1017) 2024-01-02 13:01:42 +01:00
Sergiu Deitsch
b1bc8e75cb
feat: reduce manual deallocations (#1016) 2024-01-02 02:17:23 +01:00
Sergiu Deitsch
8ff1a7db04
feat: use standard mutexes (#1015) 2024-01-02 00:47:22 +01:00
Sergiu Deitsch
ac8f8dae2c
fix: remove unused test code (#1014) 2024-01-02 00:47:02 +01:00
Sergiu Deitsch
93549f3600 chore: apply clang-format 2023-12-30 20:38:56 +01:00
Sergiu Deitsch
e3f5398aa1
rework public header structure (#1012)
Promote generated headers to regular headers. This enables direct
editing of corresponding files and running automatic source code
formatting and static analysis tools, such as clang-format and
clang-tidy on the whole project which previously was not
straightforward.
2023-12-30 19:05:26 +01:00
Sergiu Deitsch
aeee0ef452 fix(symbolize): use correct size_t format specifier
While compiling under Emscripten with _LP64 being 0, Clang complains
that the format specifier does not match the actual type (even though
size_t and unsigned are probably compatible.)
2023-12-30 02:14:49 +01:00
Sergiu Deitsch
546906f467 fix: remove unused include 2023-12-30 01:01:40 +01:00
Sergiu Deitsch
43792b8a13 rework (lib)unwind integration
Allow to switch between the two backends.
2023-12-30 00:50:52 +01:00
Sergiu Deitsch
3c052d90f8 fix: remove executable bit 2023-12-29 17:54:32 +01:00
Sergiu Deitsch
ab2a1a8519
fix: enable strip log tests (#1009) 2023-12-28 02:34:06 +01:00
Sergiu Deitsch
b7686b6995
cmake: remove obsolete check (#1002) 2023-12-21 22:01:35 +01:00
Sergiu Deitsch
d937c2e1b8
fix: shell quote user-provided mailer path (#999) 2023-12-21 19:54:07 +01:00
Acey
716be9edc7
feat: add missing debug logging macros (#986) 2023-12-21 19:45:06 +01:00
Mike Frysinger
6607b369d0
symbolize_unittest: make it a bit more portable (#985) 2023-12-20 21:10:26 +01:00
Sergiu Deitsch
3fcf77a691
fix: drop custom (v)snprintf definition (#992)
The functions are available since C++11.
2023-12-20 20:49:08 +01:00
Sergiu Deitsch
3731c120c0
fix: replace NULL by nullptr (#993) 2023-12-20 20:48:43 +01:00
Sergiu Deitsch
a9eecd7f9a
fix: log last error code instead of a BOOL (#994) 2023-12-20 20:47:57 +01:00
Sergiu Deitsch
b6082e5088
fix: remove redundant POSIX function aliases (#990)
The preprocessor defines interfere with method declarations, e.g., in
std::basic_filebuf, resulting in following error:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\fstream(376,26): error C2039: '_close': is not a member of 'std::basic_filebuf<char,std::char_traits<char>>' [D:\a\glog\glog\build_Debug\logging_unittest.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\iosfwd(244,35): message : see declaration of 'std::basic_filebuf<char,std::char_traits<char>>' [D:\a\glog\glog\build_Debug\logging_unittest.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\fstream(375,10): message : while compiling class template member function 'void std::basic_ofstream<char,std::char_traits<char>>::_close(void)' [D:\a\glog\glog\build_Debug\logging_unittest.vcxproj]
D:\a\glog\glog\src\logging_unittest.cc(788,12): message : see the first reference to 'std::basic_ofstream<char,std::char_traits<char>>::_close' in 'TestBasenameAppendWhenNoTimestamp' [D:\a\glog\glog\build_Debug\logging_unittest.vcxproj]
D:\a\glog\glog\src\logging_unittest.cc(786,12): message : see reference to class template instantiation 'std::basic_ofstream<char,std::char_traits<char>>' being compiled [D:\a\glog\glog\build_Debug\logging_unittest.vcxproj]
2023-12-19 19:08:48 +01:00
Sergiu Deitsch
931323df21
fix: add missing thread_local specifier 2023-10-15 19:10:31 +02:00
LingBin
da9753409b
fix(cleanup): ensure FLAGS_log_dir ends with '/' (#972) 2023-10-12 13:35:52 +02:00
Sergiu Deitsch
b58718f37c
fix(cmake): rework ucontext_t introspection (#954) 2023-10-09 21:35:51 +02:00
Sergiu Deitsch
aebdfd6051
fix: eliminate msvc warning 2023-10-08 19:04:29 +02:00
Huy Q. Bui
4dbc26af72
feat: support log file truncation on windows (#960) 2023-10-08 14:03:10 +02:00
Sergiu Deitsch
615966eb6d
fix: prefer includes in same directory (#969)
Use quoted form instead of angle-bracket form for includes to avoid
conflicts between multiple versions of the library.
2023-10-07 20:15:29 +02:00
Sergiu Deitsch
6a7be64131
fix: remove stray spaces (#967) 2023-10-07 18:58:01 +02:00
Sergiu Deitsch
4a75a9df7c
fix: eliminate type conversion warnings 2023-10-07 16:14:21 +02:00
Deev Patel
e17f932eec
fix: annotate static variable in VLOG_IS_ON (#890)
Avoid TSAN issues when multiple threads perform the check.
2023-10-07 15:35:52 +02:00
Sergiu Deitsch
1dffb4eb29
fix: enable building without threads (#964) 2023-10-06 22:30:31 +02:00
Sergiu Deitsch
747b8a0774
fix(demangle): limit ParseTemplateArg recursion depth (#963) 2023-10-06 21:32:05 +02:00
Sergiu Deitsch
857df01007
fix(demangle): limit recursion depth (#958) 2023-10-06 02:03:43 +02:00
Sergiu Deitsch
319a0dfba4
fix: stack buffer overflow (#957) 2023-10-06 01:47:56 +02:00
Sergiu Deitsch
e567cfc442
fix: address sanitizer failures (#956) 2023-10-06 00:34:38 +02:00
Sergiu Deitsch
7ba2f7bc02
fix(demangle): prevent signed integer overflow (#955) 2023-10-05 23:33:23 +02:00
Sergiu Deitsch
27bf2b2fd3
ci: update to ndk r26 2023-10-05 21:58:43 +02:00
Sergiu Deitsch
fab3b5eac4
ci: support C++23 2023-10-05 21:41:33 +02:00
Philipp Wollermann
64827572c0
SendEmail: Protect users against vulnerable logmailers (#939)
glog is used on a variety of systems, and we must assume that some of
them still use vulnerable mailers that have bugs or "interesting
features" such as https://nvd.nist.gov/vuln/detail/CVE-2004-2771.

Let's protect users against accidental shell injection by validating
the email addresses against a slightly stricter version of the regex
used by HTML5 to validate addresses[1].

This should prevent triggering any unexpected behavior in these tools.

Also add some basic unit tests for the SendEmail method.

[1] https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
2023-09-07 17:31:25 +02:00
Eric Kilmer
22491eb123
logging: Prevent LogStream constructor from being discarded (#925)
Fixes linker error reported in #922
2023-05-25 21:26:33 +02:00
Vertexwahn
4945347d07 Fix spelling mistakes 2023-05-25 20:51:51 +02:00
Brad Smith
aca9a23c83
fixed OpenBSD support (#921)
- Usage of syscall() is not allowed
- Use getthrid() to retreive the thread ID
2023-05-10 13:41:38 +02:00
Sergiu Deitsch
6742834201
move to C++14 (#902) 2023-02-28 12:26:49 +01:00