Fix stack collection with size limit

src/client/linux/minidump_writer/minidump_writer.cc:273 obtains the
stack info by calling GetStackInfo(). That method will return the
stack base address, aligned to the bottom of the memory page that
'stack_pointer' is in. After that it will cap the size of the memory
area to be copied into the minidump to 'max_stack_len', starting from
the base address, if the caller requested so. This will be the case
when collecting reduced stacks, as introduced by this change:
https://breakpad.appspot.com/487002/

In such cases the caller will request 2048 bytes of memory. However
GetStackInfo() will have aligned the base address to the page
boundary, by default 4096 bytes. If the stack, which grows towards the
base address from the top ends before the 2048 bytes of the first
block, then we will not collect any useful part of the stack.

As a fix we skip chunks of 'max_stack_len' bytes starting from
the base address until the stack_pointer is actually contained in the
chunk, which we will add to the minidump file.

BUG=https://bugs.chromium.org/p/google-breakpad/issues/detail?id=695
R=ivanpe@chromium.org

Review URL: https://codereview.chromium.org/1959643004 .

Patch from Lars Volker <lv@cloudera.com>.
1 file changed
tree: 5f6a4526979c4003709da7f74a9ad4f7f0efba63
  1. android/
  2. autotools/
  3. docs/
  4. m4/
  5. scripts/
  6. src/
  7. .gitignore
  8. .travis.yml
  9. aclocal.m4
  10. AUTHORS
  11. breakpad-client.pc.in
  12. breakpad.pc.in
  13. ChangeLog
  14. codereview.settings
  15. configure
  16. configure.ac
  17. DEPS
  18. INSTALL
  19. LICENSE
  20. Makefile.am
  21. Makefile.in
  22. NEWS
  23. README.ANDROID
  24. README.md
README.md

Breakpad

Breakpad is a set of client and server components which implement a crash-reporting system.

Getting started in 32-bit mode (from trunk)

# Configure
CXXFLAGS=-m32 CFLAGS=-m32 CPPFLAGS=-m32 ./configure
# Build
make
# Test
make check
# Install
make install

If you need to reconfigure your build be sure to run make distclean first.

To request change review:

  1. Get a copy of depot_tools repo. http://dev.chromium.org/developers/how-tos/install-depot-tools

  2. Create a new directory for checking out the source code. mkdir breakpad && cd breakpad

  3. Run the fetch tool from depot_tools to download all the source repos. fetch breakpad

  4. Make changes. Build and test your changes. For core code like processor use methods above. For linux/mac/windows, there are test targets in each project file.

  5. Commit your changes to your local repo and upload them to the server. http://dev.chromium.org/developers/contributing-code e.g. git commit ... && git cl upload ... You will be prompted for credential and a description.

  6. At https://codereview.chromium.org/ you'll find your issue listed; click on it, and select Publish+Mail, and enter in the code reviewer and CC google-breakpad-dev@googlegroups.com