On Tue, 2006-02-28 at 13:16 +0000, Helios Aliaga wrote:
> On 2006-02-23 Philip Levis wrote:
> > By definition, a particular CPU instruction has to cause the segfault.
> > This means that it's within a particular function. What function is it
> > in?
> >
> > Phil
>
>
> I've found that the segfault occurs within
>
> void event_tossim_msg_create(event_t *fevent, TOS_MsgPtr msg, int dest)
>
> Just in : msgev->msg = (TOS_MsgPtr)malloc(sizeof(TOS_Msg));
>
> But this doesn't happen always this line is executed. In the beginning
> it works fine, but after a short time it gives the segfault.
Ah, it looks like you are using pc/packet, not TOSSIM-packet. Matt Welsh
wrote the former, I wrote the latter. I'd suggest trying TOSSIM-packet.
It's in beta/.
Your problem is that msgev is a null pointer. When you reach that line
in your debugger, try
print msgev
What's weird about that is that it follows this call:
tossim_msg_event *msgev = (tossim_msg_event *)malloc(sizeof
(tossim_msg_event));
My best guess is that malloc is failing (you're running out of memory).
This could be due to too large a simulation for your machine or a memory
leak in the pc/packet code. Or it could be something else entirely, I'd
have to sit down with a debugger to be sure.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help