Commit Graph

1444 Commits

Author SHA1 Message Date
benchan@chromium.org
cef1bee150 Remove unused variable 'kGUIDStringSize' in microdump_writer_unittest.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/3754002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1417 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-01-28 18:33:50 +00:00
hashimoto@chromium.org
cfaf27c37e Stop calling memmove when unnecessary
BUG=chromium:450137
R=mark@chromium.org



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1416 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-01-27 03:27:08 +00:00
erikchen@chromium.org
7bebb27fb4 Fix some fragile code that is likely to cause future memory corruption
problems.

- The ordering of keys in stl containers cannot change. Make the relevant
members const to guarantee this assumption.
- Add handling and logging for demangle errors.
- Fix a potential double-delete bug if a function passed to AddFunction() is
already present.

BUG=chromium:449214
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/10704002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1415 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-01-27 01:20:59 +00:00
erikchen@chromium.org
efa0310455 Fix a source of memory corruption.
This error was causing crashes in official Chrome Mac builds on 10.8.5
machines.

BUG=chromium:449214
R=mark@chromium.org


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1414 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-01-26 23:19:04 +00:00
primiano@chromium.org
c332a1dcba Fix the scope on the initialization of kMicrodumpOnConsole to match header.
I whish I knew how this worked for months in chromium as it is clearly wrong.
As reported by azarchs@ it is breaking the cygprofile instrumented build.

BUG=chromium:410294

Review URL: https://breakpad.appspot.com/1784002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1413 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-01-09 17:58:19 +00:00
wfh@chromium.org
30d41ec243 Modify minidump_stackwalk to be more tolerant of overlapping ranges.
These ranges can be seen in some Android minidumps.

BUG=chromium:439531
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/9744002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1412 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-20 00:47:07 +00:00
jessicag.feedback@gmail.com
ba16fd3ffc Add microdump files to project.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1411 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-11 19:30:37 +00:00
mdempsky@chromium.org
d10c8c18ae Remove pointers from serialized file format
BUG=breakpad:621
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/1764002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1410 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-11 01:17:43 +00:00
mark@chromium.org
bbbe29de11 Breakpad: Fix build with new clang versions.
gcc has a single exception setting for all languages. Saying -fno-exceptions
in gcc disables exceptions and cleanups for cc files, but has no effect for mm
files.

In clang, -fno-exceptions only disables c++ exceptions, but keeps objective-c
exceptions and cleanups enabled.

http://llvm.org/viewvc/llvm-project?view=revision&revision=220714 changed
__EXCEPTIONS to be defined for clang when cleanups are enabled, independent of
if c++ exceptions are enabled. (This was necessary to have clang work with
glibc which looks at __EXCEPTIONS to decide if cleanups are enabled.)

Breakpad tried to use __EXCEPTIONS to figure out if c++ exceptions are enabled.
In cc files, this works: -fno-exceptions will disable c++ exceptions and
cleanups. But in mm files, -fno-exceptions will disable c++ exceptions and
objective-c exceptions will still be enabled, and so cleanups must run and hence
__EXCEPTIONS is defined.

To make things work with both old and new compilers, do the try/catch hack in
mm files either if __EXCEPTIONS is not defined (for old compilers) or if the
compiler is clang and __has_feature(cxx_exceptions) isn't set (which will work
for new clangs too, and which cleanly maps to if c++ exceptions are enabled).

Patch by Nico Weber <thakis@chromium.org>

Review URL: https://breakpad.appspot.com/1774002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1409 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-10 16:08:09 +00:00
mseaborn@chromium.org
10baadae40 dump_syms: Fix handling of DW_FORM_ref_addr to work with DWARF 4
Previously, dump_syms did not handle DW_FORM_ref_addr if it appeared
in DWARF 4 debugging info.

Also fix a DW_FORM_ref_addr case so that it doesn't fall through to
the next switch case when assertions are disabled and the DWARF
version isn't recognised.

The following steps will reproduce the problem when using LLVM 3.4:

cat <<END >example1.c
int main() { return 0; }
END
cat <<END >example2.c
void foo(int x) {}
END

clang -emit-llvm -g -c example1.c -o example1.bc
clang -emit-llvm -g -c example2.c -o example2.bc
llvm-link-3.4 example1.bc example2.bc -o combined.bc
clang combined.bc -o executable
./google-breakpad/build/src/tools/linux/dump_syms/dump_syms executable

When using LLVM bitcode linking in this way, LLVM's backend generates
partially-merged DWARF debugging info in which some of the references
to the "int" type go via "DW_FORM_ref_addr".  Since PNaCl uses LLVM
bitcode linking, this dump_syms failure occurs with nexes produced by
the PNaCl toolchain.

BUG= https://code.google.com/p/chromium/issues/detail?id=416368
TEST= see above
R=mark@chromium.org, mcgrathr@chromium.org

