Bug 326797 - Assertion 'sizeof(UWord) == sizeof(UInt)' failed.
Summary: Assertion 'sizeof(UWord) == sizeof(UInt)' failed.
Status: RESOLVED DUPLICATE of bug 302630
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.9.0.SVN
Platform: Compiled Sources macOS
: NOR crash
Target Milestone: ---
Assignee: Rhys Kidd
URL:
Keywords:
Depends on:
Blocks: 304259
  Show dependency treegraph
 
Reported: 2013-10-28 20:19 UTC by matthewmitchell
Modified: 2015-05-27 13:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthewmitchell 2013-10-28 20:19:49 UTC
I have a problem with a multithreaded program on Mountain Lion using a recent SVN of valgrind. The problem occurs when using memcheck or helgrind. This was the output:

valgrind: m_syscall.c:178 (vgPlain_mk_SysRes_x86_darwin): Assertion 'sizeof(UWord) == sizeof(UInt)' failed.
==14905==    at 0x23804077B: ???
==14905==    by 0x238040A71: ???
==14905==    by 0x238058B55: ???
==14905==    by 0x2380D763D: ???
==14905==    by 0x2380B80F2: ???
==14905==    by 0x2380B58EA: ???
==14905==    by 0x2380E098D: ???

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable
==14905==    at 0x4BF686: mach_msg_trap (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0x4BB782: thread_terminate (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0x358C42: _pthread_exit (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x359D60: pthread_exit (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x100003250: main (testCBNodeFull.c:497)

Thread 2: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x33D14: CBNodeProcessMessages (CBNode.c:142)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 3: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x4A777: CBValidatorBlockProcessThread (CBValidator.c:286)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 4: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x33D14: CBNodeProcessMessages (CBNode.c:142)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 5: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x4A777: CBValidatorBlockProcessThread (CBValidator.c:286)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 6: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x33D14: CBNodeProcessMessages (CBNode.c:142)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 7: status = VgTs_WaitSys
==14905==    at 0x4C10FA: __psynch_cvwait (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xB3947: CBConditionWait (CBThreads.c:81)
==14905==    by 0x4A777: CBValidatorBlockProcessThread (CBValidator.c:286)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 8: status = VgTs_WaitSys
==14905==    at 0x4C1D16: kevent (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xCF51B: event_base_loop (in /opt/local/lib/libevent_core-2.0.5.dylib)
==14905==    by 0x7C2B0: CBStartEventLoop (CBLibEventSockets.c:139)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 9: status = VgTs_WaitSys
==14905==    at 0x4C1D16: kevent (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0xCF51B: event_base_loop (in /opt/local/lib/libevent_core-2.0.5.dylib)
==14905==    by 0x7C2B0: CBStartEventLoop (CBLibEventSockets.c:139)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

Thread 10: status = VgTs_WaitSys
==14905==    at 0x4C16FE: write$NOCANCEL (in /usr/lib/system/libsystem_kernel.dylib)
==14905==    by 0x3C0AD7: __sflush (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3C3532: __sfvwrite (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3C4A20: puts (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0xB684C: CBLog (CBLog.c:39)
==14905==    by 0xB6D83: CBLogVerbose (CBLog.c:64)
==14905==    by 0x7C2A4: CBStartEventLoop (CBLibEventSockets.c:138)
==14905==    by 0xB35F7: CBRunThread (CBThreads.c:54)
==14905==    by 0x3587A1: _pthread_start (in /usr/lib/system/libsystem_c.dylib)
==14905==    by 0x3451E0: thread_start (in /usr/lib/system/libsystem_c.dylib)

The program I was running can be found here: https://github.com/MatthewLM/cbitcoin/tree/2e49c285bcc132375c20625ad0eaeb1e9c9bebfc

The problem occurred with the testCBNodeFull program.

Reproducible: Always

Steps to Reproduce:
1. Download cbitcoin. You can do: git clone https://github.com/MatthewLM/cbitcoin.git; cd cbitcoin
2. Problem occurs at commit 2e49c285bcc132375c20625ad0eaeb1e9c9bebfc
3. run ./configure; make debug-test
4. testCBNodeFull should fail and make will delete it. Therefore manually compile it.
5. Run it with valgrind.
6. Tada.



OSX Version 10.8.4
Macbook White 13inch Mid 2009
2.13 GHz Intel Core 2 Duo
4GB Memory
Comment 1 Julian Seward 2014-09-03 06:57:35 UTC
Does this still happen with the trunk?  A whole bunch of problems
with OSX 10.9 and 10.8 have been fixed in the past couple of months.
It would be good if you could re-test.
Comment 2 Rhys Kidd 2015-03-07 09:02:15 UTC
I'd think this is more likely than not to have been resolved in the interim, but would be good to hear back confirmation from the original reporter if possible before closing.
Comment 3 Rhys Kidd 2015-05-04 13:12:22 UTC
Discovered reproducible with the below regression test on affected platforms:

$ perl tests/vg_regtest none/tests/pth_exit

This was with the below clang compiler and OS X version:

$ clang --version
Apple LLVM version 5.1 (clang-503.0.40)  (based on LLVM 3.4svn)
Target: x86_64-apple-darwin-12.0.0
Thread model: posix
$ uname -mrs
Darwin 12.0.0 x86_64

It is not present on OS X 10.9 (clang-600.0.57 based on LLVM 3.5svn) or OS X 10.10.
Comment 4 Rhys Kidd 2015-05-27 13:06:35 UTC

*** This bug has been marked as a duplicate of bug 302630 ***