Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 458396 - www-client/chromium-26.0.1410.5 SecurityTest.CallocOverflow crashes (out of memory)
Summary: www-client/chromium-26.0.1410.5 SecurityTest.CallocOverflow crashes (out of m...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard: ht-wanted
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-20 03:28 UTC by Mike Gilbert
Modified: 2013-03-01 03:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2013-02-20 03:28:45 UTC
Hmm... a test called CallocOverflow triggers an OOM kill. That seems kind of obvious...

[ RUN      ] SecurityTest.CallocOverflow
[32412:32412:0219/202811:977136314962:FATAL:process_util_linux.cc(740)] Out of memory, size = 4503599627370505
Received signal 6
 [0x00000081aeae] base::debug::StackTrace::StackTrace()
 [0x00000081b3d4] base::debug::(anonymous namespace)::StackDumpSignalHandler()
 [0x7f5f2f1d0050] <unknown>
 [0x7f5f2b312dd5] gsignal
 [0x7f5f2b3142a5] abort
 [0x00000087bfa9] base::debug::BreakDebugger()
 [0x000000834ae5] logging::LogMessage::~LogMessage()
 [0x00000084a6df] base::(anonymous namespace)::OnNoMemorySize()
 [0x00000084a84a] calloc
 [0x0000006b3480] (anonymous namespace)::SecurityTest_CallocOverflow_Test::TestBody()
 [0x0000008b71a2] testing::Test::Run()
 [0x0000008b7270] testing::TestInfo::Run()
 [0x0000008b739c] testing::TestCase::Run()
 [0x0000008b762d] testing::internal::UnitTestImpl::RunAllTests()
 [0x0000008b6ace] testing::UnitTest::Run()
 [0x000000892a30] base::TestSuite::Run()
 [0x000000426efa] main
 [0x7f5f2b2ff66d] __libc_start_main
 [0x000000427a39] <unknown>
  r8: 0000000000000054  r9: 00000000000000b4 r10: 0000000000000008 r11: 0000000000000206
 r12: 00007fffe9bde1d0 r13: 0000000000000000 r14: 0000013cf5370f80 r15: 000000000000005d
  di: 0000000000007e9c  si: 0000000000007e9c  bp: 00007f5f2b9914a0  bx: 00007fffe9bde640
  dx: 0000000000000006  ax: 0000000000000000  cx: ffffffffffffffff  sp: 00007fffe9bde068
  ip: 00007f5f2b312dd5 efl: 0000000000000206 cgf: 0000000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
 * ERROR: www-client/chromium-26.0.1410.5 failed (test phase):
 *   virtualmake: the out/Release/base_unittests failed.
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_test
 *   environment, line 4467:  Called runtest 'out/Release/base_unittests' 'ICUStringConversionsTest.*' 'MessagePumpLibeventTest.*'
 *   environment, line 4464:  Called virtualmake '--gtest_filter=-ICUStringConversionsTest.*:MessagePumpLibeventTest.*'
 *   environment, line 5291:  Called die
 * The specific snippet of code:
 *       [[ ${retval} -ne 0 ]] && die "${FUNCNAME}: the ${VIRTUALX_COMMAND} failed.";
 * 
 * If you need support, post the output of `emerge --info '=www-client/chromium-26.0.1410.5'`,
 * the complete build log and the output of `emerge -pqv '=www-client/chromium-26.0.1410.5'`.
 * The complete build log is located at '/var/log/portage/www-client:chromium-26.0.1410.5:20130220-002151.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/www-client/chromium-26.0.1410.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-client/chromium-26.0.1410.5/temp/environment'.
 * Working directory: '/var/tmp/portage/www-client/chromium-26.0.1410.5/work/chromium-26.0.1410.5'
 * S: '/var/tmp/portage/www-client/chromium-26.0.1410.5/work/chromium-26.0.1410.5'
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-24 19:36:54 UTC
(In reply to comment #0)
> Hmm... a test called CallocOverflow triggers an OOM kill. That seems kind of
> obvious...
> 
> [ RUN      ] SecurityTest.CallocOverflow
> [32412:32412:0219/202811:977136314962:FATAL:process_util_linux.cc(740)] Out
> of memory, size = 4503599627370505
> Received signal 6

Is that with USE="-tcmalloc"? I'll look into it.
Comment 2 Mike Gilbert gentoo-dev 2013-02-24 20:11:47 UTC
(In reply to comment #1)
> Is that with USE="-tcmalloc"? I'll look into it.

Yes, with USE="-tcmalloc". Here's my full info:

Portage 2.2.0_alpha163 (default/linux/amd64/13.0/desktop/kde, gcc-4.7.2, glibc-2.15-r3, 3.7.9 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.7.9-x86_64-AMD_Phenom-tm-_II_X6_1055T_Processor-with-gentoo-2.2
KiB Mem:     8180036 total,     70312 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Unknown
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.5.4-r5, 2.6.8-r1, 2.7.3-r3, 3.1.5-r1, 3.2.3-r2, 3.3.0-r1
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.4.7, 4.5.4, 4.6.3, 4.7.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo floppym local
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -Wall"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /usr/share/themes"
CXXFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -Wall"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --with-bdeps=y --quiet-build=n --jobs=6"
FCFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -Wall"
FEATURES="assume-digests binpkg-logs buildpkg clean-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=native -frecord-gcc-switches -Wall"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j6"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--ipv4"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/home/floppym/gentoo-x86"
PORTDIR_OVERLAY="/home/floppym/overlays/floppym /home/floppym/overlays/local"
SYNC="cvs://floppym@cvs.gentoo.org:/var/cvsroot"
USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo caps cdda cdr cli cracklib crypt css cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fontconfig fortran gdbm gif gles gpm gtk iconv imap ipv6 jpeg kde kipi lcms libnotify lzma mad mmx mmxext mng modules mono mp3 mp4 mpeg mtp mudflap multilib ncurses nls nptl nsplugin offensive ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline samba sdl semantic-desktop session spell sse sse2 sse3 ssl startup-notification suid svg systemd taglib tcpd theora threads tiff truetype udev udisks unicode upower usb vaapi vdpau vim-syntax vorbis wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib zsh-completion" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="btrfs" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64 emu pc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_5 python2_6 python2_7 python3_1 python3_2 python3_3 pypy1_8 pypy1_9 pypy2_0" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="nouveau nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.5 2.6 2.7 3.1 3.2 3.3 2.7-pypy-1.9 2.7-pypy-2.0"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================
USE="cups test -bindist -custom-cflags -gnome -gnome-keyring -gps -kerberos (-pulseaudio) (-selinux) (-system-ffmpeg) -tcmalloc" LINGUAS="-am -ar -bg -bn -ca -cs -da -de -el -en_GB -es -es_LA -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt_BR -pt_PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -vi -zh_CN -zh_TW"

www-client/chromium-26.0.1403.0 was built with the following:
CFLAGS="-O2 -pipe -march=native -Wall"
CXXFLAGS="-O2 -pipe -march=native -Wall"
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-02-27 22:48:16 UTC
(In reply to comment #0)
> Hmm... a test called CallocOverflow triggers an OOM kill. That seems kind of
> obvious...
> 
> [ RUN      ] SecurityTest.CallocOverflow
> [32412:32412:0219/202811:977136314962:FATAL:process_util_linux.cc(740)] Out
> of memory, size = 4503599627370505
> Received signal 6

The weird thing is that CallocDiesOnOOM should be returning true for us, and the test looks like (trunk):

TEST(SecurityTest, DISABLE_ON_ASAN(CallocOverflow)) {
  const size_t kArraySize = 4096;
  const size_t kMaxSizeT = numeric_limits<size_t>::max();
  const size_t kArraySize2 = kMaxSizeT / kArraySize + 10;
  if (!CallocDiesOnOOM()) {
    EXPECT_TRUE(CallocReturnsNull(kArraySize, kArraySize2));
    EXPECT_TRUE(CallocReturnsNull(kArraySize2, kArraySize));
  } else {
    // It's also ok for calloc to just terminate the process.
#if defined(GTEST_HAS_DEATH_TEST)
    EXPECT_DEATH(CallocReturnsNull(kArraySize, kArraySize2), "");
    EXPECT_DEATH(CallocReturnsNull(kArraySize2, kArraySize), "");
#endif  // GTEST_HAS_DEATH_TEST
  }
}

So we should be in EXPECT_DEATH branch, which runs calloc in a forked process that should not crash the original one.

I'm not sure what's going on, and this seems to be either 64-bit specific or fixed in M27.
Comment 4 Mike Gilbert gentoo-dev 2013-03-01 00:52:23 UTC
It seems to be resolved in chromium-27.0.1423.0.
Comment 5 Mike Gilbert gentoo-dev 2013-03-01 03:30:54 UTC
  01 Mar 2013; Mike Gilbert <floppym@gentoo.org> chromium-26.0.1410.19.ebuild:
  Disable SecurityTest.CallocOverflow for M26, bug 458396.