Review URL: https://breakpad.appspot.com/5744002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1408 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-03 20:39:55 +00:00
primiano@chromium.org
0b6cc95246 Microdumps: support aarch64 and lib mapping from APK
- Filter modules by prot flags (only +x) not extensions. It wouldn't
  otherwise catch the case of Chrome mapping the library from the
  apk (which is mapped r-x but doesn't end in .so).
- Use compile-time detection of target arch, in order to cope with
  multilib OSes, where uname() doesn't reflect the run-time arch.
- Add OS information and CPU arch / count.
- Add support for aarch64.
- Add tests and stackwalk expectations for aarch64.
- Fix a potential overflow bug in the processor.
- Rebaseline the tests using smaller symbols.
- Fix microdump_writer_unittest.cc on 32-bit host.

BUG=chromium:410294

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1407 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-12-02 15:31:25 +00:00
ivanpe@chromium.org
63919583ba Surfacing the process create time in google_breakpad::ProcessState
and updating minidump_stackwalk to show process uptime.

I tested this with a minidump from Chrome and I got a result that
is inline with what the Windows debugger is showing for that dump:

minidump_stackwalk output:
--------------------------
Process uptime: 601 seconds

WinDBG output:
--------------
Process Uptime: 0 days 0:10:01.000

I didn't update the machine readable output of minidump_stackwalk
on purpose in order to avoid breaking someone that uses it.
It can be added later to the machine output if needed.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/7754002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1406 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-25 22:45:23 +00:00
primiano@chromium.org
57e5b074f6 Introduce microdump_stackwalk comand line executable
This introduces the microdump_stackwalk binary which takes advantage
of the MicrodumpProcessor to symbolize microdumps.
Its operation is identical to the one of minidump_stackwalk.
This CL, in fact, is also refactoring most of the common bits into
stackwalk_common.

BUG=chromium:410294
R=mmandlis@chromium.org

Review URL: https://breakpad.appspot.com/4704002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1405 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-25 11:36:38 +00:00
primiano@chromium.org
be21ad8190 Fix microdump_writer and add unittest.
This adds some small fixes to the microdump writer and introduces
a unittest.

BUG=chromium:410294
R=mmandlis@chromium.org

Review URL: https://breakpad.appspot.com/2814002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1404 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-25 10:35:53 +00:00
mmandlis@chromium.org
6354cffeb0 Microdump processing implementation
According to design document: http://goo.gl/B3wIRN
This is an initial implementation version, support ARM architecture only.

BUG=chromium:410294
R=primiano@chromium.org

Review URL: https://breakpad.appspot.com/5714003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1403 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-19 21:33:26 +00:00
ivanpe@chromium.org
e469f8cf4b Add parameter --product to symupload.exe
Adding an optional parameter --product to symupload.exe.  If specified it will be passed to the symbol server as POST parameter 'product'.

As part of this, I'm also fixing:
 - Removed the .vcproj file as it can be generated from the .gyp file on demand.
 - error C4335: Mac file format detected.  Fixed the line endings for omap.cc and dia_util.cc.
 - warning C4003: not enough actual parameters for macro 'max'

Symupload.exe was compiled using MSVS 2013 and DIA SDK 12.0.

Review URL: https://breakpad.appspot.com/9734002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1402 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-17 22:47:05 +00:00
mark@chromium.org
6690554c4b Fix UMR and potential crash in Mac dump_syms.
Patch by Robert Sesek <rsesek@chromium.org>

BUG=https://code.google.com/p/google-breakpad/issues/detail?id=614
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/9724002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1401 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-05 17:40:47 +00:00
ted.mielczarek@gmail.com
8127f56dff Read dynamic symbols table even if binary contains debug info
A=Wander Lairson Costa <wcosta@mozilla.com>. R=ted at https://breakpad.appspot.com/9684002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1400 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-03 18:25:43 +00:00
ted.mielczarek@gmail.com
c971cf439c Fix Windows client compilation on mingw.
A=Jacek Caban <jacek@codeweavers.com>, R=ted at http://breakpad.appspot.com/548002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1399 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-11-03 17:05:39 +00:00
primiano@chromium.org
507a09f4de Introduce microdump writer class.
Microdumps are a very lightweight variant of minidumps. They are meant
to dump a minimal crash report on the system log (logcat on Android),
containing only the state of the crashing thread.
This is to deal with cases where the user has opted out from crash
uploading but we still want to generate meaningful information on the
device to pull a stacktrace for development purposes.
Conversely to conventional stack traces (e.g. the one generated by
Android's debuggerd or Chromium's base::stacktrace) microdumps do NOT
require unwind tables to be present in the target binary. This allows
to save precious binary size (~1.5 MB for Chrome on Arm, ~10 MB on
arm64).
More information and design doc on crbug.com/410294

BUG=chromium:410294

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1398 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-28 16:45:14 +00:00
primiano@chromium.org
e20758c298 Fix breakpad on mips and x86_64 for the NDK r10c update.
This change introduces the necessary glue typedefs to deal with the
mismatch introduced by the latest Android NDK (w.r.t. desktop Linux):
- [x86_64] Rename fpregs mxcr_mask -> .mxcsr_mask
- [mips] uc_mcontext.fpregs.fp_r.fp_dregs -> uc_mcontext.fpreg
- [mips] restore the forked user.h

Submitting this on behalf of fdegans@chromium.org

TBR=mark@chromium.org

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1397 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-24 10:58:38 +00:00
primiano@chromium.org
c1c257f4f6 Update breakpad to support Android NDK r10c
Prior to NDK r10c, Breakpad was privately backporting these system
headers. This change is now unforking and removing those headers and
using the ones from the NDK.
Rationale:
 - They are finally available in the NDK, so there is no need to keep
   maintaining a fork (which was necessary up until recently to support
   arm64).
 - These forked headers, as they are today, are not compatible with the
   latest NDK (i.e. this change is required to roll NDK r10c).
   The forked ucontext.h, being removed by this CL, depends on some
   transitional features which are not compatible with the NDK release
   being targeted here.

After this change, the NDK r10c is now required to build Breakpad on
Android. Note that NDK releases are backwards compatible and contain all
the previous API levels, so this change is NOT effectively enforcing to
build against any particular Android SDK.

Submitting this on behalf of fdegans@chromium.org

BUG=chromium:358831
R=mark@chromium.org, primiano@chromium.org, rmcilroy@chromium.org

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1396 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-21 13:50:27 +00:00
primiano@chromium.org
e1be1aa1ec Revert "Remove unecessary headers following NDK r10c update."
This reverts r1394.
Reason for the revert: r1394 is breaking compatibility with previous
NDK (< r10c).

BUG=chromium:358831
R=rmcilroy@chromium.org

Review URL: https://breakpad.appspot.com/6754003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1395 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-21 10:20:41 +00:00
primiano@chromium.org
a1d7ad0c79 Remove unecessary headers following NDK r10c update.
BUG=chromium:358831
R=primiano@chromium.org, rmcilroy@chromium.org

Review URL: https://breakpad.appspot.com/10694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1394 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-21 08:30:28 +00:00
ivanpe@chromium.org
8453125ca5 Fixing the Mac Inspector build by adding the launch_report dependency to the breakpadUtilities dylib project after it got pulled out from Inspector.mm
This fix was provided by Thomas Schweitzer.

R=mark@chromium.org, mmandlis@chromium.org

Review URL: https://breakpad.appspot.com/6754002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1393 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-17 17:44:09 +00:00
primiano@chromium.org
719546275a Refactor .so name detection logic in minidump/linux_dumper.
This is a refactoring of the logic which determines the
module name and path for a given MappingInfo in minidump_writer.cc.
Such logic, which will be soon shared also with the upcoming
microdump_writer.cc, is simply being moved to linux_dumper.cc,
extracting a GetMappingEffectiveNameAndPath method.
No behavioral change is intended.

BUG=chromium:410294
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/7734002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1392 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-17 10:58:23 +00:00
ivanpe@chromium.org
962f1b0e60 The process uptime computation when the Windows out-of-process Crash Generation
Server is used is done by subtracting the crashing process creation time from
the current time when the crash is generated:

  uptime = now - process_creation_time

There was a bug and instead of the process creation time the code was using the
time when the process was registered with the Crash Generation Server.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1744002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1391 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-15 17:15:55 +00:00
ted.mielczarek@gmail.com
df09b1ac29 Linux multiprocess crash reporter: use pipe instead of socketpair in the client
A=Jed Davis <jld@mozilla.com> R=ted at https://breakpad.appspot.com/1724002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1390 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-09 19:34:31 +00:00
ted.mielczarek@gmail.com
a4834470c7 Remove workaround for Linux credential-passing bug
A=Jed Davis <jld@mozilla.com> R=ted at https://breakpad.appspot.com/7724002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1389 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-09 19:34:27 +00:00
primiano@chromium.org
9f150ee33e Microdumps: refactor out common parts of minidump_writer.cc
This change is a pure refactoring of the common bits of minidump_writer.cc
that will be shared soon with the upcoming microdump_writer.cc.
In particular, this CL is extracting the following classes:
- ThreadInfo: handles the state of the threads in the crashing process.
- RawContextCPU: typedef for arch-specific CPU context structure.
- UContextReader: Fills out a dump RawContextCPU structure from the
  ucontext struct provided by the kernel (arch-dependent).
- SeccompUnwinder: cleans out the stack frames of the Seccomp sandbox
  on the supported architectures.
- MappingInfo: handles information about mappings

BUG=chromium:410294
R=mmandlis@chromium.org

Review URL: https://breakpad.appspot.com/4684002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1388 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-10-01 09:51:23 +00:00
thestig@chromium.org
75690d56b2 Fix some nits raised by Timur for r1385.
R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/1734002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1387 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-24 18:44:38 +00:00
thestig@chromium.org
df3257f5cb IWYU in minidump_writer.cc to fix building with libc++ after r1385.
R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/6744002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1386 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-24 18:44:29 +00:00
thestig@chromium.org
37a3b8d997 Linux: Call memset() in a couple places in ExceptionHandler to avoid uninit memory reads under Valgrind.
Also move private static variables into the .cc file.

BUG=chromium:332335
R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/5734002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1385 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-23 20:30:09 +00:00
rmcilroy@chromium.org
b5c662fcfe Fix clang compilation error introduced in r1380.
Fixes:
  .../linux_dumper.cc:308:25: error: address of array 'module->name' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                module->name && module->name[0] == '/' &&
                ~~~~~~~~^~~~

BUG=chromium:394703
R=rmcilroy@chromium.org

Review URL: https://breakpad.appspot.com/5724002

Patch from Simon Baldwin <simonb@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1384 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-22 16:56:20 +00:00
mmandlis@chromium.org
7a6d769eb1 Add inttypes for windows in dump_context
BUG=https://code.google.com/p/google-breakpad/issues/detail?id=606
R=primiano@chromium.org

Review URL: https://breakpad.appspot.com/6734002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1381 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-19 16:19:18 +00:00
rmcilroy@chromium.org
82d0ff76a6 Extend mapping merge to include reserved but unused mappings.
When parsing /proc/pid/maps, current code merges adjacent entries that
refer to the same library and where the start of the second is equal to
the end of the first, for example:

  40022000-40025000 r-xp 00000000 b3:11 827        /system/lib/liblog.so
  40025000-40026000 r--p 00002000 b3:11 827        /system/lib/liblog.so
  40026000-40027000 rw-p 00003000 b3:11 827        /system/lib/liblog.so

When the system linker loads a library it first reserves all the address
space required, from the smallest start to the largest end address, using
an anonymous mapping, and then maps loaded segments inside that reservation.
If the loaded segments do not fully occupy the reservation this leaves
gaps, and these gaps prevent merges that should occur from occurring:

  40417000-4044a000 r-xp 00000000 b3:11 820        /system/lib/libjpeg.so
> 4044a000-4044b000 ---p 00000000 00:00 0
  4044b000-4044c000 r--p 00033000 b3:11 820        /system/lib/libjpeg.so
  4044c000-4044d000 rw-p 00034000 b3:11 820        /system/lib/libjpeg.so

Where the segments that follow this gap do not contain executable code
the failure to merge does not affect breakpad operation.  However, where
they do then the merge needs to occur.  Packing relocations in a large
library splits the executable segment into two, resulting in:

  73b0c000-73b21000 r-xp 00000000 b3:19 786460     /data/.../libchrome.2160.0.so
> 73b21000-73d12000 ---p 00000000 00:00 0
  73d12000-75a90000 r-xp 00014000 b3:19 786460     /data/.../libchrome.2160.0.so
  75a90000-75c0d000 rw-p 01d91000 b3:19 786460     /data/.../libchrome.2160.0.so

Here the mapping at 73d12000-75a90000 must be merged into 73b0c000-73b21000
so that breakpad correctly calculates the base address for text.

This change enables the full merge by also merging anonymous maps which
result from unused reservation, identified as '---p' with offset 0, and
which follow on from an executable mapping, into that executable mapping.

BUG=chromium:394703
R=rmcilroy@chromium.org, thestig@chromium.org

Review URL: https://breakpad.appspot.com/7714003

Patch from Simon Baldwin <simonb@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1380 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-19 15:00:04 +00:00
gunsch@chromium.org
63a2ea9245 GoogleCrashdumpUploader: adds Upload(string*) API to get the HTTP response.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1379 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-18 16:48:49 +00:00
thestig@chromium.org
18b1418b25 Fixes common_unittests build.
Original CL: https://breakpad.appspot.com/5704002/
A=gunsch@chromium.org
R=gunsch@chromium.org

Review URL: https://breakpad.appspot.com/8674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1378 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-17 22:09:21 +00:00
mmandlis@chromium.org
85cc448052 Fix Windows client unittests build: add missing code files
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1377 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-16 19:17:19 +00:00
mmandlis@chromium.org
61d4225325 Making the Mac build of crash_report work again after the last SVN sync
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1376 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-16 19:15:08 +00:00
andresantoso@chromium.org
def0b7a7b0 Mac: Add support for in-process crash reporting to Breakpad.
Add new option BREAKPAD_IN_PROCESS.
If YES, Breakpad will write the dump file in-process and then launch the reporter
executable as a child  process.

Originally reviewed at https://codereview.chromium.org/571523004/

BUG=chromium:414239
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1714002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1375 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-15 22:48:18 +00:00
qsr@chromium.org
c75e316359 This CL initialize NSData in HTTPMultipartUpload.m to nil.
Problem introduced by issue 2764002.

R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/2794002

Patch from Oliver Robin <olivierrobin@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1374 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-12 07:50:35 +00:00
mmandlis@chromium.org
7883a83082 Update processor.gyp file with new files added as part of microdump
processing upcoming implementation.

dump_context.cc and dump_object.cc added in r/1370
microdump_processor.cc and microdump_processor_unittest.cc added in
r/1372

BUG=chromium:410294



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1373 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-10 22:16:29 +00:00
mmandlis@chromium.org
1c822b7768 Introduce stub microdump processor classes.
Adds the interfaces for MicrodumpProcessor (very similar to
MinidumpProcessor) and corresponding unittest stubs.
These stubs are required for multi-side integration and to start
rolling the updated processor library into the dependent projects.

BUG=chromium:410294



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1372 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-10 19:12:30 +00:00
mark@chromium.org
cf22feeecd Rename gyp variable use_titlecase_in_grd_files -> use_titlecase_in_grd.
The name changes in https://codereview.chromium.org/552203002/

Patch by Jacek Oleksy <joleksy@opera.com>.

Review URL: https://breakpad.appspot.com/5694002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1371 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-10 12:47:46 +00:00
mmandlis@chromium.org
54c2560a82 Refactoring in preparation for microdump processing
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1370 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-08 19:10:42 +00:00
mark@chromium.org
a58de86bcd Back out trunk r1367.
Compile error: https://bugzilla.mozilla.org/show_bug.cgi?id=1048091#c15

Review URL: https://breakpad.appspot.com/9694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1369 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-03 13:40:40 +00:00
blundell@chromium.org
1335417f9f Adding possibility for client to upload the file
This CL adds three features that will allow the client to upload the report
file.
Three main modifications are made :
- Allow upload url to have a file:// scheme, and write the HTTP request to file
  in that case
- Split the request in two parts in case of a file:// scheme, the request
  time and the response time. A new API [handleNetworkResponse] is added.
- Give the opportunity to the client to get the configuration NSDictionary
  to be able to recreate the breakpad context at response time.

Patch by Olivier Robin <olivierrobin@chromium.org>

Review URL: https://breakpad.appspot.com/2764002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1368 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-09-01 11:02:57 +00:00
ted.mielczarek@gmail.com
8cde5c5152 Support for multiple upload files in CrashReportSender/HTTPUpload
A=David Major <dmajor@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=1048091

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1367 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-08-28 15:26:59 +00:00
ted.mielczarek@gmail.com
eee1801a91 constructor init list in wrong order in CrashGenerationServer
A=Robert Longson <longsonr@gmail.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=1054632

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1366 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-08-28 15:23:39 +00:00
blundell@chromium.org
12d72ba492 Set 32 bits iOS app to use vm_region_recurse_64.
Using the vm_region_recurse API with a vm_region_submap_info_64
structure leads to a deviation in the structure when reading the user_tag
field.
Switching to the vm_region_recurse_64 API.

Patch by Olivier Robin <olivierrobin@chromium.org>

BUG=crbug/397133

Review URL: https://breakpad.appspot.com/4664002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1363 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-08-11 12:55:23 +00:00
rsesek@chromium.org
9c932f1d0c upload_system_symbols: Use the Go1.3 improvements to debug/macho.
This removes the custom MachO header reading functionality, since the stdlib can
now read Fat files.

R=andybons@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/10684002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1360 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-31 19:11:29 +00:00
rsesek@chromium.org
e2fffff1a4 In Mac dump_syms, allow reading debug data out of both the Mach-O file and the dSYM.
This adds a new |-g <dSYM path>| flag to dump_syms, to specify the dSYM path for
the target Mach-O argument. The UUIDs and architectures of the two paths must
match in order to dump symbols for this "split module."

This reason for this is that for x86_64 binaries on OS X, the CFI data is stored
in the __TEXT,__eh_frame segment of the Mach-O file, and the data is not copied
into the dSYM by dsymutil.  Therefore, just dumping the dSYM doesn't yield CFI
data for x86_64 files, and both the dSYM and the Mach-O file must be dumped in
order to produce a complete Breakpad symbol file. For i386 binaries, the CFI data
is stored in the __DWARF,__debug_frame segment, which is part of the dSYM, so
this isn't necessary.

BUG=https://code.google.com/p/chromium/issues/detail?id=393594
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/6704002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1359 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-25 18:18:59 +00:00
rsesek@chromium.org
dab50e6f6e Add GYP build for the src/tools directory on Mac and Linux.
This GYP-ifies the src/processor and src/common directories on those platforms
as well. The Makefile build uses much more granular unittest executables, so
the new processor_unittests does not yet link because of multiple main() symbols,
but this will be fixed later.

Update issue 575

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/10674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1358 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-24 15:22:51 +00:00
mark@chromium.org
c41b7fc414 Annotate PageAllocator for MSan.
PageAllocator maps memory via sys_mmap(), implemented in
linux_syscall_support.h. We need to explicitly inform MSan that this memory is
initialized.

Patch by Sergey Matveev <earthdok@chromium.org>

BUG=chromium:394028

Review URL: https://breakpad.appspot.com/2744002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1356 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-22 14:24:21 +00:00
rmcilroy@chromium.org
561f818735 Chrome on Android now supports loading the shared library directly from the APK file.
This patch makes two changes to breakpad to enable crash reporting to work correctly when the library is inside another file (an archive):

- Do not filter mappings which map an executable at a non-zero offset.
- If such an executable is mapped look in the ELF information for the
shared object name and use that name in the minidump.

Note this change doesn't care about the archive format and isn't Android
specific (though loading the shared library this way is currently only done on Android).

BUG=390618
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/7684002

Patch from Anton Carver <anton@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1355 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-22 11:34:11 +00:00
ivanpe@chromium.org
b7aa202b54 Both std::tr1::unordered_set and std::unordered_set are not allowed in
Google at this moment.  This change is implementing a workaround that
allows switching to hash_set and hash_map.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/6694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1354 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-21 18:27:43 +00:00
rmcilroy@chromium.org
8703844b3c [Android]: Remove __system_property_get(ro.build.fingerprint) from WriteOSInformation.
__system_property_get has been removed from the Android NDK for 'L' so Breakpad
no longer links. This CL just removes the call in WriteOSInformation because
Chrome already passes the build fingerprint as a crash key called "android_build_fp" in the crash report HTTP POST message.

BUG=394841,393903
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1351 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-18 13:14:37 +00:00
rsesek@chromium.org
6c57bc19a5 Add frame pointer recovery to the AMD64 Stackwalker.
BUG=https://code.google.com/p/chromium/issues/detail?id=393594
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/10664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1350 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-18 00:27:49 +00:00
thestig@chromium.org
d91bd8d23a Change some ELF utils to return the length as a size_t.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/7694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1349 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-17 18:34:18 +00:00
ted.mielczarek@gmail.com
d7d532bf56 Ensure C:/Dumps/ exists in crash_generation_app
A=j.turney
R=ted at https://breakpad.appspot.com/1134002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1348 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-11 18:48:41 +00:00
ted.mielczarek@gmail.com
0a5ebafdf0 Stringify minidump stream_type constants in minidump_dump output
R=mark at https://breakpad.appspot.com/3704002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1347 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-11 10:57:30 +00:00
ted.mielczarek@gmail.com
9e8ffc9fab Don't free pointer in BasicCodeModules::BasicCodeModules before possibly using it
A=Jim Chen <nchen@mozilla.com>
R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=1033006

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1346 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-10 19:16:43 +00:00
mark@chromium.org
21384ad0e2 Fix compilation error in Linux libc++ builds due to use of tr1/.
Patch by Sergey Matveev <earthdok@chromium.org>

BUG=chromium:391792

Review URL: https://breakpad.appspot.com/7674002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1345 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-07 19:23:20 +00:00
qsr@chromium.org
f88336d4a1 Unhook current Breakpad object after handling uncaught NSException.
After handling an uncaught NSException, release the Breakpad object
so there will not be a second crash dump logged.

Prior to this change, for every uncaught NSException handled through
the Breakpad::UncaughtExceptionHandler(), a second crash without
any useful information (generally __cxa_rethrow and std::__terminate)
is recorded.

R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/9664002

Patch from Peter Lee <pkl@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1344 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-07 08:13:23 +00:00
rmcilroy@chromium.org
501673c86b Make crash_handler volatile to prevent compiler optimizing it away.
This bug manifests itself on Android x64 (in ExceptionHandlerTest::ExternalDumper), but is possible on any platform.

The compiler is unaware of the code which runs in the signal handler which reads this variable. Without volatile the compiler is free to optimise away writes to this variable which it believes are never read.

BUG=381142, 346626
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/8664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1343 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-02 10:27:39 +00:00
ivanpe@chromium.org
bf0e00374f Cleanup: hide undefined behavior from the compiler better.
Submitting this on behalf of Paul Pluzhnikov.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/6674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1342 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-07-01 17:50:05 +00:00
mark@chromium.org
ada265ebbd dump_syms: use unordered_set<> instead of set<> for speed.
dump_syms spends a lot of time trying to compare strings.
This change speeds up processing of libwebviewchromium.so by 30% on my linux
machine.

Patch by Junichi Uekawa <uekawa@chromium.org>

Review URL: https://breakpad.appspot.com/2714002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1341 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-26 12:37:15 +00:00
ivanpe@chromium.org
9d62ef9311 Update output for test minidump_dump_test.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/10654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1340 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-25 00:24:01 +00:00
mark@chromium.org
a5da1e193c minidump_dump: bug fixes.
- Convert time_t values to UTC correctly. It is incorrect to cast a uint32_t*
   to time_t* because the two types may have different widths. This is the
   case on many 64-bit systems, where time_t is a 64-bit signed integer.
   Conversion is unified in a single function, and additional uses of time_t
   in minidump files not previously displayed in UTC are now displayed.
 - Interpret the IMAGE_DEBUG_MISC structure correctly.
 - When printing MINIDUMP_SYSTEM_INFO structures, always show the "x86" side
   of the union, and state whether it's expected to be valid. (Existing
   Breakpad-produced non-Windows minidumps for x86_64 use the "x86" side of
   union, but Windows minidumps for x86_64 use the "other" side, so I want to
   print both.)

R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/5674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1339 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-17 18:03:31 +00:00
qsr@chromium.org
fe34e3f9fe Use PAGE_MAX_SIZE. PAGE_SIZE is now a variable size.
This fixes exception_handler.cc:77:8: error: fields must have a constant size:
'variable length array in structure' extension will never be supported
  char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));

BUG=None
TEST=breakpad builds on ios8
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/9654002

Patch from Justin Cohen <justincohen@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1338 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-06 16:20:15 +00:00
pbos@chromium.org
20583f0560 Add virtual dtor to LibcurlWrapper.
LibcurlWrapper is deleted but contains no virtual destructor, triggering
warnings with -Wdelete-non-virtual-dtor in clang++.

R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/7664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1337 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-04 08:54:07 +00:00
mark@chromium.org
91f746ec81 Add missing MD_MISCINFO_FLAGS1_BUILDSTRING. Revise documentation to clarify
that it is not enough to check the size of an MDRawMiscInfo stream to verify
member validity, the flags1 field needs to be consulted as well. Update
minidump_dump to correctly consider the validity of all fields in this
structure.

R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/3694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1336 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-06-03 19:35:41 +00:00
ted.mielczarek@gmail.com
dfdc7d2966 Print more x86-64 registers in minidump_stackwalk
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/7654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1335 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-30 10:51:16 +00:00
thestig@chromium.org
a57c70484d Linux: Fix a memory leak in ExceptionHandler.
BUG=592
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/3684002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1334 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-28 18:01:22 +00:00
thestig@chromium.org
3cef0e5645 Fix a memory leak in DwarfCUToModule::FuncHandler::Finish().
BUG=591
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/2704002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1333 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-28 16:51:52 +00:00
rmcilroy@chromium.org
5421a942f0 Fix minor typo in a comment in r1331.
R=qsr@google.com

Review URL: https://breakpad.appspot.com/3674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1332 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-14 12:19:50 +00:00
rmcilroy@chromium.org
222ef005ed Fix x86_64 Android build after user_fpregs_struct was added to /sys/user.h in newer NDKs
BUG=346626
TBR=mark@chromium.org

Review URL: https://breakpad.appspot.com/2694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1331 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-14 09:49:24 +00:00
gordana.cmiljanovic@imgtec.com
412b68396c [MIPS] Fix core dump related unit tests for Android on MIPS
This change fixes failing unittests in Android on MIPS:
LinuxCoreDumperTest.VerifyDumpWithMultipleThreads
ElfCoreDumpTest.ValidCoreFile

BUG=None
TEST=Running breakpad_unittests on MIPS Android device

Review URL: https://breakpad.appspot.com/3664002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1330 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-14 09:11:35 +00:00
mark@chromium.org
9eb13afd54 [Mac] Remove unused host_info call and supporting calls.
R=blundell@chromium.org

Review URL: https://breakpad.appspot.com/2684002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1329 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-12 19:42:34 +00:00
thestig@chromium.org
31845f2bce Fix the documentation for MinidumpFileWriter::Open().
BUG=581
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/6654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1328 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-12 19:36:46 +00:00
wfh@chromium.org
f05e1037b5 Add required build options to correctly target XP
BUG=588
R=chrisha@chromium.org

Review URL: https://breakpad.appspot.com/5664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1327 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-08 21:17:04 +00:00
rsesek@chromium.org
40cd690901 FD leaks and handle errors better.
Patch from Matthew Dempsky <mdempsky@chromium.org>.
Original review: https://breakpad.appspot.com/5654002/

Review URL: https://breakpad.appspot.com/1674002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1326 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-06 19:52:55 +00:00
rmcilroy@chromium.org
a789d1d26b Add support for CFI based stack walking on Arm64.
This CL adds CFI based stack walking support for Arm64 to BreakPad along with
unit tests.  The Arm64 CFI stack walker is based on the Arm CFI stack walker

BUG=367367,335641,354405
R=blundell@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1325 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-06 09:18:30 +00:00
rsesek@chromium.org
44ba0b2050 Make the Linux CrashGenerationClient an interface.
Also allow it to be set on the ExceptionHandler. This will allow Chromium's
implementation to be properly treated as an out-of-process handler.

BUG=https://code.google.com/p/chromium/issues/detail?id=349600
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/2664002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1324 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-05 20:36:06 +00:00
mmandlis@chromium.org
c96f4d7e01 Fixing a build break on Linux.
R=ivanpe@chromium.org

Review URL: https://breakpad.appspot.com/4654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1323 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-05-01 23:31:44 +00:00
rmcilroy@chromium.org
c2f9501755 Add Arm64 support to dumpsyms.
Adds Arm64 support to dumpsyms, enabling support for EM_AARCH64 elf type and
arm64 registers in DwarfCFIToModule.

BUG=367367,335641,354405
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1322 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-29 09:45:46 +00:00
chrisha@chromium.org
4463365304 Clean up common.gypi.
This removes a handful of redundant variables and GYP includes.

BUG=
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/2654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1321 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-28 21:16:52 +00:00
thestig@chromium.org
3d023a3472 Linux: Check the CRC32 of the debug link file in the symbol dumper.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1644002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1320 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-23 20:52:28 +00:00
wfh@chromium.org
9aaae65466 Change PrintFunctions to print functions in address order and not print duplicate public functions.
BUG=427
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1634002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1319 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-23 17:27:01 +00:00
rmcilroy@chromium.org
1c8e155b3a Skip ElfCoreDumpTest and LinuxCoreDumperTest on Android if no core file is dumped.
On certain versions of Android (specifically JellyBean MR2 on Nexus 7, possibly
others too) no ELF core dump is created for crashing processes.  Check for this
and skip the test if so.

BUG=364943
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/1624003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1318 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-23 10:20:00 +00:00
thestig@chromium.org
d4f5ca2275 minidump-2-core: Allow user to override shared lib basedir.
This CL introduces "--sobasedir" command-line option to minidump-2-core.
By default, paths to shared lib files included in generated core file are
formatted as "/var/lib/breakpad/[GUID]libFoobar.so". By using "--sobasedir",
this will be "[user-supplied-path]libFoobar.so".

This option can be used to ease debugging minidump files from developer's local
builds. By specifying "minidump-2-core --sobasedir `pwd`/out/Debug/lib/
foobar.mdmp", user can load the generated core file in gdb without setting up
the symlinks for "/var/lib/breakpad".

BUG=None
A=kouhei@chromium.org

Original code review: https://breakpad.appspot.com/1214002/

R=kouhei@chromium.org

Review URL: https://breakpad.appspot.com/1584002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1317 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-18 20:59:16 +00:00
wfh@chromium.org
c83a81450c Change the way function and public symbols are obtained to use the findChildren DIA function.
This has a substantial performance improvement over using the getSymbolsByAddr iterator, especially on certain 64bit DLLS.  e.g. Time to process chrome_child.dll drops from 51 minutes to 21 secs.

Note: new test data looks different because the ordering of lines is no longer by memory address.  This does not affect processing.  The test data has been manually compared to old data and matches (except additional PUBLIC symbols).  Also, INFO lines are omitted because the source executable files are not checked in, so they are unavailable.

R=ivanpe@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1574002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1316 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-16 22:50:28 +00:00
wfh@chromium.org
7cc286a5a7 Allow symupload to upload to multiple URLs on the same command line.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1554002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1315 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-16 16:03:57 +00:00
thestig@chromium.org
be38be57e1 Limit the workaround in r1313 to Android only.
BUG=579
R=rmcilroy@chromium.org, vapier@chromium.org

