Bug 126722 - aspacem assertion failed: segment_is_sane at m_aspacemgr/aspacemgr.c:1624 (add_segment)
Summary: aspacem assertion failed: segment_is_sane at m_aspacemgr/aspacemgr.c:1624 (a...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.1.1
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-04 11:53 UTC by Dominik Strasser
Modified: 2006-05-09 11:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Strasser 2006-05-04 11:53:05 UTC
Version:           3.1.1 (using KDE KDE 3.5.0KDE 1.2)
Compiler:          3.3.6 
OS:                Linux

Checking my application with valgrind crashes with the above assertion.
The output befores the assertion is:
0:aspacem  NSegment{anon, start=0xBCEC000, end=0xBCEEFFF, smode=SmFixed, dev=0, ino=0, offset=12288, fnIdx=-1, hasR=1, hasW=1, hasX=1, hasT=0, mark=0, name="(none)"}

My application is a multi-threaded built with shared libraries and even generates code at runtime (in case this matters).

I can provide you with any debug info as I compiled valgrind myself and I have sources for my app, but I can't send you my app.

The bahavior is the same as in valgrind 3.1.0.

Hope this is enough info.
Comment 1 Tom Hughes 2006-05-08 13:27:25 UTC
The problem is that it is an anonymous segment but it has a non-zero offset.

I assume this is after your program has been running for a while and not something that happens at startup before your program gets a chance to run at all? Can you trying running with --trace-syscalls=yes and provide the last few lines of that trace before the assertion - there is likely to be an mmap call or similar at that point in the trace which is what I am interested in.
Comment 2 Dominik Strasser 2006-05-08 16:15:22 UTC
I can even show you the source code of the mmap:
mmap(0, mSize, PROT_EXEC | PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS,0 , mSize);
Comment 3 Tom Hughes 2006-05-08 16:23:13 UTC
So why are you specifiying an offset for an anonymous map?

I guess valgrind should probably ignore it, as the kernel presumably does, but it is entirely pointless as far as I know.
Comment 4 Dominik Strasser 2006-05-08 16:28:08 UTC
I don't know why. I haven't written the code. You know that code is changed until it works, no matter why it works :-)
Comment 5 Dominik Strasser 2006-05-08 17:25:48 UTC
Changing offset to 0 indeed cures the valgrind crash wihout other ill effects. Thanks for your analysis.
Comment 6 Tom Hughes 2006-05-09 11:07:24 UTC
I've committed a fix to make valgrind ignore the offset in anonymous mmap calls as valgrind revision 5888.