* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
[not found] <20071122090733.7335.qmail@sourceware.org>
@ 2007-11-22 17:10 ` Andrew Cagney
2007-11-23 4:10 ` Zhao Shujing
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2007-11-22 17:10 UTC (permalink / raw)
To: pearly.zhao; +Cc: frysk
Pearly,
This change is 64-bit specific - on a 32-bit system, capacity is much
smaller vis:
testMemoryBufferCapacity(frysk.proc.live.TestByteBuffer)junit.framework.AssertionFailedError:
Memory Buffer Capacity: expected:<-1> but was:<4294967295>
at frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity(TestRunner)
at frysk.junit.Runner.runCases(TestRunner)
at frysk.junit.Runner.runArchCases(TestRunner)
at frysk.junit.Runner.runTestCases(TestRunner)
at TestRunner.main(TestRunner)
perhaps if you explain the issue here then we can figure out the
underlying problem.
Andrew
pzhao@sourceware.org wrote:
> The branch, master has been updated
> via 77939fcf72c66c6891797c90a0e4a19ec9e013e4 (commit)
> from 04406050f6a4910464c1dd4756121123c9a3708b (commit)
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email.
>
> - Log -----------------------------------------------------------------
> commit 77939fcf72c66c6891797c90a0e4a19ec9e013e4
> Author: Zhao Shujing <pearly.zhao@oracle.com>
> Date: Thu Nov 22 16:52:37 2007 +0800
>
> Add a test testMemoryBufferCapacity() to TestByteBuffer.java
>
> -----------------------------------------------------------------------
>
> Summary of changes:
> frysk-core/frysk/proc/live/ChangeLog | 4 ++++
> frysk-core/frysk/proc/live/TestByteBuffer.java | 8 +++++++-
> 2 files changed, 11 insertions(+), 1 deletions(-)
>
> First 500 lines of diff:
> diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
> index 81d75eb..04e2937 100644
> --- a/frysk-core/frysk/proc/live/ChangeLog
> +++ b/frysk-core/frysk/proc/live/ChangeLog
> @@ -1,3 +1,7 @@
> +2007-11-22 Zhao Shujing <pearly.zhao@oracle.com>
> +
> + * TestByteBuffer.java(testMemoryBufferCapacity()): New test.
> +
> 2007-10-29 Mark Wielaard <mwielaard@redhat.com>
>
> * LinuxTaskState.java (sendContinue): Add logging.
> diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java b/frysk-core/frysk/proc/live/TestByteBuffer.java
> index 07625f1..f49bb83 100644
> --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
> +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
> @@ -58,12 +58,13 @@ public class TestByteBuffer
> private ByteBuffer[] addressBuffers;
> private ByteBuffer[] registerBuffers;
>
> + private ByteBuffer memorySpaceByteBuffer;
> +
> public void setUp () throws Exception
> {
> int pid;
> ByteBuffer addressSpaceByteBufferText;
> ByteBuffer addressSpaceByteBufferData;
> - ByteBuffer memorySpaceByteBuffer;
> ByteBuffer usrByteBuffer;
> ByteBuffer registerByteBuffer;
> ByteBuffer fpregisterByteBuffer;
> @@ -265,6 +266,11 @@ public class TestByteBuffer
> verifyPeeks(registerBuffers[i], addr, origBytes);
> }
> }
> +
> + public void testMemoryBufferCapacity()
> + {
> + assertEquals("Memory Buffer Capacity: ", -1L, memorySpaceByteBuffer.capacity());
> + }
> private class AsyncPeeks
> implements Runnable
> {
>
>
> hooks/post-receive
> --
> frysk system monitor/debugger
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-22 17:10 ` [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java Andrew Cagney
@ 2007-11-23 4:10 ` Zhao Shujing
2007-11-24 0:07 ` Andrew Cagney
0 siblings, 1 reply; 8+ messages in thread
From: Zhao Shujing @ 2007-11-23 4:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: frysk
This issue is to make sure the hightWater of memory bytebuffer is the
top location of the system.
Yes, it should be ISA dependent.
Fixed patch for it:
-------------------------------
diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java
b/frysk-core/frysk/proc/live/TestByteBuffer.java
index d8d8063..921b477 100644
--- a/frysk-core/frysk/proc/live/TestByteBuffer.java
+++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
@@ -40,9 +40,14 @@
package frysk.proc.live;
import inua.eio.ByteBuffer;
+import frysk.isa.ISA;
import frysk.junit.TestCase;
+import frysk.proc.Task;
import frysk.testbed.AttachedSelf;
+import frysk.testbed.ExecCommand;
+import frysk.testbed.ExecOffspring;
import frysk.testbed.LocalMemory;
+import frysk.testbed.TearDownFile;
import frysk.sys.Ptrace.RegisterSet;
import frysk.sys.Ptrace.AddressSpace;
import frysk.proc.Manager;
@@ -58,13 +63,12 @@ public class TestByteBuffer
private ByteBuffer[] addressBuffers;
private ByteBuffer[] registerBuffers;
- private ByteBuffer memorySpaceByteBuffer;
-
public void setUp () throws Exception
{
int pid;
ByteBuffer addressSpaceByteBufferText;
ByteBuffer addressSpaceByteBufferData;
+ ByteBuffer memorySpaceByteBuffer;
ByteBuffer usrByteBuffer;
ByteBuffer registerByteBuffer;
ByteBuffer fpregisterByteBuffer;
@@ -266,12 +270,22 @@ public class TestByteBuffer
verifyPeeks(registerBuffers[i], addr, origBytes);
}
}
-
public void testMemoryBufferCapacity() {
if (unresolved(5394))
return;
- assertEquals("Memory Buffer Capacity: ", -1L,
- memorySpaceByteBuffer.capacity());
+ TearDownFile tmpFile = TearDownFile.create();
+ ExecOffspring child
+ = new ExecOffspring(new ExecCommand (new String[] {
+ "/bin/rm",
+ tmpFile.toString()
+ }));
+ Task task = child.findTaskUsingRefresh(true);
+ if (task.getISA() == ISA.IA32)
+ assertEquals("Memory Buffer Capacity: ", 0xffffffffL,
+ task.getMemory().capacity());
+ if (task.getISA() == ISA.X8664)
+ assertEquals("Memory Buffer Capacity: ",
0xffffffffffffffffL,
+ task.getMemory().capacity());
}
private class AsyncPeeks
--------------------------------
On Thu, 2007-11-22 at 12:09 -0500, Andrew Cagney wrote:
> Pearly,
>
> This change is 64-bit specific - on a 32-bit system, capacity is much
> smaller vis:
>
> testMemoryBufferCapacity(frysk.proc.live.TestByteBuffer)junit.framework.AssertionFailedError:
> Memory Buffer Capacity: expected:<-1> but was:<4294967295>
> at frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity(TestRunner)
> at frysk.junit.Runner.runCases(TestRunner)
> at frysk.junit.Runner.runArchCases(TestRunner)
> at frysk.junit.Runner.runTestCases(TestRunner)
> at TestRunner.main(TestRunner)
>
> perhaps if you explain the issue here then we can figure out the
> underlying problem.
>
> Andrew
>
> pzhao@sourceware.org wrote:
> > The branch, master has been updated
> > via 77939fcf72c66c6891797c90a0e4a19ec9e013e4 (commit)
> > from 04406050f6a4910464c1dd4756121123c9a3708b (commit)
> >
> > Those revisions listed above that are new to this repository have
> > not appeared on any other notification email.
> >
> > - Log -----------------------------------------------------------------
> > commit 77939fcf72c66c6891797c90a0e4a19ec9e013e4
> > Author: Zhao Shujing <pearly.zhao@oracle.com>
> > Date: Thu Nov 22 16:52:37 2007 +0800
> >
> > Add a test testMemoryBufferCapacity() to TestByteBuffer.java
> >
> > -----------------------------------------------------------------------
> >
> > Summary of changes:
> > frysk-core/frysk/proc/live/ChangeLog | 4 ++++
> > frysk-core/frysk/proc/live/TestByteBuffer.java | 8 +++++++-
> > 2 files changed, 11 insertions(+), 1 deletions(-)
> >
> > First 500 lines of diff:
> > diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
> > index 81d75eb..04e2937 100644
> > --- a/frysk-core/frysk/proc/live/ChangeLog
> > +++ b/frysk-core/frysk/proc/live/ChangeLog
> > @@ -1,3 +1,7 @@
> > +2007-11-22 Zhao Shujing <pearly.zhao@oracle.com>
> > +
> > + * TestByteBuffer.java(testMemoryBufferCapacity()): New test.
> > +
> > 2007-10-29 Mark Wielaard <mwielaard@redhat.com>
> >
> > * LinuxTaskState.java (sendContinue): Add logging.
> > diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java b/frysk-core/frysk/proc/live/TestByteBuffer.java
> > index 07625f1..f49bb83 100644
> > --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
> > +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
> > @@ -58,12 +58,13 @@ public class TestByteBuffer
> > private ByteBuffer[] addressBuffers;
> > private ByteBuffer[] registerBuffers;
> >
> > + private ByteBuffer memorySpaceByteBuffer;
> > +
> > public void setUp () throws Exception
> > {
> > int pid;
> > ByteBuffer addressSpaceByteBufferText;
> > ByteBuffer addressSpaceByteBufferData;
> > - ByteBuffer memorySpaceByteBuffer;
> > ByteBuffer usrByteBuffer;
> > ByteBuffer registerByteBuffer;
> > ByteBuffer fpregisterByteBuffer;
> > @@ -265,6 +266,11 @@ public class TestByteBuffer
> > verifyPeeks(registerBuffers[i], addr, origBytes);
> > }
> > }
> > +
> > + public void testMemoryBufferCapacity()
> > + {
> > + assertEquals("Memory Buffer Capacity: ", -1L, memorySpaceByteBuffer.capacity());
> > + }
> > private class AsyncPeeks
> > implements Runnable
> > {
> >
> >
> > hooks/post-receive
> > --
> > frysk system monitor/debugger
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-23 4:10 ` Zhao Shujing
@ 2007-11-24 0:07 ` Andrew Cagney
2007-11-26 2:53 ` Zhao Shujing
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2007-11-24 0:07 UTC (permalink / raw)
To: pearly.zhao; +Cc: frysk
Zhao Shujing wrote:
> This issue is to make sure the hightWater of memory bytebuffer is the
> top location of the system.
>
I'm still not sure I'm following; what is the problem you encountered
with .capacity() or is this a test to wire down an assumption?
> Yes, it should be ISA dependent.
> Fixed patch for it:
> -------------------------------
> diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java
> b/frysk-core/frysk/proc/live/TestByteBuffer.java
> index d8d8063..921b477 100644
> --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
> +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
> @@ -40,9 +40,14 @@
> package frysk.proc.live;
>
> import inua.eio.ByteBuffer;
> +import frysk.isa.ISA;
> import frysk.junit.TestCase;
> +import frysk.proc.Task;
> import frysk.testbed.AttachedSelf;
> +import frysk.testbed.ExecCommand;
> +import frysk.testbed.ExecOffspring;
> import frysk.testbed.LocalMemory;
> +import frysk.testbed.TearDownFile;
> import frysk.sys.Ptrace.RegisterSet;
> import frysk.sys.Ptrace.AddressSpace;
> import frysk.proc.Manager;
> @@ -58,13 +63,12 @@ public class TestByteBuffer
> private ByteBuffer[] addressBuffers;
> private ByteBuffer[] registerBuffers;
>
> - private ByteBuffer memorySpaceByteBuffer;
> -
> public void setUp () throws Exception
> {
> int pid;
> ByteBuffer addressSpaceByteBufferText;
> ByteBuffer addressSpaceByteBufferData;
> + ByteBuffer memorySpaceByteBuffer;
> ByteBuffer usrByteBuffer;
> ByteBuffer registerByteBuffer;
> ByteBuffer fpregisterByteBuffer;
> @@ -266,12 +270,22 @@ public class TestByteBuffer
> verifyPeeks(registerBuffers[i], addr, origBytes);
> }
> }
> -
> public void testMemoryBufferCapacity() {
> if (unresolved(5394))
> return;
> - assertEquals("Memory Buffer Capacity: ", -1L,
> - memorySpaceByteBuffer.capacity());
> + TearDownFile tmpFile = TearDownFile.create();
> + ExecOffspring child
> + = new ExecOffspring(new ExecCommand (new String[] {
> + "/bin/rm",
> + tmpFile.toString()
>
I'm not sure that ExecOffspring is what you need here as it doesn't put
the task into an attached/stopped state; I suspect:
Task = new DaemonBlockedAtEntry("funit-slave").getMainTask().getISA();
be simpler?
> + }));
> + Task task = child.findTaskUsingRefresh(true);
> + if (task.getISA() == ISA.IA32)
> + assertEquals("Memory Buffer Capacity: ", 0xffffffffL,
> + task.getMemory().capacity());
> + if (task.getISA() == ISA.X8664)
> + assertEquals("Memory Buffer Capacity: ",
> 0xffffffffffffffffL,
> + task.getMemory().capacity());
> }
>
There is also the PPC; the attribute is dependent on the ISA's word
size, though, is something like:
switch (task.getISA().wordSize())
case 4: assert ... ; break;
case 8: assert ... ; break;
default: fail("unknown word size");
}
simplier?
is the test passing or still being skipped?
> private class AsyncPeeks
> --------------------------------
> On Thu, 2007-11-22 at 12:09 -0500, Andrew Cagney wrote:
>
>> Pearly,
>>
>> This change is 64-bit specific - on a 32-bit system, capacity is much
>> smaller vis:
>>
>> testMemoryBufferCapacity(frysk.proc.live.TestByteBuffer)junit.framework.AssertionFailedError:
>> Memory Buffer Capacity: expected:<-1> but was:<4294967295>
>> at frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity(TestRunner)
>> at frysk.junit.Runner.runCases(TestRunner)
>> at frysk.junit.Runner.runArchCases(TestRunner)
>> at frysk.junit.Runner.runTestCases(TestRunner)
>> at TestRunner.main(TestRunner)
>>
>> perhaps if you explain the issue here then we can figure out the
>> underlying problem.
>>
>> Andrew
>>
>> pzhao@sourceware.org wrote:
>>
>>> The branch, master has been updated
>>> via 77939fcf72c66c6891797c90a0e4a19ec9e013e4 (commit)
>>> from 04406050f6a4910464c1dd4756121123c9a3708b (commit)
>>>
>>> Those revisions listed above that are new to this repository have
>>> not appeared on any other notification email.
>>>
>>> - Log -----------------------------------------------------------------
>>> commit 77939fcf72c66c6891797c90a0e4a19ec9e013e4
>>> Author: Zhao Shujing <pearly.zhao@oracle.com>
>>> Date: Thu Nov 22 16:52:37 2007 +0800
>>>
>>> Add a test testMemoryBufferCapacity() to TestByteBuffer.java
>>>
>>> -----------------------------------------------------------------------
>>>
>>> Summary of changes:
>>> frysk-core/frysk/proc/live/ChangeLog | 4 ++++
>>> frysk-core/frysk/proc/live/TestByteBuffer.java | 8 +++++++-
>>> 2 files changed, 11 insertions(+), 1 deletions(-)
>>>
>>> First 500 lines of diff:
>>> diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
>>> index 81d75eb..04e2937 100644
>>> --- a/frysk-core/frysk/proc/live/ChangeLog
>>> +++ b/frysk-core/frysk/proc/live/ChangeLog
>>> @@ -1,3 +1,7 @@
>>> +2007-11-22 Zhao Shujing <pearly.zhao@oracle.com>
>>> +
>>> + * TestByteBuffer.java(testMemoryBufferCapacity()): New test.
>>> +
>>> 2007-10-29 Mark Wielaard <mwielaard@redhat.com>
>>>
>>> * LinuxTaskState.java (sendContinue): Add logging.
>>> diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java b/frysk-core/frysk/proc/live/TestByteBuffer.java
>>> index 07625f1..f49bb83 100644
>>> --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
>>> +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
>>> @@ -58,12 +58,13 @@ public class TestByteBuffer
>>> private ByteBuffer[] addressBuffers;
>>> private ByteBuffer[] registerBuffers;
>>>
>>> + private ByteBuffer memorySpaceByteBuffer;
>>> +
>>> public void setUp () throws Exception
>>> {
>>> int pid;
>>> ByteBuffer addressSpaceByteBufferText;
>>> ByteBuffer addressSpaceByteBufferData;
>>> - ByteBuffer memorySpaceByteBuffer;
>>> ByteBuffer usrByteBuffer;
>>> ByteBuffer registerByteBuffer;
>>> ByteBuffer fpregisterByteBuffer;
>>> @@ -265,6 +266,11 @@ public class TestByteBuffer
>>> verifyPeeks(registerBuffers[i], addr, origBytes);
>>> }
>>> }
>>> +
>>> + public void testMemoryBufferCapacity()
>>> + {
>>> + assertEquals("Memory Buffer Capacity: ", -1L, memorySpaceByteBuffer.capacity());
>>> + }
>>> private class AsyncPeeks
>>> implements Runnable
>>> {
>>>
>>>
>>> hooks/post-receive
>>> --
>>> frysk system monitor/debugger
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-24 0:07 ` Andrew Cagney
@ 2007-11-26 2:53 ` Zhao Shujing
2007-11-27 14:45 ` Andrew Cagney
0 siblings, 1 reply; 8+ messages in thread
From: Zhao Shujing @ 2007-11-26 2:53 UTC (permalink / raw)
To: Andrew Cagney; +Cc: frysk
Sorry, this test is added for bug 1538. I think .capacity() can use for
test if highWater mark is the top location when map memory to
ByteBuffer.
On Fri, 2007-11-23 at 19:06 -0500, Andrew Cagney wrote:
> Zhao Shujing wrote:
> > This issue is to make sure the hightWater of memory bytebuffer is the
> > top location of the system.
> >
> I'm still not sure I'm following; what is the problem you encountered
> with .capacity() or is this a test to wire down an assumption?
>
> > Yes, it should be ISA dependent.
> > Fixed patch for it:
> > -------------------------------
> > diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java
> > b/frysk-core/frysk/proc/live/TestByteBuffer.java
> > index d8d8063..921b477 100644
> > --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
> > +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
> > @@ -40,9 +40,14 @@
> > package frysk.proc.live;
> >
> > import inua.eio.ByteBuffer;
> > +import frysk.isa.ISA;
> > import frysk.junit.TestCase;
> > +import frysk.proc.Task;
> > import frysk.testbed.AttachedSelf;
> > +import frysk.testbed.ExecCommand;
> > +import frysk.testbed.ExecOffspring;
> > import frysk.testbed.LocalMemory;
> > +import frysk.testbed.TearDownFile;
> > import frysk.sys.Ptrace.RegisterSet;
> > import frysk.sys.Ptrace.AddressSpace;
> > import frysk.proc.Manager;
> > @@ -58,13 +63,12 @@ public class TestByteBuffer
> > private ByteBuffer[] addressBuffers;
> > private ByteBuffer[] registerBuffers;
> >
> > - private ByteBuffer memorySpaceByteBuffer;
> > -
> > public void setUp () throws Exception
> > {
> > int pid;
> > ByteBuffer addressSpaceByteBufferText;
> > ByteBuffer addressSpaceByteBufferData;
> > + ByteBuffer memorySpaceByteBuffer;
> > ByteBuffer usrByteBuffer;
> > ByteBuffer registerByteBuffer;
> > ByteBuffer fpregisterByteBuffer;
> > @@ -266,12 +270,22 @@ public class TestByteBuffer
> > verifyPeeks(registerBuffers[i], addr, origBytes);
> > }
> > }
> > -
> > public void testMemoryBufferCapacity() {
> > if (unresolved(5394))
> > return;
> > - assertEquals("Memory Buffer Capacity: ", -1L,
> > - memorySpaceByteBuffer.capacity());
> > + TearDownFile tmpFile = TearDownFile.create();
> > + ExecOffspring child
> > + = new ExecOffspring(new ExecCommand (new String[] {
> > + "/bin/rm",
> > + tmpFile.toString()
> >
> I'm not sure that ExecOffspring is what you need here as it doesn't put
> the task into an attached/stopped state; I suspect:
> Task = new DaemonBlockedAtEntry("funit-slave").getMainTask().getISA();
> be simpler?
>
> > + }));
> > + Task task = child.findTaskUsingRefresh(true);
> > + if (task.getISA() == ISA.IA32)
> > + assertEquals("Memory Buffer Capacity: ", 0xffffffffL,
> > + task.getMemory().capacity());
> > + if (task.getISA() == ISA.X8664)
> > + assertEquals("Memory Buffer Capacity: ",
> > 0xffffffffffffffffL,
> > + task.getMemory().capacity());
> > }
> >
>
> There is also the PPC; the attribute is dependent on the ISA's word
> size, though, is something like:
> switch (task.getISA().wordSize())
> case 4: assert ... ; break;
> case 8: assert ... ; break;
> default: fail("unknown word size");
> }
> simplier?
>
> is the test passing or still being skipped?
>
> > private class AsyncPeeks
> > --------------------------------
> > On Thu, 2007-11-22 at 12:09 -0500, Andrew Cagney wrote:
> >
> >> Pearly,
> >>
> >> This change is 64-bit specific - on a 32-bit system, capacity is much
> >> smaller vis:
> >>
> >> testMemoryBufferCapacity(frysk.proc.live.TestByteBuffer)junit.framework.AssertionFailedError:
> >> Memory Buffer Capacity: expected:<-1> but was:<4294967295>
> >> at frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity(TestRunner)
> >> at frysk.junit.Runner.runCases(TestRunner)
> >> at frysk.junit.Runner.runArchCases(TestRunner)
> >> at frysk.junit.Runner.runTestCases(TestRunner)
> >> at TestRunner.main(TestRunner)
> >>
> >> perhaps if you explain the issue here then we can figure out the
> >> underlying problem.
> >>
> >> Andrew
> >>
> >> pzhao@sourceware.org wrote:
> >>
> >>> The branch, master has been updated
> >>> via 77939fcf72c66c6891797c90a0e4a19ec9e013e4 (commit)
> >>> from 04406050f6a4910464c1dd4756121123c9a3708b (commit)
> >>>
> >>> Those revisions listed above that are new to this repository have
> >>> not appeared on any other notification email.
> >>>
> >>> - Log -----------------------------------------------------------------
> >>> commit 77939fcf72c66c6891797c90a0e4a19ec9e013e4
> >>> Author: Zhao Shujing <pearly.zhao@oracle.com>
> >>> Date: Thu Nov 22 16:52:37 2007 +0800
> >>>
> >>> Add a test testMemoryBufferCapacity() to TestByteBuffer.java
> >>>
> >>> -----------------------------------------------------------------------
> >>>
> >>> Summary of changes:
> >>> frysk-core/frysk/proc/live/ChangeLog | 4 ++++
> >>> frysk-core/frysk/proc/live/TestByteBuffer.java | 8 +++++++-
> >>> 2 files changed, 11 insertions(+), 1 deletions(-)
> >>>
> >>> First 500 lines of diff:
> >>> diff --git a/frysk-core/frysk/proc/live/ChangeLog b/frysk-core/frysk/proc/live/ChangeLog
> >>> index 81d75eb..04e2937 100644
> >>> --- a/frysk-core/frysk/proc/live/ChangeLog
> >>> +++ b/frysk-core/frysk/proc/live/ChangeLog
> >>> @@ -1,3 +1,7 @@
> >>> +2007-11-22 Zhao Shujing <pearly.zhao@oracle.com>
> >>> +
> >>> + * TestByteBuffer.java(testMemoryBufferCapacity()): New test.
> >>> +
> >>> 2007-10-29 Mark Wielaard <mwielaard@redhat.com>
> >>>
> >>> * LinuxTaskState.java (sendContinue): Add logging.
> >>> diff --git a/frysk-core/frysk/proc/live/TestByteBuffer.java b/frysk-core/frysk/proc/live/TestByteBuffer.java
> >>> index 07625f1..f49bb83 100644
> >>> --- a/frysk-core/frysk/proc/live/TestByteBuffer.java
> >>> +++ b/frysk-core/frysk/proc/live/TestByteBuffer.java
> >>> @@ -58,12 +58,13 @@ public class TestByteBuffer
> >>> private ByteBuffer[] addressBuffers;
> >>> private ByteBuffer[] registerBuffers;
> >>>
> >>> + private ByteBuffer memorySpaceByteBuffer;
> >>> +
> >>> public void setUp () throws Exception
> >>> {
> >>> int pid;
> >>> ByteBuffer addressSpaceByteBufferText;
> >>> ByteBuffer addressSpaceByteBufferData;
> >>> - ByteBuffer memorySpaceByteBuffer;
> >>> ByteBuffer usrByteBuffer;
> >>> ByteBuffer registerByteBuffer;
> >>> ByteBuffer fpregisterByteBuffer;
> >>> @@ -265,6 +266,11 @@ public class TestByteBuffer
> >>> verifyPeeks(registerBuffers[i], addr, origBytes);
> >>> }
> >>> }
> >>> +
> >>> + public void testMemoryBufferCapacity()
> >>> + {
> >>> + assertEquals("Memory Buffer Capacity: ", -1L, memorySpaceByteBuffer.capacity());
> >>> + }
> >>> private class AsyncPeeks
> >>> implements Runnable
> >>> {
> >>>
> >>>
> >>> hooks/post-receive
> >>> --
> >>> frysk system monitor/debugger
> >>>
> >>>
> >
> >
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-26 2:53 ` Zhao Shujing
@ 2007-11-27 14:45 ` Andrew Cagney
2007-11-28 8:21 ` Zhao Shujing
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cagney @ 2007-11-27 14:45 UTC (permalink / raw)
To: pearly.zhao; +Cc: frysk
Zhao Shujing wrote:
> Sorry, this test is added for bug 1538. I think .capacity() can use for
> test if highWater mark is the top location when map memory to
> ByteBuffer.
>
True; however did you see:
> + = new ExecOffspring(new ExecCommand (new String[] {
> + "/bin/rm",
> + tmpFile.toString()
>
>
> I'm not sure that ExecOffspring is what you need here as it doesn't put
> the task into an attached/stopped state; I suspect:
> Task = new DaemonBlockedAtEntry("funit-slave").getMainTask().getISA();
> be simpler?
and:
> + Task task = child.findTaskUsingRefresh(true);
> + if (task.getISA() == ISA.IA32)
> + assertEquals("Memory Buffer Capacity: ", 0xffffffffL,
> + task.getMemory().capacity());
> + if (task.getISA() == ISA.X8664)
> + assertEquals("Memory Buffer Capacity: ",
> 0xffffffffffffffffL,
> + task.getMemory().capacity());
> }
>
>
> There is also the PPC; the attribute is dependent on the ISA's word
> size, though, is something like:
> switch (task.getISA().wordSize())
> case 4: assert ... ; break;
> case 8: assert ... ; break;
> default: fail("unknown word size");
> }
> simplier?
>
> is the test passing or still being skipped?
can we address these?
Andrew
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-27 14:45 ` Andrew Cagney
@ 2007-11-28 8:21 ` Zhao Shujing
2007-11-29 10:37 ` Mark Wielaard
0 siblings, 1 reply; 8+ messages in thread
From: Zhao Shujing @ 2007-11-28 8:21 UTC (permalink / raw)
To: Andrew Cagney; +Cc: frysk
It's been updated and the test is passing now.
On Tue, 2007-11-27 at 09:45 -0500, Andrew Cagney wrote:
> Zhao Shujing wrote:
> > Sorry, this test is added for bug 1538. I think .capacity() can use for
> > test if highWater mark is the top location when map memory to
> > ByteBuffer.
> >
> True; however did you see:
>
> > + = new ExecOffspring(new ExecCommand (new String[] {
> > + "/bin/rm",
> > + tmpFile.toString()
> >
> >
> > I'm not sure that ExecOffspring is what you need here as it doesn't put
> > the task into an attached/stopped state; I suspect:
> > Task = new DaemonBlockedAtEntry("funit-slave").getMainTask().getISA();
> > be simpler?
> and:
>
> > + Task task = child.findTaskUsingRefresh(true);
> > + if (task.getISA() == ISA.IA32)
> > + assertEquals("Memory Buffer Capacity: ", 0xffffffffL,
> > + task.getMemory().capacity());
> > + if (task.getISA() == ISA.X8664)
> > + assertEquals("Memory Buffer Capacity: ",
> > 0xffffffffffffffffL,
> > + task.getMemory().capacity());
> > }
> >
> >
> > There is also the PPC; the attribute is dependent on the ISA's word
> > size, though, is something like:
> > switch (task.getISA().wordSize())
> > case 4: assert ... ; break;
> > case 8: assert ... ; break;
> > default: fail("unknown word size");
> > }
> > simplier?
> >
> > is the test passing or still being skipped?
> can we address these?
>
> Andrew
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-28 8:21 ` Zhao Shujing
@ 2007-11-29 10:37 ` Mark Wielaard
2007-11-29 10:44 ` Mark Wielaard
0 siblings, 1 reply; 8+ messages in thread
From: Mark Wielaard @ 2007-11-29 10:37 UTC (permalink / raw)
To: pearly.zhao; +Cc: Andrew Cagney, frysk
Hi Pearly,
On Wed, 2007-11-28 at 16:24 +0800, Zhao Shujing wrote:
> It's been updated and the test is passing now.
Congrats, it does PASS on x86 and x86_64. And more congrats, since you
seem to have caught a bug on 32bit-on-64bit systems! If you run the test
on a x86_64 system with ./TestRunner -arch 32
frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity you get:
Caused by this piece of code in frysk-sys/frysk/sys/cni/Ptrace.cxx:
jlong
frysk::sys::Ptrace$AddressSpace::length ()
{
return -1UL;
}
Which is correct for 32 bit systems when frysk is compiled on a 32 bit
system and correct for 64 bit systems when compiled on 64 bit systems.
But not for an 32 bit address space on a 64 bit system.
Unfortunately I don't immediately know the correct way to fix this at
this point. So I filed it as
http://sourceware.org/bugzilla/show_bug.cgi?id=5432
If someone knows how to fix this properly you now have a testcase!
Cheers,
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java
2007-11-29 10:37 ` Mark Wielaard
@ 2007-11-29 10:44 ` Mark Wielaard
0 siblings, 0 replies; 8+ messages in thread
From: Mark Wielaard @ 2007-11-29 10:44 UTC (permalink / raw)
To: pearly.zhao; +Cc: Andrew Cagney, frysk
On Thu, 2007-11-29 at 11:36 +0100, Mark Wielaard wrote:
> Congrats, it does PASS on x86 and x86_64. And more congrats, since you
> seem to have caught a bug on 32bit-on-64bit systems! If you run the test
> on a x86_64 system with ./TestRunner -arch 32
> frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity you get:
> [... nothing ...]
Doh. Of course it helps if I actually paste the output:
1)
testMemoryBufferCapacity(frysk.proc.live.TestByteBuffer)junit.framework.AssertionFailedError: Memory Buffer Capacity: expected:<4294967295> but was:<-1>
at
frysk.proc.live.TestByteBuffer.testMemoryBufferCapacity(TestRunner)
at frysk.junit.Runner.runCases(TestRunner)
at frysk.junit.Runner.runArch32Cases(TestRunner)
at frysk.junit.Runner.runTestCases(TestRunner)
at TestRunner.main(TestRunner)
> http://sourceware.org/bugzilla/show_bug.cgi?id=5432
> If someone knows how to fix this properly you now have a testcase!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-11-29 10:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20071122090733.7335.qmail@sourceware.org>
2007-11-22 17:10 ` [SCM] master: Add a test testMemoryBufferCapacity() to TestByteBuffer.java Andrew Cagney
2007-11-23 4:10 ` Zhao Shujing
2007-11-24 0:07 ` Andrew Cagney
2007-11-26 2:53 ` Zhao Shujing
2007-11-27 14:45 ` Andrew Cagney
2007-11-28 8:21 ` Zhao Shujing
2007-11-29 10:37 ` Mark Wielaard
2007-11-29 10:44 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).