On Thu, Apr 26, 2012 at 3:45 AM, Julian Seward <jsew...@acm.org> wrote:
>
> On Thursday, April 26, 2012, John Reiser wrote:
>> It's a *BUG* in valgrind that valgrind does not print the bytes [or words,
>> etc.] of the instruction stream that valgrind does not understand.
>> [This is immediately obvious to *EVERY* user, but so far the developers
>> have been oblivious.]
>
> It always prints the bytes of the instruction it can't parse.  Without
> that we'd never be able to make sense of any "unhandled insn" style
> bug reports.  It seems like you removed them from the initial posting,
> though.  Do you have a line of the form
>
> vex amd64->IR: unhandled instruction bytes: 0xC5 0xF8 0x77 0xC3 0xF6
>
Ah, yes. For some reason, I thought that was output related to the aes
changes. That line is as follows:

vex amd64->IR: unhandled instruction bytes: 0xF 0xB 0x55 0x48 0x89
0xE5 0x41 0x56

> Anyway, I suspect that will merely tell us that abort crapped out on
> 0x0F 0x0D, which is the official undefined instruction "ud2", so that's
> not useful.  We need to know why the program jumped to abort() in the
> first place.
>
> The svn trunk does work on OSX 10.7.3 -- I was working with it at
> the weekend.  Really what is needed is a way to reproduce this failure.
>

In order to get to this point, I followed these steps:
* checked out valgrind from SVN
* ran "autogen.sh"
* ./configure
* make
* make install

nothing special, vanilla valgrind build. I then tried to run valgrind
with no options:
valgrind /Applications/TextEdit.app/Contents/MacOS/TextEdit. I can
also confirm that I have no other version of valgrind installed on the
system.

As for doing a db-attach, that seems to have failed as well - I never
make it to a gdb session. Here is the full output of a db-attach
valgrind run on TextEdit.app:



