My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2044: The untrusted atomic_ops_test failed once on mac10.6-glibc-opt
1 person starred this issue and may be notified of changes. Back to list
 
Project Member Reported by mseaborn@chromium.org, Jul 18, 2011
The untrusted atomic_ops_test failed once today on mac10.6-glibc-opt with the following output:

scons-out/opt-mac-x86-32/staging/sel_ldr -a -- /b/build/slave/mac10.6-glibc-opt/build/native_client/toolchain/mac_x86/x86_64-nacl/lib32/runnable-ld.so --library-path /b/build/slave/mac10.6-glibc-opt/build/native_client/scons-out/nacl-x86-32-glibc/lib:/b/build/slave/mac10.6-glibc-opt/build/native_client/toolchain/mac_x86/x86_64-nacl/lib32 scons-out/nacl-x86-32-glibc/obj/tests/unittests/shared/platform/atomic_ops_test_nexe.nexe 25
Test /b/build/slave/mac10.6-glibc-opt/build/native_client/scons-out/nacl-x86-32-glibc/test_results/atomic_ops_test.out took 1.416667 secs

ERROR: Command returned exit status -11 (0xfffffff5) but we expected 0 (0x0)
======================================================================
...
Creating thread 24
[34105,2952933376:15:30:58.487378] invalid mmap flags 0400042, ignoring extraneous bits
Creating thread 25
[34105,2952933376:15:30:58.487687] invalid mmap flags 0400042, ignoring extraneous bits
PASSED

atomic_ops_test.out: FAILED
scons: *** [scons-out/nacl-x86-32-glibc/test_results/atomic_ops_test.out] Error 255


Given that it printed "PASSED", it must have segfaulted on one of the following function calls in main(), or in exit():

  NaClCondVarDtor(&gFinishedCv);
  NaClMutexDtor(&gMutex);
  free(threads);

Jul 18, 2011
#1 pdox%goo...@gtempaccount.com
This is disturbing. There could also be a race condition between the threads exiting (using NaClThreadExit) and main returning.
Jul 18, 2011
Project Member #2 mseaborn@chromium.org
I notice the test is implementing thread joining by hand.  It would be simpler if it used NaClThreadCreateJoinable().
Jul 18, 2011
#3 pdox%goo...@gtempaccount.com
That may be so, but that would also hide the flake. We should make sure there are no race conditions with multiple threads exiting at once.

The same bug might affect egyptian cotton.
Jul 22, 2011
Project Member #4 mseaborn@chromium.org
This failed today on xp-newlib-opt (still running the untrusted atomic_ops_test_nexe.nexe), so it is presumably not libc-specific or Mac-specific.

The output ended with:

Creating thread 24
Creating thread 25
PASSED
atomic_ops_test.out: FAILED
Jul 22, 2011
#5 pdox%goo...@gtempaccount.com
It appears that both egyptian_cotton_test and thread_stack_alloc_test flake in the same way.

On revision 6161:

Test C:\b\build\slave\win7-32-bare-newlib-opt\build\native_client\scons-out\nacl-x86-32/test_results/thread_stack_alloc_test.out took 0.249602 secs

ERROR: Command returned exit status -1 (0xffffffff) but we expected 0 (0x0)
======================================================================
Stdout
======================================================================
................................................................

................................................................

................................................................

...........................................................Thread creation failed at thread 251, error 11 (No more processes)

This is expected.

PASSED

...

thread_stack_alloc_test.out: FAILED
Jul 25, 2011
Project Member #6 ncb...@google.com
Observed again on mac10.6-glibc-opt.
Aug 5, 2011
Project Member #7 cstefan...@google.com
(No comment was entered for this change.)
Status: Available
Cc: ncb...@google.com
Labels: Mstone-15
Aug 5, 2011
Project Member #8 cstefan...@google.com
(No comment was entered for this change.)
Cc: mseaborn@chromium.org bradc...@google.com
Aug 9, 2011
Project Member #9 bugdro...@chromium.org
The following revision refers to this bug:
    http://src.chromium.org/viewvc/native_client?view=rev&revision=6371

------------------------------------------------------------------------
r6371 | mseaborn@chromium.org | Tue Aug 09 14:49:51 PDT 2011

Changed paths:
 M http://src.chromium.org/viewvc/native_client/trunk/src/native_client/tests/unittests/shared/platform/atomic_ops_test.c?r1=6371&r2=6370&pathrev=6371

atomic_ops_test: Simplify by using joinable threads

Rather than implementing thread joining by hand out of condvars, just
use joinable threads.

Also remove a redundant NaClThreadExit() call.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2044
TEST=run_atomic_ops_nexe_test

Review URL: http://codereview.chromium.org/7602019
------------------------------------------------------------------------
Aug 9, 2011
Project Member #10 bugdro...@chromium.org
Commit: 606b73a4cf02bf1279971aee9cb5e98a85289554
 Email: mseaborn@chromium.org@fcba33aa-ac0c-11dd-b9e7-8d5594d729c2

atomic_ops_test: Simplify by using joinable threads

Rather than implementing thread joining by hand out of condvars, just
use joinable threads.

Also remove a redundant NaClThreadExit() call.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=2044
TEST=run_atomic_ops_nexe_test

Review URL: http://codereview.chromium.org/7602019

git-svn-id: svn://svn.chromium.org/native_client/trunk/src/native_client@6371 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2

M	tests/unittests/shared/platform/atomic_ops_test.c
Aug 23, 2011
Project Member #11 pa...@google.com
Mark, assigning to you because you committed patches. Did the flakiness go away? Please, reassign if you feel the owner should be different.
Owner: mseaborn@chromium.org
Cc: pa...@google.com
Oct 25, 2012
Project Member #12 s...@google.com
(No comment was entered for this change.)
Cc: -pdox%goo...@gtempaccount.com
Dec 10, 2012
Project Member #13 mseaborn@chromium.org
We haven't seen this fail for quite a while, so I will close this.

I think the test was doing something invalid before my change.

The child thread does this:

  NaClXCondVarSignal(&gFinishedCv);	 
  NaClXMutexUnlock(&gMutex);

The condvar signal can cause the parent to destroy gMutex before the NaClXMutexUnlock() call above, which isn't valid.  That could explain the crash.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting