| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
A smarter compiler (clang) can notice that we were not using the return
values being passed through HANDLE_EINTR, which meant most frequently
that we were missing checking the return value of close().
Review URL: http://codereview.chromium.org/569003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37786 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike glibc's backtrace_symbols(), google-glog's Symbolize() can
resolve symbols in binaries built with -fvisibility=hidden. This is
because Symbolize() uses both dynamic and regular symbols, while
backtrace_symbols() only uses dynamic symbols.
As shown below, the new backtrace is slightly less informative as it
does not have the binary name like out/Debug/base_unittests and the
distance information like +0x20, but it should be ok.
BUG=32762
TEST=out/Debug/base_unittests --gtest_filter='StackTrace*' --gtest_also_run_disabled_tests; and manually:
BEFORE
out/Debug/base_unittests(StackTrace::StackTrace()+0x20) [0x81d38f6]
out/Debug/base_unittests(StackTrace_DISABLED_DebugOutputToStream_Test::TestBody()+0x17) [0x806633d]
out/Debug/base_unittests(testing::Test::Run()+0x7a) [0x8242f96]
out/Debug/base_unittests(testing::internal::TestInfoImpl::Run()+0xb9) [0x824347b]
out/Debug/base_unittests(testing::TestCase::Run()+0xb7) [0x8243a7f]
out/Debug/base_unittests(testing::internal::UnitTestImpl::RunAllTests()+0x256) [0x824777e]
out/Debug/base_unittests(testing::UnitTest::Run()+0x14) [0x824680a]
out/Debug/base_unittests [0x8048cc5]
out/Debug/base_unittests(main+0x50) [0x80482a4]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb6b41b56]
out/Debug/base_unittests [0x80481c1]
AFTER
% out/Debug/base_unittests --gtest_filter='*DebugOutputToStream' --gtest_also_run_disabled_tests
StackTrace::StackTrace() [0x81d3910]
StackTrace_DISABLED_DebugOutputToStream_Test::TestBody() [0x806633d]
testing::Test::Run() [0x8242f66]
testing::internal::TestInfoImpl::Run() [0x824344b]
testing::TestCase::Run() [0x8243a4f]
testing::internal::UnitTestImpl::RunAllTests() [0x824774e]
testing::UnitTest::Run() [0x82467da]
TestSuite::Run() [0x8048cc5]
main [0x80482a4]
0xb6c0db56
0x80481c1
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=36997
Review URL: http://codereview.chromium.org/545148
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37090 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
debug_util_posix.cc.
Unlike glibc's backtrace_symbols(), googleglog's Symbolize() can
resolve symbols in binaries built with fvisibility=hidden. This is
because Symbolize() uses both dynamic and regular symbols, while
backtrace_symbols() only uses dynamic symbols.
As shown below, the new backtrace is slightly less informative as it
does not have the binary name like out/Debug/base_unittests and the
distance information like +0x20, but it should be ok.
BUG=32762
TEST=out/Debug/base_unittests gtest_filter='StackTrace*' gtest_also_run_disabled_tests; and manually:
BEFORE
out/Debug/base_unittests(StackTrace::StackTrace()+0x20) [0x81d38f6]
out/Debug/base_unittests(StackTrace_DISABLED_DebugOutputToStream_Test::TestBody()+0x17) [0x806633d]
out/Debug/base_unittests(testing::Test::Run()+0x7a) [0x8242f96]
out/Debug/base_unittests(testing::internal::TestInfoImpl::Run()+0xb9) [0x824347b]
out/Debug/base_unittests(testing::TestCase::Run()+0xb7) [0x8243a7f]
out/Debug/base_unittests(testing::internal::UnitTestImpl::RunAllTests()+0x256) [0x824777e]
out/Debug/base_unittests(testing::UnitTest::Run()+0x14) [0x824680a]
out/Debug/base_unittests [0x8048cc5]
out/Debug/base_unittests(main+0x50) [0x80482a4]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb6b41b56]
out/Debug/base_unittests [0x80481c1]
AFTER
% out/Debug/base_unittests gtest_filter='*DebugOutputToStream' gtest_also_run_disabled_tests
StackTrace::StackTrace() [0x81d3910]
StackTrace_DISABLED_DebugOutputToStream_Test::TestBody() [0x806633d]
testing::Test::Run() [0x8242f66]
testing::internal::TestInfoImpl::Run() [0x824344b]
testing::TestCase::Run() [0x8243a4f]
testing::internal::UnitTestImpl::RunAllTests() [0x824774e]
testing::UnitTest::Run() [0x82467da]
TestSuite::Run() [0x8048cc5]
main [0x80482a4]
0xb6c0db56
0x80481c1
Review URL: http://codereview.chromium.org/545148
TBR=satorux@chromium.org
Review URL: http://codereview.chromium.org/545185
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36998 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike glibc's backtrace_symbols(), google-glog's Symbolize() can
resolve symbols in binaries built with -fvisibility=hidden. This is
because Symbolize() uses both dynamic and regular symbols, while
backtrace_symbols() only uses dynamic symbols.
As shown below, the new backtrace is slightly less informative as it
does not have the binary name like out/Debug/base_unittests and the
distance information like +0x20, but it should be ok.
BUG=32762
TEST=out/Debug/base_unittests --gtest_filter='StackTrace*' --gtest_also_run_disabled_tests; and manually:
BEFORE
out/Debug/base_unittests(StackTrace::StackTrace()+0x20) [0x81d38f6]
out/Debug/base_unittests(StackTrace_DISABLED_DebugOutputToStream_Test::TestBody()+0x17) [0x806633d]
out/Debug/base_unittests(testing::Test::Run()+0x7a) [0x8242f96]
out/Debug/base_unittests(testing::internal::TestInfoImpl::Run()+0xb9) [0x824347b]
out/Debug/base_unittests(testing::TestCase::Run()+0xb7) [0x8243a7f]
out/Debug/base_unittests(testing::internal::UnitTestImpl::RunAllTests()+0x256) [0x824777e]
out/Debug/base_unittests(testing::UnitTest::Run()+0x14) [0x824680a]
out/Debug/base_unittests [0x8048cc5]
out/Debug/base_unittests(main+0x50) [0x80482a4]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb6b41b56]
out/Debug/base_unittests [0x80481c1]
AFTER
% out/Debug/base_unittests --gtest_filter='*DebugOutputToStream' --gtest_also_run_disabled_tests
StackTrace::StackTrace() [0x81d3910]
StackTrace_DISABLED_DebugOutputToStream_Test::TestBody() [0x806633d]
testing::Test::Run() [0x8242f66]
testing::internal::TestInfoImpl::Run() [0x824344b]
testing::TestCase::Run() [0x8243a4f]
testing::internal::UnitTestImpl::RunAllTests() [0x824774e]
testing::UnitTest::Run() [0x82467da]
TestSuite::Run() [0x8048cc5]
main [0x80482a4]
0xb6c0db56
0x80481c1
Review URL: http://codereview.chromium.org/545148
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36997 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/495002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35321 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My first Chromium linux build greeted me with a backtrace of mangled symbols
(FWIW, my /dev/shm permission was wrong). That made me write this patch.
BEFORE:
../sconsbuild/Debug/base_unittests(_ZN10StackTraceC1Ev+0x20) [0x817795e]
../sconsbuild/Debug/base_unittests(_ZN30StackTrace_OutputToStream_Test8TestBodyEv+0x18) [0x805fc98]
../sconsbuild/Debug/base_unittests(_ZN7testing4Test3RunEv+0x7e) [0x82005ea]
AFTER:
../sconsbuild/Debug/base_unittests(StackTrace::StackTrace()+0x20) [0x817778c]
../sconsbuild/Debug/base_unittests(StackTrace_OutputToStream_Test::TestBody()+0x18) [0x805fc98]
../sconsbuild/Debug/base_unittests(testing::Test::Run()+0x7e) [0x8200786]
BUG=none
TEST=manually tested. also ran base_unittests
Review URL: http://codereview.chromium.org/267074
Patch from Satoru Takabayashi <satorux@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28940 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
| |
inherently unsafe in multi-threaded apps because it stores the string in a global buffer. It should never be used. If you want to log an error, use PLOG and friends, or if that's too high-level then use safe_strerror().
TEST=built on Linux in 32-bit and 64-bit mode; ran base_unittests in each case; ran Chromium itself in each case; try servers
BUG=none
Review URL: http://codereview.chromium.org/261055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28850 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changing the comparison form affects the warning messages
generated in various circumstances. See the codereview for
details.
Also, Apple docs claim that !symbol comparisons will not work.
Spotted by Matthew Vosburgh.
Review URL: http://codereview.chromium.org/214012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26569 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
| |
Comparing a function with NULL has been prohibited since gcc 4.3 and produces a compilation error.
This change encloses your code which compares a function with NULL with "#if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5" and "#endif".
BUG=none
TEST=build chromium with gcc 4.3 (and later)
Review URL: http://codereview.chromium.org/206024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26449 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
It broke the tree which seems unrelated but Mark also wants
hbono's patch landed instead of this one.
Review URL: http://codereview.chromium.org/211007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26432 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
The warnings are legit but it seems cleaner to do this than to do tons
of #if defined(OS_MACOSX) bits to handle the changes from r26285.
Review URL: http://codereview.chromium.org/206026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26431 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
Add "support_macosx_10_4" option to common.gypi that causes it to change deployment target, and define a new preprocessor symbol on the Mac build. Setting this flag to true is harmless on non Mac builds and has no effect.
Make various changes to source files where they modify their behavior in the presence of the new preprocessor symbol to become 10.4 compatible.
Review URL: http://codereview.chromium.org/201122
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26285 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
with the StringPiece class in icu4.2, which is a problem
when trying to use the system version of icu.
Review URL: http://codereview.chromium.org/193072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25920 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
| |
Also remove std::vector<> from StackTrace to reduce heap usage during potential unstable execution.
TEST=none
BUG=http://crbug.com/20996
Review URL: http://codereview.chromium.org/201050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25685 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/115087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15548 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Comments from Ryan:
Some small changes to get chromium building on ARM. I tested these using the
standard Linux tool chain and crosstools-ng.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/99365
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15241 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On POSIX systems, system calls can be interrupted by signals. In this
case, they'll return EINTR, indicating that the system call needs to
be restarted.
(The situation is a little more complicated than this with SA_RESTART,
but you can read man 7 signal if you like.)
The short of it is that you need to catch EINTR and restart the call
for these system calls:
* read, readv, write, writev, ioctl
* open() when dealing with a fifo
* wait*
* Anything socket based (send*, recv*, connect, accept etc)
* flock and lock control with fcntl
* mq_ functions which can block
* futex
* sem_wait (and timed wait)
* pause, sigsuspend, sigtimedwait, sigwaitinfo
* poll, epoll_wait, select and 'p' versions of the same
* msgrcv, msgsnd, semop, semtimedop
* close (although, on Linux, EINTR won't happen here)
* any sleep functions (careful, you need to handle this are restart
with different arguments)
We've been a little sloppy with this until now. This patch adds a
macro for dealing with this and corrects every case of these system
calls (that I found).
The macro is HANDLE_EINTR in base/eintr_wrapper.h. It's safe to
include on Windows and is a no-op there.
On POSIX, it uses GCC magic to return the correct type based on the
expression and restarts the system call if it throws EINTR.
And you can use it like:
HANDLE_EINTR(close(fd));
Or:
ssize_t bytes_read = HANDLE_EINTR(read(fd, buffer, len));
*BEWARE* that it will evaluate the argument multiple times, so this is
not safe:
HANDLE_EINTR(close(FireMissiles()));
http://groups.google.com/group/chromium-dev/browse_thread/thread/41a35b2a457d73a0
http://codereview.chromium.org/100225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15102 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
This provides basic support for looking up backtrace information on GNU libc systems and in Windows. The code is only enabled for FATAL log messages in debug mode. In a release build, it is unlikely that symbols will be available making the backtrace less useful.
Review URL: http://codereview.chromium.org/62140
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14391 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/21084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9225 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/18173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8229 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/18332
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8222 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the moment, it only works on Linux, although it should be pretty easy to
get it working on Mac with __builtin_return_address and __builtin_frame_address.
It will mostly fail to resolve functions. Use this wrapper script:
import os
import sys
import subprocess
import re
address = re.compile('.*\[(0x[0-9a-fA-F]{4,8})\].*')
if __name__ == '__main__':
p = subprocess.Popen(sys.argv[1:], stderr = subprocess.STDOUT, stdout = subprocess.PIPE)
addr2line = subprocess.Popen(['addr2line', '-e', sys.argv[1], '-f', '-C', '-s'],
stdout = subprocess.PIPE, stdin = subprocess.PIPE)
for line in p.stdout.readlines():
m = address.match(line);
if m is not None:
addr2line.stdin.write(m.groups()[0] + '\n')
function = addr2line.stdout.readline()[:-1]
location = addr2line.stdout.readline()[:-1]
sys.stdout.write('%s (%s)\n' % (function, location))
else:
sys.stdout.write(line)
Review URL: http://codereview.chromium.org/18303
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8218 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
| |
Review URL: http://codereview.chromium.org/6582
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3009 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1300 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
| |
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
|
|
supported added, and Mac OSX left as a todo for the mac team.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@785 0039d316-1c4b-4281-b951-d872f2087c98
|