Review URL: https://breakpad.appspot.com/1564002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1314 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-15 18:29:15 +00:00
rmcilroy@chromium.org
32031a9136 [Android]: Fix hang in CreateChildCrash() on Android.
After r1299, the LinuxCoreDumperTest::VerifyDumpWithMultipleThreads and
ElfCoreDumpTest::ValidCoreFile would both hang on Android.  This appears to be due to the tkill
signal not being recieved by the thread which is meant to crash, even though tkill returns 0.
This CL retries sending the tkill signal multiple times, which prevents the Hang.

BUG=579
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/1524002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1313 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-15 10:07:50 +00:00
rmcilroy@chromium.org
eebdc96430 Update offset of fpregs_mem.
Based on testing in the emulator.

BUG=346626
R=thestig@chromium.org

Review URL: https://breakpad.appspot.com/1544002

Patch from Anton Carver <anton@chromium.org>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1312 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-15 09:52:37 +00:00
rmcilroy@chromium.org
6594ac922c Add x64 version of getcontext.
Assembly code is derived in part from code in libunwind.
Code tested on desktop linux (Android testing pending emulation
support).

BUG=346626
R=dannyb@google.com, thestig@chromium.org

Review URL: https://breakpad.appspot.com/1454002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1311 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-11 16:09:12 +00:00
rmcilroy@chromium.org
a2245d6744 Fill in CPU info in mini-dump for Arm64.
Adds Arm64 varients of CPUFillThreadInfo and CPUFillFromUContext and
WriteCPUInformation for the Linux/Android client.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1464002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1310 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-11 14:41:14 +00:00
ivan.penkov@gmail.com
6b0703a093 Adding support for 64-bit Windows modules to ms_symbol_server_converter.
As part of that:
 - Updated MSSymbolServerConverter to also download the executable files from the symbol server and pass them to the PDBSourceLineWriter as it is required for successful conversion of symbols for 64-bit modules.
 - Added a .gyp file and target for the ms_symbol_server_converter library.
 - Updated PDBSourceLineWriter to allow executable files to be in locations different from the locations of the PDB files.
 - Minor style issue:
    * #define guards.
    * No space before ')' and after '('.

R=mark@chromium.org, wfh@chromium.org

Review URL: https://breakpad.appspot.com/1434002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1309 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-10 17:54:52 +00:00
ivan.penkov@gmail.com
7dbca422d4 Moving directory 'build' one level up as it collides with a file named 'BUILD' which happens to be in that same location in the Google source depot.
R=chrisha@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1504002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1308 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-10 17:37:20 +00:00
rmcilroy@chromium.org
347f7a10dd Increase Breakpad's signal handler stack size.
Some unittests fail on Android (both on Arm and Arm64) without this stack
size increase.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1484002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1307 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-09 17:35:44 +00:00
rmcilroy@chromium.org
543cf832e6 Fix aarch64 ucontext layout on Android
BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1444002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1306 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-09 09:08:19 +00:00
rmcilroy@chromium.org
fff818514d Add Arm64 support to breakpad unittests.
BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1424002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1305 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-08 17:36:11 +00:00
chrisha@chromium.org
611f8b7f32 Move build configuration to root of repository.
This is in preparation for creating GYP build files for each platform.

BUG=https://code.google.com/p/google-breakpad/issues/detail?id=575
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1414002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1304 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-03 18:34:24 +00:00
benchan@chromium.org
66460ce1d9 Fix ElfCoreDumpTest.ValidCoreFile unit test.
The ElfCoreDumpTest.ValidCoreFile unit test assumed that the number of
NT_FPREGSET / NT_PRXFPREG notes in the core dump file equals to the number of
threads of the crashed process. This assumption isn't always true as the kernel
skips filling the NT_FPREGSET / NT_PRXFPREG note of a thread if the FPU state
isn't available. The kernel indicates the availability of NT_FPREGSET /
NT_PRXFPREG via the pr_fpvalid field of the NT_PRSTATUS note. This CL modifies
the ElfCoreDumpTest.ValidCoreFile unit test to verify the number of NT_FPREGSET
and NT_PRXFPREG notes based on the pr_fpvalid field of the NT_PRSTATUS notes.

BUG=577
TEST=Run unit tests on x86 and x86_64 Linux platform.
R=vapier@chromium.org

Review URL: https://breakpad.appspot.com/1404002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1303 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-03 16:50:06 +00:00
rmcilroy@chromium.org
410b7024e3 Add Arm64 version of breakpad_getcontext for Android.
This CL adds breakpad_getcontext support for Arm64 to Android. The assembly
is based on getcontext.S in glibc.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1384002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1302 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-03 13:15:37 +00:00
rmcilroy@chromium.org
83b9a28cf9 First cut at adding arm64 Linux / Android support to Breakpad.
This is an initial attempt to add Arm64 (aarch64) support to Breakpad for
Linux / Android platforms.  This CL adds the Arm64 data structures, but does
not yet implement the Android getcontext support or CPUFillFromThreadInfo /
CPUFillFromUContext.

BUG=354405,335641
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1354002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1301 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-02 23:12:40 +00:00
rmcilroy@chromium.org
46aba5a43a Remove some unecessary Android system header definitions.
Newer NDKs include some additional headers needed by Breakpad, so we can remove these redefinitions.

BUG=358831,335641,354405
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1374002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1300 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-02 23:02:31 +00:00
vapier@chromium.org
0ac94ba617 fix races in CrashGenerator::CreateChildCrash
The current CreateChildCrash logic is racy when it comes to creating a
crash dump for two reasons:

The main thread that calls kill() on a different thread is guaranteed
the signal will be *queued* when it returns, but not *delivered*.  If
the kernel doesn't automatically schedule the receiving thread, but
instead lets the main thread run to the exit() call, then the signal
never triggers a coredump and the whole process simply exits.

The main thread is using kill() to try to deliver a signal to a
specific thread, but that function is for sending signals to a
process.  That means the kernel is free to deliver the signal to
any thread in the process and not just the one requested.  This
manifests itself as the pr_pid in the coredump not being the one
expected.  Instead, we must use tkill() with the tid (which we
already took care of gathering) to deliver to a specific thread.

These are a lot easier to see on a UMP system as contention is heavier.

BUG=chromium:207918
TEST=`dumper_unittest` still passes, and doesn't flake out in a UMP system
TEST=`linux_client_unittest` still passes
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/1304005

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1299 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-02 22:55:12 +00:00
thestig@chromium.org
ad37f5aabd Terminating FileID path when at maximum length. (Coverity)
If FileID was constructed with a path that was >= PATH_MAX then path_ was not terminated resulting in a possible buffer overrun when reading.

BUG=573
A=cmumford@chromium.org
Original code review: https://breakpad.appspot.com/1324002/

R=cmumford@chromium.org

Review URL: https://breakpad.appspot.com/1334002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1295 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-01 20:18:53 +00:00
thestig@chromium.org
482df94a07 GoogleCrashdumpUploader would leak instances of LibcurlWrapper (Coverity)
The GoogleCrashdumpUploader would create, but never destroy it's instance of LibcurlWrapper.

BUG=574
A=cmumford@chromium.org
Original code review: https://breakpad.appspot.com/1314002/

R=cmumford@chromium.org

Review URL: https://breakpad.appspot.com/1344002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1294 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-01 20:18:23 +00:00
mark@chromium.org
0decfdb042 Make ARM64 detection consistent in chromium.
This is to uniform ARM64 detection code in chromium.
Use only __aarch64__ and don't look for __arm64__ at all.

Patch by Primiano Tucci <primiano@chromium.org>

BUG=chromium:354405, chromium:358092

Review URL: https://breakpad.appspot.com/1304002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1293 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-04-01 18:20:36 +00:00
wfh@chromium.org
3e12c58449 Ignore warning 4702 to avoid unreachable code error on
VS2013 stl when compiling with _HAS_EXCEPTIONS=0

See also https://crbug.com/346399 for background.

BUG=540
R=mark@chromium.org, thestig@chromium.org
TEST=update gyp to HEAD, generate MSVS2013 build files, verify breakpad compiles in Release.

Review URL: https://breakpad.appspot.com/1284002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1292 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-26 21:02:12 +00:00
wfh@chromium.org
acd538baf8 Check in new Windows binaries.
These binaries include recent changes to pdb_source_line_writer for emitting
STACK CFI lines for 64bit PDBs. They were built using the GYP build files,
MSVS 2013 and DIA SDK 12.0.

R=mark@chromium.org, siggi@chromium.org

Review URL: https://breakpad.appspot.com/1294002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1291 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-26 20:45:52 +00:00
wfh@chromium.org
213a0698cb Add support for Win64 stack unwind data as STACK CFI
This is a copy of https://breakpad.appspot.com/1264002/ where code review took place.

See https://bugzilla.mozilla.org/show_bug.cgi?id=548035 and https://code.google.com/p/chromium/issues/detail?id=115922

Credit to Mikhail I. Izmestev <izmmishao5@gmail.com> for original patch in https://breakpad.appspot.com/345002/

BUG=572
TEST=Run dump_syms_unittest after compiling dump_syms_regtest.cc with x64 toolchain
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1274002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1290 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-24 12:12:17 +00:00
thestig@chromium.org
b764582a53 Fix crash in Windows CrashGenerationServer from r1274.
R=cdn@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1254002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1289 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-19 19:12:56 +00:00
ivan.penkov@gmail.com
cc3542dc44 Fix a bug in BreakpadController that prevented multiple report uploads per call to sendStoredCrashReports.
Submitting this patch on behalf of Asher Segel-Brown.

R=blundell@chromium.org, mark@chromium.org, qsr@chromium.org

Review URL: https://breakpad.appspot.com/1234002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1288 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-19 18:58:36 +00:00
thestig@chromium.org
c5ae79b3f2 Trim unintentional whitespace and fix style nits
Original review: https://breakpad.appspot.com/1204002/
A=mdempsky@chromium.org
R=mdempsky@chromium.org

Review URL: https://breakpad.appspot.com/1244002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1287 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-03-18 18:06:10 +00:00
ivan.penkov@gmail.com
1df13fed15 Fixing compiler warnings:
- Building Breakpad in Xcode with arm64 architecture.
 - iOS
Patches provided by: Ian Hickson and Greg Vance.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1184003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1286 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-28 10:21:20 +00:00
mark@chromium.org
3e76b4a74b Initialize file descriptors to -1, not 0, in MachoWalker.
R=ivan.penkov@gmail.com

