[Click] segmentation faukt with uniqueify()

Beyers Cronje bcronje at gmail.com
Tue Oct 13 10:15:52 EDT 2009


Hi,

Simple case of operator precedence. As you have it if _active == 2 then
action() will execute even if p == null

Change to:

if (p && (((size() >= _limitToMark ) && _active==1 ) || _active==2))

Beyers


On Tue, Oct 13, 2009 at 3:35 PM, <remi.clavier at orange-ftgroup.com> wrote:

> Help needed !
>
> In witch cases may the uniqueify() create a segmentation fault?
>
> with this code, a seg fault occurs just after the uniqueify() line.
> Packet *
> SimpleQueueWithQoS::pull(int)
> {
>  Packet *p = deq();
>  if (p && ( (size() >= _limitToMark ) && _active==1 ) || _active==2)
>    p = action(p);
>  return p;
> }
>
> Packet *
> SimpleQueueWithQoS::action(Packet *p_in)
> {
>     click_chatter("before");
>  WritablePacket *pp;
> pp = p_in->uniqueify();
>    click_chatter("after");
> /* assert(p->has_network_header());
>
>
> Thanks
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list