valgrind --db-attach=yes /Applications/TextEdit.app/Contents/MacOS/TextEdit
==76980== Memcheck, a memory error detector
==76980== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==76980== Using Valgrind-3.8.0.SVN and LibVEX; rerun with -h for copyright info
==76980== Command: /Applications/TextEdit.app/Contents/MacOS/TextEdit
==76980==
UNKNOWN __pthread_sigmask is unsupported. This warning will not be repeated.
vex amd64->IR: unhandled instruction bytes: 0xF 0xB 0x55 0x48 0x89
0xE5 0x41 0x56
==76980== valgrind: Unrecognised instruction at address 0x3a36b8c.
==76980==    at 0x3A36B8C: __abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3A36AAA: abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3D79431: _SCSessionUniverseByUIDAcquireAndLock (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D73358: FSNodeStorageGetAndLockCurrentUniverse (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D731C0: FileIDTreeGetAndLockVolumeEntryForDeviceID
(in 
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97E63: FSMount::FSMount(unsigned int,
FSMountNumberType, int*, unsigned int const*) (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97D58: FSMountPrepare (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x8D8EDA3: MountInfoPrepare(void***, unsigned int,
int, void*, unsigned int const*, __CFURL const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D80ADF: parseAttributeBuffer(__CFAllocator const*,
unsigned char const*, unsigned char, attrlist const*, void const*,
void**, _FileAttributes*, unsigned int*) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D81167: corePropertyProviderPrepareValues(__CFURL
const*, __FileCache*, __CFString const* const*, void const**, long,
void const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D7D737: prepareValuesForBitmap(__CFURL const*,
__FileCache*, _FilePropertyBitmap*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D82778: _FSURLGetCatalogInfo (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x44863BA: FSNodePrepareCatalogInfo (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x44867E9: _LSGetBundleClassForNode (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x4487304: _LSFindOrRegisterBundleNode (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x448B420: _LSRegisterSelf (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x448A301: _LSApplicationCheckIn (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x575BF55: _RegisterApplication (in
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices)
==76980==    by 0x575A89C: GetCurrentProcess (in
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices)
==76980==    by 0x235147A: _GetAggregateUIMode (in
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox)
==76980==    by 0x2351433: IsMenuBarVisible (in
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox)
==76980==    by 0x97820E: _NSInitializeAppContext (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x97774A: -[NSApplication init] (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x977371: +[NSApplication sharedApplication] (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0xBF88E0: NSApplicationMain (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x100001677: ??? (in
/Applications/TextEdit.app/Contents/MacOS/TextEdit)
==76980== Your program just tried to execute an instruction that Valgrind
==76980== did not recognise.  There are two possible reasons for this.
==76980== 1. Your program has a bug and erroneously jumped to a non-code
==76980==    location.  If you are running Memcheck and you just saw a
==76980==    warning about a bad jump, it's probably your program's fault.
==76980== 2. The instruction is legitimate but Valgrind doesn't handle it,
==76980==    i.e. it's Valgrind's fault.  If you think this is the case or
==76980==    you are not sure, please let us know and we'll try to fix it.
==76980== Either way, Valgrind will now raise a SIGILL signal which will
==76980== probably kill your program.
==76980==
==76980== Process terminating with default action of signal 4 (SIGILL)
==76980==  Illegal opcode at address 0x3A36B8C
==76980==    at 0x3A36B8C: __abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3A36AAA: abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3D79431: _SCSessionUniverseByUIDAcquireAndLock (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D73358: FSNodeStorageGetAndLockCurrentUniverse (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D731C0: FileIDTreeGetAndLockVolumeEntryForDeviceID
(in 
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97E63: FSMount::FSMount(unsigned int,
FSMountNumberType, int*, unsigned int const*) (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97D58: FSMountPrepare (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x8D8EDA3: MountInfoPrepare(void***, unsigned int,
int, void*, unsigned int const*, __CFURL const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D80ADF: parseAttributeBuffer(__CFAllocator const*,
unsigned char const*, unsigned char, attrlist const*, void const*,
void**, _FileAttributes*, unsigned int*) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D81167: corePropertyProviderPrepareValues(__CFURL
const*, __FileCache*, __CFString const* const*, void const**, long,
void const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D7D737: prepareValuesForBitmap(__CFURL const*,
__FileCache*, _FilePropertyBitmap*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D82778: _FSURLGetCatalogInfo (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==
==76980== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- Y

valgrind: m_debugger.c:238 (ptrace_setregs): Assertion 'Unimplemented
functionality' failed.
valgrind: valgrind
==76980==    at 0x23803839B: ???
==76980==    by 0x23803866F: ???
==76980==    by 0x2380321DA: ???
==76980==    by 0x23804CC73: ???
==76980==    by 0x23804D83A: ???
==76980==    by 0x2380A5491: ???
==76980==    by 0x2380D078D: ???

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable
==76980==    at 0x3A36B8C: __abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3A36AAA: abort (in /usr/lib/system/libsystem_c.dylib)
==76980==    by 0x3D79431: _SCSessionUniverseByUIDAcquireAndLock (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D73358: FSNodeStorageGetAndLockCurrentUniverse (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D731C0: FileIDTreeGetAndLockVolumeEntryForDeviceID
(in 
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97E63: FSMount::FSMount(unsigned int,
FSMountNumberType, int*, unsigned int const*) (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x3D97D58: FSMountPrepare (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore)
==76980==    by 0x8D8EDA3: MountInfoPrepare(void***, unsigned int,
int, void*, unsigned int const*, __CFURL const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D80ADF: parseAttributeBuffer(__CFAllocator const*,
unsigned char const*, unsigned char, attrlist const*, void const*,
void**, _FileAttributes*, unsigned int*) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D81167: corePropertyProviderPrepareValues(__CFURL
const*, __FileCache*, __CFString const* const*, void const**, long,
void const*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D7D737: prepareValuesForBitmap(__CFURL const*,
__FileCache*, _FilePropertyBitmap*, __CFError**) (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x8D82778: _FSURLGetCatalogInfo (in
/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal)
==76980==    by 0x44863BA: FSNodePrepareCatalogInfo (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x44867E9: _LSGetBundleClassForNode (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x4487304: _LSFindOrRegisterBundleNode (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x448B420: _LSRegisterSelf (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x448A301: _LSApplicationCheckIn (in
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices)
==76980==    by 0x575BF55: _RegisterApplication (in
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices)
==76980==    by 0x575A89C: GetCurrentProcess (in
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices)
==76980==    by 0x235147A: _GetAggregateUIMode (in
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox)
==76980==    by 0x2351433: IsMenuBarVisible (in
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox)
==76980==    by 0x97820E: _NSInitializeAppContext (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x97774A: -[NSApplication init] (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x977371: +[NSApplication sharedApplication] (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0xBF88E0: NSApplicationMain (in
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit)
==76980==    by 0x100001677: ??? (in
/Applications/TextEdit.app/Contents/MacOS/TextEdit)

Thread 2: status = VgTs_WaitSys
==76980==    at 0x3B877E6: kevent (in /usr/lib/system/libsystem_kernel.dylib)
==76980==    by 0x398F14D: _dispatch_mgr_thread (in
/usr/lib/system/libdispatch.dylib)

Thread 3: status = VgTs_WaitSys
==76980==    at 0x3B87192: __workq_kernreturn (in
/usr/lib/system/libsystem_kernel.dylib)
==76980==    by 0x3A46B84: start_wqthread (in /usr/lib/system/libsystem_c.dylib)

Thread 4: status = VgTs_WaitSys
==76980==    at 0x3B87192: __workq_kernreturn (in
/usr/lib/system/libsystem_kernel.dylib)
==76980==    by 0x3A46B84: start_wqthread (in /usr/lib/system/libsystem_c.dylib)

Matt

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to