This is a reland of commit 0808030bee
Original change's description:
> Support PE modules in core files when running core2md
>
> Core files generated from `wine` contain both ELF and PE modules. Module
> format can be guessed by checking the file contents. If the module
> corresponds to PE-file conditions (has specific fields set up as
> described in https://code.google.com/archive/p/corkami/wikis/PE.wiki)
> we'll create a MDCVInfoPDB70 record in the minidump for it, but if
> the file cannot be opened, is too short or is not a PE file, we'll
> fall back to ELF procedure.
>
> Added /src/client/linux/minidump_writer/pe_file.{cc,h} to
> src_client_linux_libbreakpad_client_a_SOURCES and
> src_client_linux_linux_client_unittest_shlib_SOURCES.
> Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'.
>
> Test: build core2md and use it to convert a core file into dmp, validate
> that the generated dmp file can be opened. Ran './configure & make'.
>
> Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe
> Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189
> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Change-Id: I09dd067a39a95f81f48656595e811c263561ebf2
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3695863
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
sprintf is marked as deprecated with Xcode 14.
Bug: 1331345
Change-Id: Ic301134ec0c5e7b9ee9d590ab1423491aad5ccf7
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3692036
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This reverts commit 0808030bee.
Reason for revert: Breaks Android Compile
ld.lld: error: undefined symbol: google_breakpad::PEFile::TryGetDebugInfo(char const*, google_breakpad::_RSDS_DEBUG_FORMAT*)
>>> referenced by minidump_writer.cc
>>> client/minidump_writer.o:((anonymous namespace)::MinidumpWriter::FillRawModule(google_breakpad::MappingInfo const&, bool, unsigned int, MDRawModule*, unsigned char const*)) in archive obj/third_party/breakpad/libclient.a
https://ci.chromium.org/ui/p/chromium/builders/try/android-marshmallow-arm64-rel/1188618/overview
Original change's description:
> Support PE modules in core files when running core2md
>
> Core files generated from `wine` contain both ELF and PE modules. Module
> format can be guessed by checking the file contents. If the module
> corresponds to PE-file conditions (has specific fields set up as
> described in https://code.google.com/archive/p/corkami/wikis/PE.wiki)
> we'll create a MDCVInfoPDB70 record in the minidump for it, but if
> the file cannot be opened, is too short or is not a PE file, we'll
> fall back to ELF procedure.
>
> Added /src/client/linux/minidump_writer/pe_file.{cc,h} to
> src_client_linux_libbreakpad_client_a_SOURCES and
> src_client_linux_linux_client_unittest_shlib_SOURCES.
> Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'.
>
> Test: build core2md and use it to convert a core file into dmp, validate
> that the generated dmp file can be opened. Ran './configure & make'.
>
> Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe
> Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189
> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Change-Id: I7105ed615a338263f112243bd8dc9e86b906fcb1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3695862
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
Core files generated from `wine` contain both ELF and PE modules. Module
format can be guessed by checking the file contents. If the module
corresponds to PE-file conditions (has specific fields set up as
described in https://code.google.com/archive/p/corkami/wikis/PE.wiki)
we'll create a MDCVInfoPDB70 record in the minidump for it, but if
the file cannot be opened, is too short or is not a PE file, we'll
fall back to ELF procedure.
Added /src/client/linux/minidump_writer/pe_file.{cc,h} to
src_client_linux_libbreakpad_client_a_SOURCES and
src_client_linux_linux_client_unittest_shlib_SOURCES.
Makefile.in and aclocal.m4 were generated by running 'aclocal && automake'.
Test: build core2md and use it to convert a core file into dmp, validate
that the generated dmp file can be opened. Ran './configure & make'.
Change-Id: I225ffeea3f582deed40ecdfe7ab77f5754e90cbe
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3629189
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
https://crrev.com/c/3327644 introduced the ability for dump_syms to
operate on in memory data, which has the consequence of not going
through the same input validation as the dump_syms cli tool. In certain
cases, it is possible that architecture info can't be reliably
determined, e.g. new architectures that breakpad is unware of. In that
case, dump_syms should avoid crashing when calling ReadSymbolData and
return false instead.
Change-Id: Ie9acdf811300084f1d5916f4778754f8abca10e0
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3572251
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
1. Visit DW_TAG_class_type when it's inside DW_TAG_subprogram.
2. Only warn when we can't get the name for the DIE and it has DW_AT_specification that is not in the specification map.
Bug: 1078932
Change-Id: Id3126aec305658f8f65c01675a8e9e3ea03f3651
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3579855
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Since the introduction of inlined frames, it is not sufficient to check
the stack trace length (== 1) in order to identify context frames.
Updating all location that were depending on this assumption to check
for frame trust level instead.
Change-Id: I98f966889367c2270c268b8e78b67418c89c50f1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3499020
Reviewed-by: Mark Mentovai <mark@chromium.org>
for Windows x64 stacks.
According to https://reviews.llvm.org/D2474, LLVM does't generate unwind info for leaf function which doesn't touch any callee-saved
registers. According to MSDN, leaf functions can be unwound simply by
simulating a return.
Change-Id: Ic0503e2aca90b0ba5799133ea8439f1b5f2eefda
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3489332
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This is needed in order to properly detect and highlight frames that
correspond to multiple functions, for example as the result of identical
code folding by the linker.
Bug: google-breakpad:751
Change-Id: I2ee7c147fcff6493c2454383ad5422b38269759a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3471034
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Inline frames are always of the base-class type (StackFrame). Treating them as derived-class and accessing members was causing heap buffer overflows.
Change-Id: Id4122ab6a31f016933038a1cb63d45d5c38481f5
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425445
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
- don't do iter decrement when the map empty.
- add dummy file with id equals to 0 to represent unknown file.
Change-Id: I3fe55a459c9fa835bbe0c4272e4ac12b1150c034
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3425732
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
In trying to create a backend service that can process both ELF and
Mach-O binaries, I found that symbol collisions occur when trying to
link different implementations of FileID. This change puts the
different implementations into separate namespaces to avoid the
collision.
Change-Id: I15aabb222803f2ffbda15ed13e66793bae32ddce
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3421417
Reviewed-by: Mark Mentovai <mark@chromium.org>
dump_syms assumes it is operating on a file and can access a compliant
file system. This change allows dump_syms to operate on the contents of
a file that has already been read into memory. This is useful in a
server context where the file does not exist on the local file system.
Change-Id: Id63f115c2df287083d548dadd5ac487f97bde057
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3327644
Reviewed-by: Mark Mentovai <mark@chromium.org>
- Make handle_inline default to false in PDBSourceLineWriter constructor.
- Add --i flag for symupload to generate inline information.
Change-Id: I3149173ee635a503b9508a12ef572f8b6e5c5dfe
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3364804
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This adds INLINE and INLINE_ORIGIN records on Window dump_syms. It also
adds more LINE records that represents the inner most callsite line info
inside a function.
Bug: chromium:1190878
Change-Id: I15c2044709f8ca831b03a453910d036f749452c6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3133606
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This was created by running “go mod init upload_system_symbols”. This is
necessary for “go build” to work in recent versions of golang.
Previously, errors such as this were produced:
go: cannot find main module, but found .git/config in …/breakpad/src
to create a module there, run:
cd ../../../.. && go mod init
Change-Id: Ia88834aec2eb8ee01db452889c525a5f6ebefa25
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3345400
Reviewed-by: Robert Sesek <rsesek@chromium.org>
- FastSourceLineResolver::Module::LoadMapFromMemory now rejects an older version of the serialization format.
- Cleaned up several unneeded usages of scoped_ptr::get.
- Fixed the serialization of bool. The serialization code was using 255 for 'true' while the deserialization code was expecting to see 1.
- Serialization for PublicSymbol.is_multiple was missing. Deserialization was expecting it
- Added some logging to processor/source_line_resolver_base.cc
Change-Id: Iadc7d8ee23bf3a07e4ea280d5d4c3f25f6278b69
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3324395
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
- Ignore DW_TAG_inlined_subroutine with empty range.
- Don't stop parsing after parsing malformed INLINE/INLINE_ORIGIN
records, because reports can still be generated without them but won't
have inlined frames.
Bug: 1190878
Change-Id: I445105ad06b9146268f7d064e85b0d162c3f2a39
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3321166
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This adds a new mode in ContainedRangeMap which allows existance of
equal ranges. Among those equal ranges, the most recently added range is
the innermost range.
This also adds a function to ContainedRangeMap and
StaticContainedRangeMap to allow users get a vector of entries that
contains given address from innermost to outermost ranges.
Change-Id: I84c1f2e49ffcaf8238df60e41498730103d1ead6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3291137
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This is a more practical reserved capacity than
std::numeric_limits<int>::max() for the vector.
Change-Id: Ic8d4e812c3804e4f15cc51650f7a91bae7313415
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3301419
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Since GH is mirroring the code directly from our GoB systems, they
aren't triggering push events. Set them up with a daily/weekly cron
so we get some level of coverage.
Change-Id: I9ececc74a4904e0e3060a10ee1acb952e2021240
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3289899
Reviewed-by: Mark Mentovai <mark@chromium.org>
The rust-demangle-capi crate hasn't been updated since 2016 and
out-of-date. Instead, Breakpad needs to use C API offered by the
rustc-demangle to demangle Rust symbols.
*** TESTING ***
1) Set up rustc-demangle
> git clone https://github.com/rust-lang/rustc-demangle.git
> cd rustc-demangle
> cargo build -p rustc-demangle-capi --release
2) Breakpad
> ./configure --with-rustc-demangle=<path to rustc-demangle>
> make check src/common/dward_cu_to_module
Change-Id: Ib68b62ef329f1397bc379a1d04c632781e4b2069
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3273324
Reviewed-by: Joshua Peraza <jperaza@chromium.org>