Review URL: https://breakpad.appspot.com/1174002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1284 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-26 18:59:48 +00:00
dmaclach
334b2c70f0 Update GTM and enable -Wundef and strict C++11 flags.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1283 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-26 16:14:04 +00:00
dmaclach
47585f7dee Fixup breakpad compile for Xcode 5.1 iOS release
(https://breakpad.appspot.com/1154002/)



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1282 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-24 21:35:40 +00:00
dmaclach
9315301a56 Fix up ~14 warnings about 'Implicit conversion loses integer precision' on iOS.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1281 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-18 22:52:02 +00:00
dmaclach
0c18b07255 When the Breakpad.h header gets compiled by standard C compilers
(instead of C++) it gets upset about the default argument. Instead of
using a default argument I split the function up into two separate
functions.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1280 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-18 21:34:43 +00:00
ted.mielczarek@gmail.com
5fcdc4f567 Make Linux ExceptionHandler::HandleSignal public
A=Jed Davis <jld@mozilla.com> R=ted at https://breakpad.appspot.com/1114003/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1279 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-05 12:11:48 +00:00
rsesek@chromium.org
299683dba6 Create a new tool to upload Mac system library symbols.
R=andybons@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1124002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1278 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-03 22:52:49 +00:00
mattdr.breakpad@gmail.com
9dd2ab720e Support statically-linked libcurl for HTTP uploads in Linux
https://breakpad.appspot.com/1064002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1277 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-29 20:34:07 +00:00
thestig@chromium.org
c590a7f322 Windows: Fix 64-bit compitation of crash_generation_app.
BUG=560
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1104002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1276 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-21 19:22:37 +00:00
thestig@chromium.org
0864f0afaa Fix missing semi-colons from r1267.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1094002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1275 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 23:20:24 +00:00
cdn@chromium.org
8b65346242 Refactor the Windows MinidumpGenerator interface to get rid of the overloads when generating dumps.
All required params are now passed to the constructor and the various options are set through new methods.

BUG=N/A
TEST=Existing minidump generation tests
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1074002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1274 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 22:39:11 +00:00
cdn@chromium.org
d9f582edce Fix VS project generation for the crash generation app.
BUG=N/A
TEST=N/A
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1084002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1273 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 21:57:47 +00:00
ivan.penkov@gmail.com
2b0db12678 Submitting on bahalf of Michele Aiello.
Fix Xcode 5.1 compilation issues.
Moving a couple of variable under #ifdef to avoid build warnings.

R=blundell@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1054002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1272 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-13 19:30:06 +00:00
blundell@chromium.org
12528d19bd Add -[BreakpadController setParametersToAddAtUploadTime:] for iOS.
This provides the ability to add server parameters to a crash report when the
report is uploaded.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=558
R=blundell@chromium.org

Review URL: https://breakpad.appspot.com/974002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1271 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-13 10:40:07 +00:00
mark@chromium.org
3ea04ec479 Don't do work inside assert(). Ever.
The Mac crash key manipulation code was intended to be thread-safe through the
provision of a mutex. The mutex operations were done inside an assert().
assert() is a no-op in NDEBUG (release) builds. Therefore, in release builds,
these operations were occurring without being protected by any mutex at all,
and were nowhere near thread-safe.

BUG=chromium:331268
R=rsesek@chromium.org

Review URL: https://breakpad.appspot.com/1034002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1270 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-10 19:54:20 +00:00
mark@chromium.org
1e99113fbe Fix #include order from r1268.
R=ted.mielczarek@gmail.com

Review URL: https://breakpad.appspot.com/1044002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1269 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-10 19:53:33 +00:00
ted.mielczarek@gmail.com
6f045df4f0 Fix compilation with macos-target=10.9
A=Nomis101, R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=952623

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1268 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-03 12:32:55 +00:00
thestig@chromium.org
4a0f9bf030 Windows: Fix remaining level 4 warnings.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/954002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1267 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 22:43:56 +00:00
thestig@chromium.org
74f640a92e Use a proper ignore_result() to fix a ftruncate warn_unused_result warning with GCC 4.8.
BUG=492
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/944003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1266 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 19:52:36 +00:00
thestig@chromium.org
15873e0016 Switch scoped_ptr.h to a compatible google3 implementation.
This is Chromium's base/memory/scoped_ptr.h at r98718, which split off
from the google3 version at a later point than Breakpad's copy. It is a
drop in replacement and the only changes are:
- removal of WARN_UNUSED_RESULT.
- moving it into the google_breakpad namespace.

BUG=534
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/964002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1265 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 19:49:55 +00:00
thestig@chromium.org
6199766d99 Fix warnings from the Windows build.
These warnings are fatal in my GYP-generated debug build.
The warnings can be seen on Linux/Mac with -Wshorten-64-to-32.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/944002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1264 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 22:21:40 +00:00
thestig@chromium.org
53a689933f Run svn propdel svn:executable on source code files.
Review URL: https://breakpad.appspot.com/934002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1263 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 21:40:50 +00:00
thestig@chromium.org
a4d055f1c2 Fix error r1258.
BUG=556
R=cdn@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/904004

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1262 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 19:04:11 +00:00
ivan.penkov@gmail.com
d6d6230272 Making the Mac build of crash_report work again after the last SVN sync. This includes correction of a method definition signature and adding missing code files to the project.
I'm commiting this on behalf of Thomas Schweitzer.
Review URL: https://breakpad.appspot.com/914002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1261 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 00:10:25 +00:00
thestig@chromium.org
3c613e7bdb Fix gcc vs clang cpuid.h discrepency.
For r1254, gcc defines bit_FXSAVE while clang defines bit_FXSR.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/924002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1260 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-14 19:17:42 +00:00
digit@chromium.org
ba1f54c093 Misc Android-related fixes.
- src/common/android/testing/mkdtemp.h:
  Fixes a compilation error when using the (recent) NDK r9b,
  see comments in the source file for details.

- android/test-driver, Makefile.am, Makefile.in:
  Autotools 1.12 changed the way tests are run during "make check"
  so add a new "custom test driver" to run tests on Android, and
  modify Makefile.am / Makefile.in accordingly. Otherwise,
  'make check' tried to run the tests on the host.

- android/test-shell.sh:
  Allow several tests to run in parallel on the device, by
  creating a custom test directory for each test process.
  This allows running "make check -j8" reliably.

- src/common/linux/file_id_unittest.cc:
  Disable the SelfStrip test on Android, since it assumes a 'strip'
  executable is available on the target system where the test runs.

BUG=NONE
R=mark@chromium.org, ted.mielczarek@gmail.com
TEST=android/run-checks.sh --ndk-dir=/path/to/android-ndk-r9b

Review URL: https://breakpad.appspot.com/904003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1259 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-13 16:49:11 +00:00
cdn@chromium.org
4bcf51dc79 Expose the ability to supply additional user streams in the windows dump generator.
BUG=N/A
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/894002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1258 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 20:04:42 +00:00
altse@chromium.org
b5e5d8bd30 Remove usage of gDebugLog and DEBUGLOG from Mac and iOS client code.
The inconsistent and duplicated references to gDebugLog caused
problems building on iOS and the current logging implementation
had little utility because it was never activated in debug builds.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1257 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 19:58:00 +00:00
blundell@chromium.org
88b8ac6182 Add -[BreakpadController resetConfiguration] for iOS.
Add a resetConfiguration method to BreakpadController for iOS. The new method
resets the controller configuration to its initial value, which is the
infoDictionary of the bundle of the application.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=554

Review URL: https://breakpad.appspot.com/904002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1256 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 14:52:37 +00:00
vapier@chromium.org
4c048c9764 disable unittests under ASAN that use memory crashes
There are a bunch of tests that use invalid memory acesses (on purpose)
to trigger a crash so that we can detect things are dumped correctly.
When we run under ASAN, it catches those accesses and the breaks the
testing flow.

For now, use the existing ADDRESS_SANITIZER symbol to disable more tests.
Ideally we'd use a compile-time attribute to disable ASAN on a few funcs,
but that seems to be broken atm.

BUG=chromium:293519
BUG=chromium:304575
TEST=ran unittests under ASAN and they now pass
TEST=ran unittests w/out asan/clang and they still pass
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/884002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1255 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-11 05:38:34 +00:00
thestig@chromium.org
7f05071e8b Address additional comments from r1248. Fix the register to check and fix some style nits.
BUG=495
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/834003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1254 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 21:17:12 +00:00
mcgrathr@chromium.org
cd272586ee Conditionalize use of <cpuid.h> header
This header only exists for x86 environments, but was included
unconditionally.  That broke the builds for all non-x86 environments.

R=mark@chromium.org
BUG=

Review URL: https://breakpad.appspot.com/824003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1253 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 18:25:45 +00:00
ted.mielczarek@gmail.com
07bb2311f8 Use AM_MAINTAINER_MODE so configure supports --enable-maintainer-mode
A=mcgrathr
R=bradnelson at https://breakpad.appspot.com/864003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1251 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 12:28:11 +00:00
vapier@chromium.org
302124aff1 check for and enable Large File Support automatically
If you try to process a file using a 32bit build that is larger than
2GiB in size, the linux kernel will reject things:
$ strace -eopen dump_syms ./chrome ./ > chrome.sym
...
open(".//chrome.debug", O_RDONLY)       = -1 EOVERFLOW (Value too large for defined data type)

So let's use the existing autoconf macro to check for and enable support
as need be.

We have to shift the existing m32 logic up to before we start doing
feature test macros though otherwise a simple configure won't work:
$ ./configure --enable-m32
This is because it first tests LFS and such w/out the -m32 flags.

BUG=chromium:266064
TEST=`./configure --enable-m32 && make && make check` passes
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/619002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1250 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 06:28:08 +00:00
thestig@chromium.org
8d22ec9227 Fix Windows release build error due to unreferenced variables.
BUG=544
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/874002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1249 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 21:59:48 +00:00
thestig@chromium.org
0348c801bd Add MMX detection when getting registers in Linux.
For CPUs that don't support the MMX instruction set, such pre-Pentium III or industrial x86 embedded PCs, the minidump fails when it tries to retrieve MMX specific registers.

This patch adds MMX detection for that call.

Tested on Ubuntu 12.04 with i686, and on a custom Linux distro on a Vortex86DX microcontroller.

Original review: https://breakpad.appspot.com/455002/
A=aras.vaichas
BUG=495

Review URL: https://breakpad.appspot.com/864002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1248 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 20:22:43 +00:00
mark@chromium.org
cca536ba9d Back out r1244
------------------------------------------------------------------------
r1244 | mark@chromium.org | 2013-12-05 18:13:18 -0500 (Thu, 05 Dec 2013) | 7 lines

Avoid redefinition of global static debug flag and remove unneeded
#import "GTMDefines.h

Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/824002

------------------------------------------------------------------------

Breakage documented at https://breakpad.appspot.com/824002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1247 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 14:08:10 +00:00
mark@chromium.org
186f1cb206 Switch armv7 setting to arm_version==7.
Patch by Mostyn Bramley-Moore <mostynb@opera.com>

BUG=chromium:234135

Review URL: https://breakpad.appspot.com/844002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1246 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-08 19:28:36 +00:00
mark@chromium.org
616400ed2f Add include guards and avoid redefinition of false/true in convert_UTF.
Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/834002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1245 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-05 23:16:03 +00:00
mark@chromium.org
31a477e889 Avoid redefinition of global static debug flag and remove unneeded
#import "GTMDefines.h

Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/824002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1244 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-05 23:13:18 +00:00
qsr@chromium.org
d9d0a61f97 Do not read CFI section when not outputing CFI information.
This revert revision 1182 and fix setting the module load address
whether CFI information is needed or not.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/641002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1243 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-04 14:05:23 +00:00
ivan.penkov@gmail.com
08ce8e35eb Fix unused method warning.
Review URL: https://breakpad.appspot.com/814002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1242 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 22:27:01 +00:00
ivan.penkov@gmail.com
b91429acb0 Fixing several instances of wrong printf format specifiers.
Review URL: https://breakpad.appspot.com/794002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1241 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 21:13:59 +00:00
mark@chromium.org
8a0b196e22 Add missing #include of eintr_wrapper.h to auto_testfile.h. Since it's
Linux-specific, shuffle the files around a bit.

(The implementation is actually POSIX-specific, but it's currently only used
on Linux.)

R=blundell@chromium.org

Review URL: https://breakpad.appspot.com/804002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1240 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 19:01:17 +00:00
mark@chromium.org
036dec3ecc Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.
It is incorrect to wrap close in HANDLE_EINTR on Linux.

Unnecessary #includes of eintr_wrapper.h are also removed. The variable naming
within the macro is also updated per Chromium r178174.

einter_wrapper.h contains a non-mechanical change. Mechanical changes were
generated by running:

sed -E -i '' \
    -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \
    -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \
    -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \
    $(grep -rl HANDLE_EINTR.*close . --exclude-dir=.svn)

sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \
    $(grep -EL '(HANDLE|IGNORE)_EINTR' \
        $(grep -Elr '#include.*eintr_wrapper\.h"' . --exclude-dir=.svn))

BUG=chromium:269623
R=ted.mielczarek@gmail.com

Review URL: https://breakpad.appspot.com/784002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1239 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 14:12:08 +00:00
blundell@chromium.org
b303174e32 Re-enable ios_exception_minidump_generator being built on non-ARM.
This file gets built on x86 as part of building Chromium for the iOS simulator,
which I had forgotten in the course of https://breakpad.appspot.com/664002/.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/774002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1238 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-02 16:02:48 +00:00
qsr@chromium.org
f546e072ce In iOS, BREAKPAD_OUTPUT_DUMP_FILE value contains a malformed full path to the dump file.
The std::string dumpFilename already contains the full pathname to the dump file.  Appending it to the dumpDirAsNSString creates a string with the path portion duplicated, e.g.:

/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp

Instead of this:

/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp

R=markus@chromium.org, qsr@chromium.org

Review URL: https://breakpad.appspot.com/744002

Patch from Akiva <scirsw@gmail.com>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1237 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-26 10:38:55 +00:00
mark@chromium.org
e9165f4353 Process minidumps generated on ARM64 in iOS apps.
Patch by Colin Blundell <blundell@chromium.org>

BUG=542

Review URL: https://breakpad.appspot.com/704002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1236 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-23 01:45:20 +00:00
mark@chromium.org
77022ac0df Generate minidumps for 64-bit ARM apps on iOS.
Adds an ARM64-specific definition of MDRawContext and support for writing out a
minidump when running on ARM64. Additionally, extends the iOS minidump generator
for NSExceptions to work on ARM64 as well as ARM.

Patch by Colin Blundell <blundell@chromium.org>

BUG=542

Review URL: https://breakpad.appspot.com/664002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1235 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-21 17:44:57 +00:00
mark@chromium.org
8e28cb3898 Provide BreakpadGetCrashReportCount() and -[BreakpadController
getCrashReportCount:]

This provides the ability for clients to query the number of crash reports
that are waiting to upload.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=547

Review URL: https://breakpad.appspot.com/714002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1234 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-20 16:34:13 +00:00
thestig@chromium.org
46821f78b1 Allow SIGABRT to abort the program.
SIGABRT can be generated internally, usually by calling abort(),
or externally by another process.  When the signal is generated
by the kernel, info->si_pid is 0 and the signal is treated in the
same way as an exception (SIGSEGV, etc.), but the assumption
that the exception happens again upon return from the handler
is wrong, so we must have a special case for this.

Original CL: https://breakpad.appspot.com/734002/

BUG=chromium:303075
TEST=tested with Alt-VolumeUp-X on Chrome OS
A=semenzato@chromium.org
R=semenzato@google.com

Review URL: https://breakpad.appspot.com/754002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1233 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-07 22:50:13 +00:00
ivan.penkov@gmail.com
fd9f3d8b17 Use register %ebp (instead of %esp) when calculating the value of
.raSearchStart in the cases where there are alignment operators in
the program string.

If alignment operators are found in the program string, the current
value of %ebp must be valid and it is the only reliable data point
that can be used for getting to the previous frame.  Previously, the
.raSearchStart calculation was based on %esp and when %esp is aligned
in the current frame (which is a lossy operation) the resulting
.raSearchStart cannot was incorrect.  There is code that is trying to
work around this problem (scanning of up to 3 words for a return
address) which is unreliable and it doesn't work in many cases (e.g.
when the alignment is on a 64-byte boundary).

