Check if info.dli_sname is NULL,
If the image containing addr is found, but no nearest symbol was found, the dli_sname and dli_saddr fields are set to NULL.
sprintf poses two security risks:
(1) write to memory where it shouldn't
(2) read from memory where it shouldn't
This commit replaces the use of sprintf() with snprintf()
which has a size parameter to ensure the problems mentioned
above won't take place.
* Prepend the year to each glog line (#516)
This PR fixes issue #516 by prepending the year to each glog line.
Previous format of each line in a log file:
[IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
New format:
[IWEF]yyyymmdd hh:mm:ss.uuuuuu threadid file:line] msg
* Fix logging_unittest for PR #530
Since the format of each glog line has been changed,
the logging_unittest must also be updated.
Currently the user has to rely on the HAVE_SYMBOLIZE detection inside
CMakeLists.txt without having any control over whether it should be used.
Add support for disabling HAVE_SYMBOLIZE at configure time so user can specify
`cmake -DHAVE_SYMBOLIZE=0`.
Signed-off-by: Ed Baunton <ebaunton1@bloomberg.net>
* Add target existence checks to Unwind find module
The build systems of projects depending on Glog may call the Unwind find
module multiple times. In these cases, the current unwind find module tries
to create a duplicate unwind::unwind target, crashing the build. This
patch adds an existence check before target creation to fix this issue.
Signed-off-by: Michael Darr <mdarr@matician.com>
* Alphabetize contributor list
* Fix inconsistent CMake style
Signed-off-by: Michael Darr <medarr@email.wm.edu>
Fallback to using file offsets if no symbol is found, like we do if the
object could not be opened.
This makes backtraces usable even if objects in the trace are stripped,
since the trace can be symbolized by post-processing it with a tool like
asan_symbolize.py.
Note that this is not currently compatible with SymbolizeCallback as
this overwrites the filename in the buffer. The behavior is unchanged
in that case.
Closes: #514
- If the user specifies a custom Logger via SetLogger(), the docs state
that the logging module takes ownership of it. Prior to this change,
the logging library was not deleting a custom logger when the
LogDestination which owns it was destroyed.
This uses strip_include_prefix to avoid leaking private headers
(config.h, port.h). This needs a workaround to prevent a "missing
dependency declarations" error.
* Added fixed log name support, take 2
See https://code.google.com/p/google-glog/issues/detail?id=209 and former https://github.com/google/glog/pull/19 - this is an updated version of that patch.
It adds a flag that allows to switch behavior from base_filename + filename_extension + time_pid_string to base_filename + filename_extension, while still defaulting to the current behavior to avoid breakage in existing code. This change would allow easier log rotation schemes and better control on what's written on disk.
* Ifdef away fcntl on mingw
* Use the defined HAVE_FCNTL instead
* ifdef away tests as well
add have_sys_wait for wait() on mingw.
* OS_WINDOWS bug in fseeking to the end, only triggered here