In Linux task, this code: // XXX: For moment wire in standard 32-bit memory // map. This will be replaced by a memory map created using // information from /proc/PID/maps. private void setupMapsXXX () throws TaskException { ByteOrder byteOrder = getIsa().getByteOrder(); // XXX: For writing at least, PTRACE must be used as /proc/mem // cannot be written to. memory = new PtraceByteBuffer(id.id, PtraceByteBuffer.Area.DATA, 0xffffffffl); memory.order(byteOrder); registerBank = getIsa().getRegisterBankBuffers(id.id); } Does not expose all memory that is map-able, possibly rendering some maps inaccessible Potentially should be move as a part of the Isa?
IMO, Isa only provides some primitives to access ISA information, so how about setup map still in LinuxTask.java per wordSize? Here is a patch, Index: frysk-core/frysk/proc/LinuxTask.java =================================================================== RCS file: /cvs/frysk/frysk-core/frysk/proc/LinuxTask.java,v retrieving revision 1.38 diff -u -r1.38 LinuxTask.java --- frysk-core/frysk/proc/LinuxTask.java 11 Oct 2006 21:33:01 -0000 1.38 +++ frysk-core/frysk/proc/LinuxTask.java 20 Oct 2006 06:22:39 -0000 @@ -66,7 +66,13 @@ ByteOrder byteOrder = getIsa().getByteOrder(); // XXX: For writing at least, PTRACE must be used as /proc/mem // cannot be written to. - memory = new PtraceByteBuffer(id.id, PtraceByteBuffer.Area.DATA, + // For 64-bit address space. + if (getIsa().getWordSize() == 8) + memory = new PtraceByteBuffer(id.id, PtraceByteBuffer.Area.DATA, + 0x7fffffffffffffffl); + // For 32-bit address space. + else + memory = new PtraceByteBuffer(id.id, PtraceByteBuffer.Area.DATA, 0xffffffffl); memory.order(byteOrder); registerBank = getIsa().getRegisterBankBuffers(id.id);
That would be good, too. Right now I cannot get very many core maps on x86_64 because I get buffer underflows. Your patch fixes that on x86_64 at least. I'd be happy to see it in CVS. Any objections Andrew?
The change is ok as a workaround, however it still leaves half of 64-bit memory inaccessable. Likely bignum's are needed for that.
Check in the patch in comment#1 as a workaround. 2006-10-24 Yao Qi <qiyaoltc@cn.ibm.com> * LinuxTask.java (Task): Enlarge the boundary of PtraceByteBuffer for 64-bit address space.
Workaround committed. See #1537 for ultimate fix
It seems that on FC6, vDSO is now mapped at the end of the address space on x86_64 systems. Not sure if that is with some processes, or all. A possible fix here would be to use BigIntegers instead of longs. As a note, as this is the vDSO segments that are affected, backtraces will be affected, as well as fcore dumps.
#1537 has been fixed, which was the right fix also for this bug. *** This bug has been marked as a duplicate of 1537 ***