vibe-core icon indicating copy to clipboard operation
vibe-core copied to clipboard

segfault when sending a message to a terminated task (vibe.d #2418)

Open Panke opened this issue 5 years ago • 0 comments

import vibe.vibe;

struct Message
{
}

void main()
{

   runTask(
   {
   	auto tid = Task.getThis().tid;
   	auto t1 = runTask(
      {
     		while (true)
     		{
        		sleep(1.seconds);
        		send(tid, Message.init);
     		}
   	});

   	auto t2 = runTask(
      {
     		sleep(5.seconds);
     		enforce(false, "failure");
   	});

   	while (true)
   	{
      	receive(
         	(Message m) { send(t2, m); }
         );
   	}
	});
	runApplication();
}

This segfaults after five seconds. My debugger says that the mbox field of the Tid t2 is 0x0.

I think this is the correct place for the ticket.

Panke avatar Feb 21 '20 07:02 Panke