Regarding the bad-alloc error...
I am creating a new packet with just a new command.
Added the constructor in packet.hh
Packet(MemCmd _cmd)
:cmd(_cmd)
{
}
void setAddr(Packet *pkt,Addr addr)
{
pkt->addr=addr;
flags.set(VALID_ADDR);
}
the new packet is created as
PacketPtr inv_pkt= new Packet(MemCmd::ReqMove);
inv_pkt->setAddr(inv_pkt,temp);
inv_pkt->setDest(-1); //as it is be broadcasted
inv_pkt->setExpressSnoop();
memSidePort->sendTiming(inv_pkt);
//after the work is done in timing access the control comes here
delete inv_pkt;
--
---
but l am getting seg fault after certain time execution when i delete the
packet
can u help me out..y it is so...
On Wed, Apr 6, 2011 at 10:44 PM, Korey Sewell <[email protected]> wrote:
> Wow,
> that's a great tip about valgrind.
>
> The only question now is: How am I going to get all that time I spent
> sifting through valgrind output back?! haha....
>
> Thanks again,
> Korey
>
> On Wed, Apr 6, 2011 at 1:03 PM, Ali Saidi <[email protected]> wrote:
> > Korey,
> >
> > If you're using valgrind you should use the suppressions options to get
> rid
> > of the Python issues that valgrind doesn't understand:
> > --suppressions=util/valgrind-suppressions will do the trick.
> >
> > Ali
> >
> >
> > On Wed, 6 Apr 2011 12:53:55 -0400, Korey Sewell <[email protected]>
> wrote:
> >>
> >> There is a finite amount of memory available on any particular system.
> >>
> >> So if you keep allocating memory and never delete then yes eventually
> >> you would run out of memory to allocate and get a std:bad_alloc.
> >>
> >> If you want to be check where memory leaks are, there is a program
> >> called "valgrind" that you can use. There are plenty of online
> >> tutorials on how to use it. Note, that if you do use it, the python
> >> part of M5 makes valgrind act not so nice, but once you get to the
> >> "Simulation Started..." part of the output then valgrind should help.
> >>
> >> On Wed, Apr 6, 2011 at 12:41 PM, sunitha p <[email protected]> wrote:
> >>>
> >>> no...so..shud i delete this packet..
> >>>
> >>> On Wed, Apr 6, 2011 at 5:58 PM, Nilay Vaish <[email protected]> wrote:
> >>>>
> >>>> On Wed, 6 Apr 2011, sunitha p wrote:
> >>>>
> >>>>> I am just creating a new packet.
> >>>>>
> >>>>> PacketPtr inv_pkt= new Packet(pkt,true);
> >>>>>
> >>>>> changed the acket address and command is changed to a new command
> which
> >>>>> is
> >>>>> just the a request.
> >>>>>
> >>>>> inv_pkt->setAddr(inv_pkt,temp);
> >>>>> inv_pkt->cmd=MemCmd::ReqMove;
> >>>>>
> >>>>> On Wed, Apr 6, 2011 at 5:15 PM, Nilay Vaish <[email protected]>
> wrote:
> >>>>>
> >>>>>> On Wed, 6 Apr 2011, sunitha p wrote:
> >>>>>>
> >>>>>> Hi all,
> >>>>>>>
> >>>>>>> I added a new command with just the request attribute. But if i
> try
> >>>>>>> to
> >>>>>>> run
> >>>>>>> for 100million instructions i am getting the following error. am
> >>>>>>> using
> >>>>>>> spec2006 bench marks
> >>>>>>>
> >>>>>>>
> >>>>>>> terminate called after throwing an instance of 'std::bad_alloc'
> >>>>>>> what(): std::bad_alloc
> >>>>>>> Program aborted at cycle 11199095000
> >>>>>>> Aborted
> >>>>>>>
> >>>>>>> even i checked the benchmarks html...dey suggest to run on 64 bit
> >>>>>>> machine..But even on it..am geting the same error.
> >>>>>>> can anyone please tell..wat is this error and why?
> >>>>>>>
> >>>>>>> --
> >>>>>>> Thanks & Regards
> >>>>>>>
> >>>>>>> Sunitha.P
> >>>>>>> 9092892876
> >>>>>>>
> >>>>>>>
> >>>>>> Are you using malloc and / or new to allocate memory dynamically?
> >>>>>>
> >>>>>> --
> >>>>>> Nilay
> >>>>>> _______________________________________________
> >>>>
> >>>>
> >>>> And do you delete this packet afterwords?
> >>>>
> >>>> --
> >>>> Nilay
> >>>> _______________________________________________
> >>>> m5-users mailing list
> >>>> [email protected]
> >>>> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks & Regards
> >>>
> >>> Sunitha.P
> >>> 9092892876
> >>>
> >>>
> >>> _______________________________________________
> >>> m5-users mailing list
> >>> [email protected]
> >>> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
> >>>
> >
> > _______________________________________________
> > m5-users mailing list
> > [email protected]
> > http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>
>
>
> --
> - Korey
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>
--
Thanks & Regards
Sunitha.P
9092892876
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users