This fix is already deployed in Google and it was measured to reduce
the number of wrong stack traces (for Windows crashes) by 45%. No
regressions have been found so far.

Here is an example of an issue that was fixed by this change (where
register %esp is aligned on the 64-byte boundary and the workarounds
that we already had didn't work):

https://code.google.com/p/chromium/issues/detail?id=311359

0:013> uf chrome_59630000!base::MessagePumpForIO::DoRunLoop
  518 59685c39 55      push    ebp
  518 59685c3a 8bec    mov     ebp,esp
  518 59685c3c 83e4c0  and     esp,0FFFFFFC0h  <== 64-byte boundary
  518 59685c3f 83ec34  sub     esp,34h
  518 59685c42 53      push    ebx
  518 59685c43 56      push    esi

Program string contains 64-byte alignment:
$T1 .raSearch = $T0 $T1 4 - 64 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = 
$esp $T1 4 + = $20 $T0 56 - ^ =  $23 $T0 60 - ^ =  $24 $T0 64 - ^ =
Review URL: https://breakpad.appspot.com/694002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1232 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-05 23:50:49 +00:00
mark@chromium.org
c7a1674f16 Add support for configuring the minimum log level at compile time
The minimum log level can be set by defining to macro BPLOG_MINIMUM_SEVERITY
to one of google_breakpad::LogStream::Severity values. The default is
SEVERITY_INFO.

BUG=none
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/724002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1231 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-05 19:43:48 +00:00
mark@chromium.org
4b6e0bb952 NSLocalizedString compatibility (10.8 SDK and clang trunk -Wformat-extra-args)
Apparently, as of the 10.8 SDK, Apple has quietly decided that the first
argument to NSLocalizedString is supposed to be usable as-is as a format
string, instead of simply being the key to obtain a usable format string.
The recent clang trunk enforces this, resulting in build breaks like

crash_report_sender.m:560:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
             displayName];
             ^

Breaking the result of NSLocalizedString into a temporary NSString* is enough
to suppress the warning.

BUG=chromium:314109
R=thakis@chromium.org

Review URL: https://breakpad.appspot.com/674003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1230 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-05 16:53:55 +00:00
vapier@chromium.org
bf139abc7d map_serializers_unittest: fix unused variable warning
Building with clang triggers warnings (which for us breaks the build):
src/processor/map_serializers_unittest.cc:52:11: error: 
      unused variable 'kSizeOfInt' [-Werror,-Wunused-const-variable]
1 error generated.

Fix by Yunlian Jiang.

BUG=chromium:311720 (http://crbug.com/311720)
TEST=FEATURES="test" emerge-lumpy google-breakpad passes


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1229 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-30 17:16:38 +00:00
mattdr.breakpad@gmail.com
32cbf9fc88 Print response code when sym_upload fails.
https://breakpad.appspot.com/631003/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1228 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-29 23:28:16 +00:00
mattdr.breakpad@gmail.com
667991e25f Add some symbols missing from my last commit.
https://breakpad.appspot.com/622002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1227 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-29 20:16:46 +00:00
mattdr.breakpad@gmail.com
502f23211b Add simple exploitability analysis for Linux crashes.
https://breakpad.appspot.com/622002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1226 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-29 20:03:39 +00:00
jessicag.feedback
6689f24d1a Switch to scoped_array instead of inappropriate scoped_ptr.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1225 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-28 23:39:43 +00:00
vapier@chromium.org
8586f6e288 increase exception handler stack size for dumping thread
When running unittests under ASAN, we see that these code paths can
slightly smash the stack.  Double it to avoid that.

[ RUN      ] ExceptionHandlerTest.InstructionPointerMemoryMinBound
=================================================================
==12775== ERROR: AddressSanitizer: stack-buffer-overflow on address 0xf6787614 at pc 0xf7516b29 bp 0xf6786d38 sp 0xf6786d30
READ of size 4 at 0xf6787614 thread T0
    #0 0xf7516b28 (/build/x86-generic/tmp/portage/chromeos-base/google-breakpad-1181-r66/work/google-breakpad-1181/build/src/client/linux/linux_client_unittest_shlib+0x69eb28)
Shadow byte and word:
  0x3ecf0ec2: f2
  0x3ecf0ec0: f2 f2 f2 f2
More shadow bytes:
  0x3ecf0eb0: f2 f2 f2 f2
  0x3ecf0eb4: 04 f4 f4 f4
  0x3ecf0eb8: f2 f2 f2 f2
  0x3ecf0ebc: 04 f4 f4 f4
=>0x3ecf0ec0: f2 f2 f2 f2
  0x3ecf0ec4: 04 f4 f4 f4
  0x3ecf0ec8: f2 f2 f2 f2
  0x3ecf0ecc: 04 f4 f4 f4
  0x3ecf0ed0: f2 f2 f2 f2
Stats: 0M malloced (0M for red zones) by 2757 calls
Stats: 0M realloced by 0 calls
Stats: 0M freed by 2229 calls
Stats: 0M really freed by 0 calls
Stats: 3M (899 full pages) mmaped in 7 calls
  mmaps   by size class: 7:4095; 8:2047; 9:1023; 10:511; 14:32; 16:16;
  mallocs by size class: 7:1831; 8:590; 9:85; 10:233; 14:3; 16:15;
  frees   by size class: 7:1459; 8:437; 9:84; 10:232; 14:2; 16:15;
  rfrees  by size class:
Stats: malloc large: 15 small slow: 25
==12775== ABORTING

BUG=chromium:293519
TEST=ran unittests under ASAN and they now pass
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/636002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1224 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-23 05:12:37 +00:00
qsr@chromium.org
6f3426a156 Remove define of mach_vm_region from mach_vm_compatibility.h.
mach_vm_region() is not called in the Breakpad codebase.

Patch by: blundell@chromium.org

R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/643002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1223 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-17 11:03:26 +00:00
qsr@chromium.org
6fa386bfc6 Support symbol dumping for ARMV8 iOS apps.
In my testing, ARM V8 object files and ARM V8 slices of universal binaries do
not contain debug_frame sections (at least at this time), and hence dump_syms
does not output CFI for ARM V8 even in the absence of the "-c" flag.

Patch by:blundell@chromium.org

BUG=542
R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/642002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1222 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-15 10:24:21 +00:00
qsr@chromium.org
404c684751 Remove unittest from sources list of iOS client xcodeproj.
This unittest has a main(), which causes linker errors when the library is
linked into an application.

Patch by:blundell@chromium.org

R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/640002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1221 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-15 08:34:02 +00:00
qsr@chromium.org
c00999fa2c Fix missing include in ios_exception_minidump_generator.mm.
R=qsr@chromium.org

Review URL: https://breakpad.appspot.com/637004

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1220 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-11 09:17:13 +00:00
rsesek@chromium.org
0453082dbe In NonAllocatingMap, remove asserts around key/value length.
Since the data is stored using strncpy they are merely advisory in debug mode.

BUG=https://code.google.com/p/chromium/issues/detail?id=298225
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/635002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1219 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-10-01 21:32:16 +00:00
gordana.cmiljanovic@imgtec.com
b7acb2a56a This patch adds required change for stackwalker_mips_unittest to pass on 64bit
platforms.

One test from stackwalker_mips_unittest was failing as mentioned in:
https://breakpad.appspot.com/632002/
https://breakpad.appspot.com/633002/

BUG=none
TEST=stackwalker_mips_unittest (run on x86-64 and mips)

Review URL: https://breakpad.appspot.com/634002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1218 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-30 09:34:55 +00:00
ivan.penkov@gmail.com
bd71bdd742 Adding stricter validation checks to various symbol parser functions.
More specifically, the validation of the following record types is improved:
 - FILE records
 - FUNC records
 - Line record
 - PUBLIC records

Adding unittests.
Review URL: https://breakpad.appspot.com/632003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1217 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-25 18:25:13 +00:00
digit@chromium.org
5bce3b4d77 Fix the Android/MIPS build.
This patch fixes the build for Android on MIPS when
using the latest official Android NDK (r9):

- Update src/common/android/include/elf.h to add a missing
  definition for SHT_MIPS_DWARF.

- Add src/common/android/include/sgidefs.h required by LSS
  when compiling for MIPS.

- Update android/run-checks.sh to work properly with
  the --abi=mips option. All tests were passed succesfully
  with an emulator system image running Android 4.2.

- Update other Android-specific files.

R=Petar.Jovanovic@imgtec.com, mark@chromium.org

Review URL: https://breakpad.appspot.com/633002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1216 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-25 13:47:44 +00:00
gordana.cmiljanovic@imgtec.com
db877a13bb Adding mips support for Android.
Mips linux support has been added previously in r1212. Some additional changes
are required to make breakpad functional on Android.

BUG=none
TEST=build, unittests, chrome test application

Review URL: https://breakpad.appspot.com/632002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1215 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-25 08:18:03 +00:00
ivan.penkov@gmail.com
ab52ca7d6e Handle block helper functions in Breakpad symbol parser. Block helper functions are associated with a source file but not associated with any line number. For such functions, the Breakpad symbol file contains 0 for the line numbers. Hence, 0 should be threated as valid line number. For more information on block helper functions, please, take a look at http://clang.llvm.org/docs/Block-ABI-Apple.html.
Here is the symbol parser output:

E0906 11:27:06.051507 22535 basic_source_line_resolver.cc:76] Line 380187: ParseLine failed
E0906 11:27:06.051614 22535 basic_source_line_resolver.cc:76] Line 380188: ParseLine failed
E0906 11:27:06.051648 22535 basic_source_line_resolver.cc:76] Line 380190: ParseLine failed
E0906 11:27:06.051679 22535 basic_source_line_resolver.cc:76] Line 380191: ParseLine failed
E0906 11:27:06.200814 22535 basic_source_line_resolver.cc:76] Line 446729: ParseLine failed

Here are the contents of the Breakpad symbol file:

FUNC 440d60 49 0 __copy_helper_block_
440d60 b 0 3160    <<<-----------  the third number is the line number
440d6b 3e 0 3160    <<<----------------------------   same here
FUNC 440db0 36 0 __destroy_helper_block_
440db0 a 0 3160    <<<----------------------------   same here
440dba 2c 0 3160    <<<----------------------------   same here
Review URL: https://breakpad.appspot.com/629002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1214 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-19 21:37:49 +00:00
gordana.cmiljanovic@imgtec.com
8c037de0b2 Fix for a clang error which is introduced by change r1212.
BUG=none
TEST=build

