|
From: <xtr...@gm...> - 2011-01-28 12:35:37
|
Hi to all, I'm very interested in using Valgrind and it has already given me some useful help. But after a few successful uses, now it keeps on crashing with: --37110:0:aspacem Valgrind: FATAL: aspacem assertion failed: --37110:0:aspacem addr <= addr + len - 1 --37110:0:aspacem at m_aspacemgr/aspacemgr-linux.c:3440 (add_mapping_callback) --37110:0:aspacem Exiting now. I'm calling the default memcheck tool and the only options are --num-callers=30 and --log-file=… The log gives me a pretty long list of: Conditional jump or move depends on uninitialised value(s) But they seem to be all related to library code outside of my control (system libraries or standard c++ lib), for example: ==37110== Conditional jump or move depends on uninitialised value(s) ==37110== at 0x1717D7C: pthread_mutex_unlock (in /usr/lib/libSystem.B.dylib) ==37110== by 0x250F: __gthread_mutex_unlock(_opaque_pthread_mutex_t*) (gthr-default.h:528) ==37110== by 0x2E03: std::tr1::_Sp_counted_base::weak_release() (boost_shared_ptr.h:166) ==37110== by 0x2E76: std::tr1::_Sp_counted_base::release() (boost_shared_ptr.h:150) ==37110== by 0x2E9B: std::tr1::shared_count::~shared_count() (boost_shared_ptr.h:266) …. I'm assuming they're not problematic. If I inhibit this errors with the proper option, at the time of crash the log is empty ( no errors ). I believe my application is currently fully functioning so I don't think it is the cause of the crash. Here are some relevant infos: OS: Mac OS X 10.6 Processor: Intel Core 2 Duo Application: Cocoa app written in C++ and Objective-C++ (HEAVY C++ templates going on, look at the example at the end...), built only for 32bit x86 Compiler: apple-gcc4.2 Built: no optimization, debug: DWARF with DSYM Thanks in advance for any help, Francesco P.S. If you wonder why I run the app in valgrind even if it works properly: I used Valgrind (and other tools, not at the same time: guard malloc,NSZombies ) to find some dangling pointer errors, it has been useful and I would like to be sure that I can rely on it when i need it. ----------------------------- ==37110== Conditional jump or move depends on uninitialised value(s) ==37110== at 0x1717D7C: pthread_mutex_unlock (in /usr/lib/libSystem.B.dylib) ==37110== by 0x250F: __gthread_mutex_unlock(_opaque_pthread_mutex_t*) (gthr-default.h:528) ==37110== by 0x2E03: std::tr1::_Sp_counted_base::weak_release() (boost_shared_ptr.h:166) ==37110== by 0x2E76: std::tr1::_Sp_counted_base::release() (boost_shared_ptr.h:150) ==37110== by 0x2E9B: std::tr1::shared_count::~shared_count() (boost_shared_ptr.h:266) ==37110== by 0x29993D: std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>::~shared_ptr() (boost_shared_ptr.h:474) ==37110== by 0x29995A: std::tr1::_Bind<std::tr1::_Mem_fn<void (nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::*)(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)> ()(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > > >, std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)>::~_Bind() (functional:696) ==37110== by 0x2999CB: std::tr1::_Function_base::_Base_manager<std::tr1::_Bind<std::tr1::_Mem_fn<void (nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::*)(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)> ()(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > > >, std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)> >::_M_destroy(std::tr1::_Any_data&, std::tr1::integral_constant<bool, false>) (functional:889) ==37110== by 0x2AA872: std::tr1::_Function_base::_Base_manager<std::tr1::_Bind<std::tr1::_Mem_fn<void (nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::*)(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)> ()(std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > > >, std::tr1::shared_ptr<nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::CInsertChildAtData>)> >::_M_manager(std::tr1::_Any_data&, std::tr1::_Any_data const&, std::tr1::_Manager_operation) (functional:911) ==37110== by 0x25A2: std::tr1::_Function_base::~_Function_base() (functional:1005) ==37110== by 0x183C6: std::tr1::function<void ()()>::~function() (functional:826) ==37110== by 0x23C392: nrg::CChildsManagModel<nrg::CPlayerGroup, std::tr1::shared_ptr<nrg::CPlayerGroup>, std::vector<std::tr1::shared_ptr<nrg::CPlayerGroup>, std::allocator<std::tr1::shared_ptr<nrg::CPlayerGroup> > >, nrg::CStatesManagModel<nrg::CSection, std::tr1::shared_ptr<nrg::CSection>, std::vector<std::tr1::shared_ptr<nrg::CSection>, std::allocator<std::tr1::shared_ptr<nrg::CSection> > > > >::InsertChildAt_GN(int, std::tr1::shared_ptr<nrg::CPlayerGroup> const&) (NrgChildsManag.cpp:224) ==37110== by 0x15F789: nrg::CArrang::InsertGroupAt_GN(int, std::tr1::shared_ptr<nrg::CGroup>) (NrgArrang.cpp:370) ==37110== by 0x16132C: nrg::CArrang::InsertGroupAt(int) (NrgArrang.cpp:438) ==37110== by 0x7CAB9: -[QCstArrangPlayersCntrl addPlayer:] (CstArrangPlayersCntrl.mm:531) ==37110== by 0x78077: -[QCstArrangPlayersCntrl segCntrlAction:] (CstArrangPlayersCntrl.mm:648) ==37110== by 0x207DC45: -[NSApplication sendAction:to:from:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x215D464: -[NSControl sendAction:to:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x2158F11: -[NSCell _sendActionFrom:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x2158E5F: -[NSSegmentedCell _sendActionFrom:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x2158208: -[NSCell trackMouse:inRect:ofView:untilMouseUp:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x21577C2: -[NSSegmentedCell trackMouse:inRect:ofView:untilMouseUp:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x2156C5E: -[NSControl mouseDown:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x2154C67: -[NSWindow sendEvent:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x1107E5: -[QCstWind sendEvent:] (CstWind.mm:25) ==37110== by 0x206D816: -[NSApplication sendEvent:] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x20012A6: -[NSApplication run] (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x1FF92D8: NSApplicationMain (in /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit) ==37110== by 0x16F0F: main (main.mm:13) |
|
From: Julian S. <js...@ac...> - 2011-01-28 12:46:15
|
> The log gives me a pretty long list of: > Conditional jump or move depends on uninitialised value(s) > I'm assuming they're not problematic. That may not be a good assumption. Try rerunning with --track-origins=yes to find out where the uninitialised values come from. They might come from your code. J |
|
[Valgrind-users] Fwd: Valgrind crashes with: FATAL: aspacem
assertion failed: addr <= addr + len - 1
From: <xtr...@gm...> - 2011-01-28 13:58:58
|
On Jan 28, 2011, at 1:46 PM, Julian Seward wrote:
>
>> The log gives me a pretty long list of:
>> Conditional jump or move depends on uninitialised value(s)
>
>> I'm assuming they're not problematic.
>
> That may not be a good assumption. Try rerunning with --track-origins=yes
> to find out where the uninitialised values come from. They might come
> from your code.
>
> J
Sorry I used the wrong word. I didn't really assume much... I checked the first 30 or so (with some trivial tests done separately to confirm the shared_ptr thing) and they did not depend on my code.
Running with --track-origins=yes slows the app to much. It becomes untestable.
I've just tried to rerun it and it crashes even earlier than before and the log it's empty: not even a cond error... (without inhibiting them)
It worked the first times but now it crashes at the first mouse click... (Again: the app is working perfectly in its normal environment)
I'm invoking with:
valgrind --num-callers=30 --log-file=${HOME}/desktop/valgrindlog.txt ${SOFT_PROJS_BUILD_PATH}/FoxSnakeBuild/debug/FoxSnake.app
this is the log file
==37267== Memcheck, a memory error detector
==37267== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==37267== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==37267== Command: /users/frankie/SoftProjs/Builds/FoxSnakeBuild/debug/FoxSnake.app/Contents/MacOS/FoxSnake
==37267== Parent PID: 37266
==37267==
this is the console
--37110:0:aspacem Valgrind: FATAL: aspacem assertion failed:
--37110:0:aspacem addr <= addr + len - 1
--37110:0:aspacem at m_aspacemgr/aspacemgr-linux.c:3440 (add_mapping_callback)
--37110:0:aspacem Exiting now.
logout
:-(
Thanks again for any other insight,
Francesco |
|
From: john s. <sk...@us...> - 2011-01-28 14:17:49
|
On 29/01/2011, at 12:58 AM, xtr...@gm... wrote: > > --37110:0:aspacem Valgrind: FATAL: aspacem assertion failed: > --37110:0:aspacem addr <= addr + len - 1 > --37110:0:aspacem at m_aspacemgr/aspacemgr-linux.c:3440 (add_mapping_callback) > --37110:0:aspacem Exiting now. > logout > > :-( > > Thanks again for any other insight, Quick Google shows you're not the only one with a problem: http://www.mail-archive.com/val...@li.../msg01801.html https://bugs.kde.org/show_bug.cgi?id=205241#c80 http://markmail.org/message/rxkvvfgqozlepq3y The assert in question seems to be this: static void add_mapping_callback(Addr addr, SizeT len, UInt prot, ULong dev, ULong ino, Off64T offset, const UChar *filename) { // derived from sync_check_mapping_callback() Int iLo, iHi, i; if (len == 0) return; /* The kernel should not give us wraparounds. */ aspacem_assert(addr <= addr + len - 1); -- john skaller sk...@us... |
|
From: John R. <jr...@bi...> - 2011-01-28 15:09:41
|
> The assert in question seems to be this:
>
>
> static void add_mapping_callback(Addr addr, SizeT len, UInt prot,
> ULong dev, ULong ino, Off64T offset,
> const UChar *filename)
> {
> // derived from sync_check_mapping_callback()
>
> Int iLo, iHi, i;
>
> if (len == 0) return;
>
> /* The kernel should not give us wraparounds. */
> aspacem_assert(addr <= addr + len - 1);
The most likely candidate for triggering the assert()
is if 'len' is -1: MAP_FAILED, or the C library returning -1
when some bare system call returns -ENOMEM, -ENOSPC,
-EINTR, etc., and there was no prior check for that error.
--
|
|
From: Julian S. <js...@ac...> - 2011-01-28 15:51:35
|
On Friday, January 28, 2011, john skaller wrote: > Quick Google shows you're not the only one with a problem: > > http://www.mail-archive.com/val...@li.../msg01801.h > tml https://bugs.kde.org/show_bug.cgi?id=205241#c80 > http://markmail.org/message/rxkvvfgqozlepq3y Only the middle one of those is (directly) related to this failure. xtrigger, can you file a new bug report with a self contained test case? That way it might actually get fixed. J |
|
From: <xtr...@gm...> - 2011-01-28 19:52:36
|
On Jan 28, 2011, at 4:52 PM, Julian Seward wrote: > On Friday, January 28, 2011, john skaller wrote: > >> Quick Google shows you're not the only one with a problem: >> >> http://www.mail-archive.com/val...@li.../msg01801.h >> tml https://bugs.kde.org/show_bug.cgi?id=205241#c80 >> http://markmail.org/message/rxkvvfgqozlepq3y > > Only the middle one of those is (directly) related to this failure. > > xtrigger, can you file a new bug report with a self contained > test case? That way it might actually get fixed. > > J Name's Francesco. :-) I've done some further testing, it crashes whenever I click on the menu bar. Even on the Xcode Cocoa Application Template (so I'm positive it's not my code fault.. ;-) I can file a bug report if you want, but currently the "test case" on my machine is just: - open xcode - create the cocoa application template - compile it for i386 architecture - run under valgrind - click on menu bar - kaboom I'd file it if anyone is experiencing the same, if I'm the only one it means I screwed up something. I retried with my app and it works until I either click on the menubar or open up a save dialog. Thanks a lot for the patience, Francesco |
|
From: john s. <sk...@us...> - 2011-01-28 13:29:55
|
On 28/01/2011, at 11:35 PM, xtr...@gm... wrote: > =37110== Conditional jump or move depends on uninitialised value(s) > ==37110== at 0x1717D7C: pthread_mutex_unlock (in /usr/lib/libSystem.B.dylib) > ==37110== by 0x250F: __gthread_mutex_unlock(_opaque_pthread_mutex_t*) (gthr-default.h:528) > ==37110== by 0x2E03: std::tr1::_Sp_counted_base::weak_release() (boost_shared_ptr.h:166) > ==37110== by 0x2E76: std::tr1::_Sp_counted_base::release() (boost_shared_ptr.h:150) > ==37110== by 0x2E9B: std::tr1::shared_count::~shared_count() (boost_shared_ptr.h:266) > Here are some relevant infos: > OS: Mac OS X 10.6 I have got the similar, not sure if OSX bug or not but you have to ignore this one. -- john skaller sk...@us... |