pacificIT / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

CEF3: Linux: Crash when passing command-line arguments to cef_unittests #620

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Run cef_unittests with command-line arguments.

What is the expected output? What do you see instead?
cef_unittests should run successfully. Instead, it crashes in 
CefTestSuite::InitCommandLine.

Please use labels and text to provide additional information.
The problem is that the setproctitle function in 
content/common/set_process_title_linux.cc changes the global argv value. It is 
called during initialization of ContentMainRunner:

setproctitle() at set_process_title_linux.cc:91 0x7ffff13feec8   
SetProcessTitleFromCommandLine() at set_process_title.cc:75 0x7ffff13fec83   
() at content_main_runner.cc:554 0x7ffff0f2a43e

As a result the argv value is corrupted by the time that 
CefTestSuite::InitCommandLine is called.

I've started a thread about this on chromium-dev: 
http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/
58e999aa2f29c5ee

Original issue reported on code.google.com by magreenb...@gmail.com on 1 Jun 2012 at 10:15

GoogleCodeExporter commented 9 years ago
The argv array will also be modified by TestSuite initialization in 
ParseGoogleTestFlagsOnlyImpl. The below stack trace is from Chromium trunk 
revision 275973.

Hardware watchpoint 4: -location array_[1]

Old value = 0x27e8e4a3a020 "--gtest_filter="
New value = 0x10 <Address 0x10 out of bounds>
testing::internal::ParseGoogleTestFlagsOnlyImpl<char> (argc=0x7fffffffdb74, 
argv=0x27e8e4a3afc0) at ../../testing/gtest/src/gtest.cc:4641
4641          for (int j = i; j != *argc; j++) {
(gdb) bt
#0  testing::internal::ParseGoogleTestFlagsOnlyImpl<char> (argc=0x7fffffffdb74, 
argv=0x27e8e4a3afc0) at ../../testing/gtest/src/gtest.cc:4641
#1  0x000000000073decf in testing::internal::ParseGoogleTestFlagsOnly 
(argc=0x7fffffffdb74, argv=0x27e8e4a3afc0)
    at ../../testing/gtest/src/gtest.cc:4671
#2  0x0000000000746466 in testing::internal::InitGoogleTestImpl<char> 
(argc=0x7fffffffdb74, argv=0x27e8e4a3afc0)
    at ../../testing/gtest/src/gtest.cc:4701
#3  0x000000000073df19 in testing::InitGoogleTest (argc=0x7fffffffdb74, 
argv=0x27e8e4a3afc0) at ../../testing/gtest/src/gtest.cc:4717
#4  0x000000000070f48e in base::TestSuite::InitializeFromCommandLine 
(this=0x7fffffffdc60, argc=2, argv=0x27e8e4a3afc0)
    at ../../base/test/test_suite.cc:118
#5  0x000000000070f36d in base::TestSuite::TestSuite (this=0x7fffffffdc60, 
argc=2, argv=0x27e8e4a3afc0) at ../../base/test/test_suite.cc:94
#6  0x0000000000568a80 in CefTestSuite::CefTestSuite (this=0x7fffffffdc60, 
argc=2, argv=0x27e8e4a3afc0)
    at ../../cef/tests/unittests/test_suite.cc:22
#7  0x000000000052823a in main (argc=2, argv=0x7fffffffded8) at 
../../cef/tests/unittests/run_all_unittests.cc:108

Original comment by magreenb...@gmail.com on 25 Jun 2014 at 7:28

GoogleCodeExporter commented 9 years ago
Fixed in trunk revision 1750.

Original comment by magreenb...@gmail.com on 25 Jun 2014 at 7:47