Review URL: https://breakpad.appspot.com/630002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1213 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-13 16:32:58 +00:00
gordana.cmiljanovic@imgtec.com
f78839c157 Adding support for mips.
Support for mips cpu is added to all breakapad targets including unittests.

BUG=none
TEST=unittests

Review URL: https://breakpad.appspot.com/614002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1212 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-11 11:37:04 +00:00
bradnelson@chromium.org
ae35566b8d Fixing minidump_dump to handle nacl dumps.
Since nacl was not listed in decoding the code identifier, minidump_dump
produces errors like this (and non-zero return code):
2013-09-05 13:41:04: minidump.cc:2044: ERROR: MinidumpModule code_identifier
requires known platform, found 0x8205

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=tested with minidumps from nacl locally
R=mark@chromium.org,mseaborn@chromium.org

Review URL: https://breakpad.appspot.com/628002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1211 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-05 22:04:05 +00:00
mseaborn@chromium.org
24c6c0aaef Update to build against the latest revision of linux_syscall_support.h
The prctl() calls must be updated following this LSS change:
https://code.google.com/p/linux-syscall-support/source/detail?r=24

BUG=none
TEST=build

Review URL: https://breakpad.appspot.com/627002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1210 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-05 21:34:38 +00:00
chrisha@chromium.org
b097e31d92 Make StackWalkerAddressList use FRAME_TRUST_PREWALKED trust level.
Review URL: https://breakpad.appspot.com/624002/




git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1209 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-04 20:43:10 +00:00
chrisha@chromium.org
16a880e135 Create StackFrame::FRAME_TRUST_PREWALKED trust type.
This creates a new frame trust type for prewalked stack frames, as suggested in
the review of https://breakpad.appspot.com/620002/.

R=ted.mielczarek@gmail.com, mark@chromium.org

Review URL: https://breakpad.appspot.com/621002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1208 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-08-23 19:41:36 +00:00
chrisha@chromium.org
1e57990cee Create StackwalkerAddressList.
This creates a pseudo stack-walker which does nothing except symbolize an
already walked array of addresses. Will be used for adding 'additional stack
trace' support to MinidumpProcessor.

R=mark@chromium.org, ivan.penkov@gmail.com

Review URL: https://breakpad.appspot.com/620002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1207 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-08-23 14:38:36 +00:00
ted.mielczarek@gmail.com
0510e34cbf Allow setting a limit on the number of frames to be recovered by stack scanning.
Patch by Julian Seward <jseward@acm.org> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=894264

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1206 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-08-19 18:31:51 +00:00
ted.mielczarek@gmail.com
aaeb7e4f13 Enable the SIGABRT handler on desktop OS X
R=mark at https://breakpad.appspot.com/618002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1205 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-08-14 17:14:18 +00:00
ivan.penkov@gmail.com
1d1b36d371 Updating MDRawMiscInfo to support verions 3 and 4 of the MINIDUMP_MISC_INFO_N structure. Added the necessary code for swapping and string conversion from UTF-16. Found and fixed a bug in MinidumpAssertion::Read where the max string length passed to UTF16codeunits was in bytes instead of UTF-16 chars.
Tested with a minidump containing a version 3 structure to validate the string conversion routines.  Interestingly enough the time_zone names does not appear to be abbreviation as the documentation was suggesting but full names, e.g. Eastern Standard Time:

MDRawMiscInfo
  size_of_info                 = 232
  flags1                       = 0xf7
  process_id                   = 0x54c4
  process_create_time          = 0x51a9323c
  process_user_time            = 0x1
  process_kernel_time          = 0x0
  processor_max_mhz            = 3100
  processor_current_mhz        = 1891
  processor_mhz_limit          = 3100
  processor_max_idle_state     = 0x1
  processor_current_idle_state = 0x1

The new fileds follow:
  process_integrity_level      = 0x1000
  process_execute_flags        = 0x4d
  protected_process            = 0
  time_zone_id                 = 2
  time_zone.bias               = 300
  time_zone.standard_name      = Eastern Standard Time
  time_zone.daylight_name      = Eastern Daylight Time
Review URL: https://breakpad.appspot.com/617002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1204 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-08-02 18:15:57 +00:00
thestig@chromium.org
9c1dc68a2f Fix erronoius address of crashinfo.auxv in minidump-2-core.
BUG=537
A=ajwong@chromium.org
Original review: https://breakpad.appspot.com/615002/

R=ajwong@chromium.org

Review URL: https://breakpad.appspot.com/616002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1203 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-19 00:58:48 +00:00
yuwu@google.com
437706b60a Fix a memory leak, using stringWithUTF8String instead.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1202 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-17 18:31:24 +00:00
yuwu@google.com
fce16c1856 Check env var BreakpadMinidumpLocation first, if set, use it as BREAKPAD_DUMP_DIRECTORY.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1201 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-15 18:33:10 +00:00
ivan.penkov@gmail.com
8819ab0844 Detect corrupt symbol files during minidump processing. Recover from the errors and use the good data if possible.
More specifically:
 - Detect corrupt symbols during minidump processing and provide the list of modules with corrupt symbols in the ProcessState.  This will allow listing the corrupt symbol files in the final crash report.
 - Skip and recover from symbol data parse errors - don't give up until 100 parse errors are seen.
 - In order to recover from '\0' (null terminator) in the middle of a symbol file, a couple of methods have to be updated to require both buffer pointer and length.  Previously they required only a buffer pointer (char *) and the size of the buffer was evaluated using strlen which is not reliable when the data is corrupt.  Most of the changes are due to these signature updates.
 - Added and updated unittests.

Also, updated minidump_stackwalk to show a WARNING for corrupt symbols.  Output looks like this:
...
Loaded modules:
0x000da000 - 0x000dafff  Google Chrome Canary  ???  (main)
0x000e0000 - 0x0417dfff  Google Chrome Framework  0.1500.0.3  (WARNING: Corrupt symbols, Google Chrome Framework, 4682A6B4136436C4BFECEB62D498020E0)
0x044a8000 - 0x04571fff  IOBluetooth  0.1.0.0
...
Review URL: https://breakpad.appspot.com/613002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1200 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-11 01:36:06 +00:00
thestig@chromium.org
92537aa818 Linux: Fix builds on systems without PR_SET_PTRACER in linux/prctl.h.
R=thakis@chromium.org

Review URL: https://breakpad.appspot.com/612002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1199 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-02 02:11:18 +00:00
thestig@chromium.org
7b5811eaac Fix Android build more.
Android doesn't have the Yama LSM, so this line isn't needed. (It doesn't
compile either.)

Original CL: https://breakpad.appspot.com/610002/
A=thakis@chromium.org
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/611002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1198 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-07-01 22:18:18 +00:00
mark@chromium.org
8965a51b2c Fix build on Android.
Patch by Nico Weber <thakis@chromium.org>
Review URL: https://breakpad.appspot.com/609002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1197 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-28 22:54:18 +00:00
mark@chromium.org
bbd0e39801 Fix a clang warning:
../../breakpad/src/processor/tokenize.cc:65:7: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
  if (!remaining > 0) {
      ^          ~
../../breakpad/src/processor/tokenize.cc:65:7: note: add parentheses after the '!' to evaluate the comparison first
  if (!remaining > 0) {
      ^
       (            )
../../breakpad/src/processor/tokenize.cc:65:7: note: add parentheses around left hand side expression to silence this warning
  if (!remaining > 0) {
      ^
      (         )

R=thakis@chromium.org

Review URL: https://breakpad.appspot.com/608002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1196 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-28 20:45:10 +00:00
mark@chromium.org
f33dd18fd2 Fix a clang warning.
Since explanatoryDialogText returns something that migth be user input, this
looks like a good change anyhow.

../../breakpad/src/client/mac/sender/crash_report_sender.m:269:38:
error: format string is not a string literal (potentially insecure)
    [-Werror,-Wformat-security]
                                     [self explanatoryDialogText],
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Patch by Nico Weber <thakis@chromium.org>
Review URL: https://breakpad.appspot.com/607002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1195 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-27 20:55:45 +00:00
ivan.penkov@gmail.com
d394434a93 This change is addressing a particularly nasty issue where the stackwalker
doesn't see the correct thread stack memory.  Instead, it loads garbage
(from offset 0 of the minidump file - well that's not garbage, but it is
not the stack memory region either) and attempts to walk it.  A typical
symptom of this issue is when you get a single stack frame after
processing - the context frame - for which you don't need stack memory.

This issue is caused by an invalid RVA in the memory descriptor stored
inside the MINIDUMP_THREAD structure for the thread.  Luckily, the
invalid RVA is 0, and the start_of_memory_region appears to be correct,
so this issue can be easily detected and the correct memory region can be
loaded using an RVA specified in the MinidumpMemoryList.

I couldn't find a reasonable description on MSDN regarding
MINIDUMP_MEMORY_DESCRIPTOR.MINIDUMP_LOCATION_DESCRIPTOR having RVA of 0
except maybe for full dumps where the 64-bit version of the structure
(MINIDUMP_MEMORY_DESCRIPTOR64) is used and it has no RVA at all.  It has
a 64-bit DataSize which if interpreted as the 32-bit structure will very
likely result in 0 for the RVA:
  http://msdn.microsoft.com/en-us/library/windows/desktop/ms680384(v=vs.85).aspx 

Anyways, the dump that I looked at was not a full dump so 0 for RVA is a
bit puzzling (at least easily detectable):
...
Microsoft (R) Windows Debugger Version 6.2.9200.20512 X86
Copyright (c) Microsoft Corporation. All rights reserved.
...
User Mini Dump File: Only registers, stack and portions of memory are available
...
MINIDUMP_HEADER:
Version         A793 (62F0)
NumberOfStreams 11
Flags           160
                0020 MiniDumpWithUnloadedModules
                0040 MiniDumpWithIndirectlyReferencedMemory
                0100 MiniDumpWithProcessThreadData
Review URL: https://breakpad.appspot.com/606002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1194 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-27 20:34:30 +00:00
ivan.penkov@gmail.com
374e8dcfa7 More robust stack walks when the IP address in the context frame is invalid (or not in a known module).
This is achieved by:
1. Extending the span of the scan for return address in the conext frame.  Initially, I wanted to extend the span of the scan for all frames but then I noticed that there is code for ARM already that is extending the search only for the context frame.  This kind of makes sense so I decided to reuse the same idea everywhere.
2. Attempting to restore the EBP chain after a successful scan for return address so that the stackwalker can switch back to FRAME_TRUST_CFI for the rest of the frames when possible.

I also fixed the lint errors in the files touched.
Review URL: https://breakpad.appspot.com/605002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1193 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-26 00:16:11 +00:00
mark@chromium.org
56cf4aa3d9 Eliminate redundant initialization following r1188,
https://breakpad.appspot.com/599002

R=ivan.penkov@gmail.com

Review URL: https://breakpad.appspot.com/604002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1192 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-20 18:20:48 +00:00
cdn@chromium.org
8041deee0c add interface for WriteMinidump which allows the caller to supply file handles instead of paths where the minidumps should be written.
BUG=N/A
TEST=N/A
R=ivan.penkov@gmail.com, mark@chromium.org

Review URL: https://breakpad.appspot.com/602002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1191 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-06 17:20:34 +00:00
ted.mielczarek@gmail.com
e10e9ac7ca Make all linux ptrace dumper tests use a subprocess
Patch by Mike Hommey <mh@glandium.org>, R=ted at https://breakpad.appspot.com/550002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1190 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-06 13:15:54 +00:00
ivan.penkov@gmail.com
6b46d4e872 Treat warnings as error and fix most level 4 warnings in the breakpad windows client projects.
Some of the lint errors in the files touched by this change were also fixed.

BUG=533
Review URL: https://breakpad.appspot.com/601002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1189 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-06-04 16:51:01 +00:00
ivan.penkov@gmail.com
5bdee65f7a Thanks to Matthew Riley who noticed this issue and provided the initial proposal for the fix.
There's a bug in the new allocator<T> implementation used by wasteful_vector.  It inherits the base class' implementation of allocator and doesn't implement allocate() so it goes to the heap instead of the PageAllocator -- the very thing wasteful_vector was trying to avoid!  As a side effect it was also leaking heap memory.

Thanks,
-Ivan
Review URL: https://breakpad.appspot.com/599002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1188 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-23 18:47:49 +00:00
ivan.penkov@gmail.com
2b1f82e1c8 Fixing several instances of std::vector::operator[] out of range access
Review URL: https://breakpad.appspot.com/597002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1187 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-21 17:05:35 +00:00
ivan.penkov@gmail.com
e4d3cca3ef Submitting this on behalf of Xiaoling Bao.
Make custom info population before dump generation as an optional operation.  This is part of a security change to move the crash generation and upload out of Google updater process.
Review URL: https://breakpad.appspot.com/586003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1186 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-20 18:55:54 +00:00
ted.mielczarek@gmail.com
ecd727f386 Ensure a proper LinuxDumper::crash_thread_ value
Patch by Mike Hommey <mh@glandium.org>, R=me at https://breakpad.appspot.com/582002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1185 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-17 19:50:00 +00:00
ted.mielczarek@gmail.com
bcf029f333 Use std::vector with a custom allocator wrapping PageAllocator for wasteful_vector
Patch by Mike Hommey <mh@glandium.org>, R=me at https://breakpad.appspot.com/581002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1184 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-17 19:47:10 +00:00
ted.mielczarek@gmail.com
54e75078d6 Avoid gmock warning "Uninteresting mock function call"
Patch by Michael Krebs <mkrebs@chromium.org>, R=me at https://breakpad.appspot.com/397002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1183 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-17 14:51:46 +00:00
qsr@chromium.org
3a59d0586b Always read CFI section, even when not outputing CFI information.
On iOS at least, the CFI section contains information needed to
correctly dump the symbols. Even if the CFI section is not dumped,
reading it is necessary to get correcty symbolication.

R=mark@chromium.org, ted.mielczarek@gmail.com

Review URL: https://breakpad.appspot.com/596002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1182 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-16 14:06:06 +00:00
ivan.penkov@gmail.com
8695cc0b88 Compile issue when using global string "::string". For more details take a look at src/common/using_std_string.h.
Review URL: https://breakpad.appspot.com/577002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1181 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-11 00:23:41 +00:00
mseaborn@chromium.org
e775f8bb16 Fix a "set but not used" compiler warning in a test
Add a missing assertion whose absence made the test ineffective.
Make the test a little stricter too.

BUG=none
TEST="make check" to run the test + use "-Wall -Werror"

Review URL: https://breakpad.appspot.com/592003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1180 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-10 20:58:49 +00:00
mseaborn@chromium.org
0daf8175df Fix a "set but not used" compiler warning in libdisasm
BUG=none
TEST=none apart from compiling with "-Wall -Werror"

Review URL: https://breakpad.appspot.com/594002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1179 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-10 15:49:23 +00:00
mark@chromium.org
09b6b0f8bf Fix following r1175: the section name is __debug_info, not .debug_info.
Review URL: https://breakpad.appspot.com/583003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1178 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-09 21:56:18 +00:00
chrisha@chromium.org
3989dd415b Check in new Windows binaries.
These binaries include recent changes to pdb_source_line_writer for handling
PDBs with OMAP data. They were built using the GYP build files, MSVS 2010 and
DIA SDK 8.0.

Review URL: https://breakpad.appspot.com/584002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1177 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-09 16:29:56 +00:00
thestig@chromium.org
09f8989389 Mac: Fix more errors from clang to get crash_report.xcodeproj close to compiling.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/593002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1176 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-08 20:24:03 +00:00
thestig@chromium.org
7304a2c187 Fix mac dump_syms after r1163.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/592002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1175 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-08 17:41:12 +00:00
rsesek@chromium.org
df6f45b04b NULL-check the entry in NonAllocatingMap before setting on it.
Using just an assert will still cause a crash in a release build.

BUG=http://code.google.com/p/chromium/issues/detail?id=238757
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/593003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1174 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-08 16:06:33 +00:00
mseaborn@chromium.org
b45b97b2fd Make x86-64 stack walking work for Native Client minidumps
For NaCl, a stack walker should ignore the top 32 bits of %rip, %rsp
and %rbp, otherwise it will try to read from %r15-extended stack
addresses and look up symbol info for %r15-extended code addresses,
which will fail.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST=tested manually with a NaCl minidump

Review URL: https://breakpad.appspot.com/591002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1173 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-08 02:37:15 +00:00
mseaborn@chromium.org
85c352695f Add MD_OS_NACL platform_id value for identifying NaCl minidumps
Change minidump-2-core to accept minidumps with this platform_id value
rather than rejecting them as non-Linux dumps.

Add a missing "break" for a MD_OS_PS3 case.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST= tested with work-in-progress NaCl minidump generator

Review URL: https://breakpad.appspot.com/590002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1172 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-06 23:33:02 +00:00
mseaborn@chromium.org
b43dacb23a Fix an "unused variable" compiler warning in exploitability_win.cc
BUG=none
TEST=compile with "-Wall -Werror"

Review URL: https://breakpad.appspot.com/588003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1171 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-06 23:27:28 +00:00
mark@chromium.org
3444ed7cf1 Fix GetLoadingAddress() to work for Native Client executables
NaCl executables have ELF program headers that look like this (for the
original NaCl x86 GCC toolchain):

Program Header:
    LOAD off    0x00010000 vaddr 0x00020000 paddr 0x00020000 align 2**16
         filesz 0x00017ce0 memsz 0x00017ce0 flags r-x
    LOAD off    0x00030000 vaddr 0x10020000 paddr 0x10020000 align 2**16
         filesz 0x00001c98 memsz 0x00001c98 flags r--
    LOAD off    0x00040000 vaddr 0x10030000 paddr 0x10030000 align 2**16
         filesz 0x000025ec memsz 0x00002b88 flags rw-

or this (for the newer NaCl ARM GCC toolchain):

Program Header:
    LOAD off    0x00010000 vaddr 0x00020000 paddr 0x00020000 align 2**16
         filesz 0x000193b0 memsz 0x000193b0 flags r-x
    LOAD off    0x00000000 vaddr 0x10020000 paddr 0x10020000 align 2**16
         filesz 0x00000978 memsz 0x00000978 flags r--
    LOAD off    0x00001000 vaddr 0x10031000 paddr 0x10031000 align 2**16
         filesz 0x00000abc memsz 0x00000fac flags rw-

Fix GetLoadingAddress() to return the start address of the first
segment, 0x20000, in these cases.  Looking at p_offset for this isn't
correct, and the first segment doesn't have p_offset == 0 here because
NaCl can't map the ELF file headers as part of the first segment
(which is for validatable code only).

BUG= https://code.google.com/p/nativeclient/issues/detail?id=3424
TEST= check addresses in output of "dump_syms" when run on NaCl nexe

Patch by Mark Seaborn <mseaborn@chromium.org>
Review URL: https://breakpad.appspot.com/588002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1170 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-06 19:53:48 +00:00
qsr@chromium.org
e61b76c679 Fix minidump generation from exception.
Review URL: https://breakpad.appspot.com/583002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1169 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-03 15:04:12 +00:00
chrisha@chromium.org
110c99fbd5 Add GYP file for tools\windows\symupload.
This creates a GYP project file for the Windows symupload binary, allowing for
easier building. It also updates the old VC 8.0 project file to reflect recent
changes to PdbSourceLineWriter.

Review URL: https://breakpad.appspot.com/579002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1168 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-01 19:02:32 +00:00
chrisha@chromium.org
8507f63d38 Add explicit OMAP support to dump_syms.
This CL adds new utilities to common/windows for handling OMAP information in
PDB files. It then augments PdbSourceLineWriter with explicit OMAP knowledge so
that symbolization will proceed more cleanly for images whose PDB files contain
OMAP information. This makes breakpad handle OMAPped symbol files as cleanly as
WinDbg.

Review URL: https://breakpad.appspot.com/570002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1167 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-05-01 18:18:46 +00:00
ivan.penkov@gmail.com
5b36fbe088 Fixing a clang warning.
This is a followup change from https://breakpad.appspot.com/569002/

This prevents push_back from ever calling Realloc()
with 0 (which could happen if wasteful_vector was
constructed with size_hint set to 0, causing
allocated_ to be 0.
Review URL: https://breakpad.appspot.com/576002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1166 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-25 21:32:55 +00:00
thestig@chromium.org
0bdc714c20 Add MD_OS_PS3 to breakpad and exception types.
A=Jia Ji <jijia@google.com>
Original review: https://breakpad.appspot.com/571002/

Review URL: https://breakpad.appspot.com/574002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1165 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-25 20:36:31 +00:00
thestig@chromium.org
affac9413b Cleanup: Use scoped_ptr where appropriate in DwarfCUToModule.
Review URL: https://breakpad.appspot.com/572002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1164 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-24 21:40:27 +00:00
thestig@chromium.org
f7566bd447 Add an option to not handle DWARF inter-compilation unit references in Linux dump_syms.
This saves a lot of memory for dump_syms.

Review URL: https://breakpad.appspot.com/565002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1163 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-24 21:18:44 +00:00
ivan.penkov@gmail.com
ae3947e123 Fix Clang warning regarding null pointer argument.
This warning was showing up in the Clang static analyzer in Xcode: "Null pointer argument in call to memory copy function"

Fix provided by Ian Wilkinson.
Review URL: https://breakpad.appspot.com/569002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1162 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-24 21:02:55 +00:00
rsesek@chromium.org
77acc6adab Rewrite SimpleStringDictionary with NonAllocatingMap.
NonAllocatingMap has a near-identical interface, but is significantly less code,
more customizable, and has storage that is POD.

BUG=http://code.google.com/p/chromium/issues/detail?id=77656

Review URL: https://breakpad.appspot.com/568002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1161 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-24 18:15:48 +00:00
digit@chromium.org
593eff42ca Improve ARM CPU info reporting.
This patch improves several things for Linux/ARM:

- Better detection of the number of CPUs on the target
  device. The content of /proc/cpuinfo only matches the
  number of "online" CPUs, which varies over time with
  recent Android devices.

- Reconstruct the CPUID and ELF hwcaps values from
  /proc/cpuinfo, this is useful to better identify
  target devices in minidumps.

- Make minidump_dump display the new information
  in useful ways.

- Write a small helper class to parse /proc/cpuinfo
  and also use it for x86/64.

- Write a small helper class to parse sysfds cpu lists.

- Add a my_memchr() implementation.

- Add unit tests.

Tested on a Nexus S (1 CPU), Galaxy Nexus (2 CPUs)
and a Nexus 4 (4 CPUs).

Review URL: https://breakpad.appspot.com/540003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1160 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-24 10:06:14 +00:00
thestig@chromium.org
9f45f6b5cf Cleanup: Remove duplicate wording in license headers.
BUG=505

Review URL: https://breakpad.appspot.com/498002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1159 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-23 23:18:39 +00:00
ivan.penkov@gmail.com
fb22e80229 This change allows compiling sym_upload.cc and minidump_upload.cc using a global ::string class instead of std::string. For more details take a look at common/using_std_string.h
A few other fixes:

 - getopt() returns (int)(-1) when options are exhausted.  This was already sent out for code review by mattdr but only for sym_upload.cc (https://breakpad.appspot.com/561002/).  I'm applying the fix for both files.

 - Fixed a couple of lint warning about improper usage of white-spaces.

Thanks,
-Ivan
Review URL: https://breakpad.appspot.com/567002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1158 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-23 21:04:31 +00:00
ivan.penkov@gmail.com
40c9de4d8d Allow option for efficient and safe opt out of in-proc dump generation for Windows breakpad clients.
https://breakpad.appspot.com/549002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1157 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-23 00:47:53 +00:00
thestig@chromium.org
697da828dc Fix Bigcluster build error with minidump.cc after r1147.
A=Jia Ji <jijia@google.com>
Original review: https://breakpad.appspot.com/563002/

Review URL: https://breakpad.appspot.com/564003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1156 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-19 22:05:07 +00:00
rsesek@chromium.org
093b8aee9b Get SimpleStringDictionary compiling on Linux.
BUG=http://code.google.com/p/chromium/issues/detail?id=77656

Review URL: https://breakpad.appspot.com/564002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1155 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-19 19:32:20 +00:00
rsesek@chromium.org
30bb1ab601 Move SimpleStringDictionary from common/mac/ to just common/.
This also cleans up some things like the file name, trailing whitespace,
and making the test use gtest instead of sentest, since there's nothing
Mac specific about this.

BUG=https://code.google.com/p/chromium/issues/detail?id=77656

Review URL: https://breakpad.appspot.com/561003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1154 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-04-18 20:17:29 +00:00