Ticket #42 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

memory errors in timer-cancel test program (devel branch)

Reported by: carns Owned by: dkimpe
Priority: don't know Component: don't know
Version: git repository Keywords: timer devel finalize
Cc:

Description

Here is the first part of the output from valgrind:

==5523== Invalid read of size 4
==5523==    at 0x4059CC: ae_opcache_put (opcache.c:381)
==5523==    by 0x40475A: aesop_timer_poll (timer.c:182)
==5523==    by 0x405D7C: ev_async_cb (resource.c:77)
==5523==    by 0x40D27E: ev_invoke_pending (ev.c:2139)
==5523==    by 0x40E048: ev_run (ev.c:2515)
==5523==    by 0x406651: ae_poll (resource.c:346)
==5523==    by 0x403C8D: main (timer-cancel.ae:56)
==5523==  Address 0x571e37c is 156 bytes inside a block of size 168 free'd
==5523==    at 0x4C2A739: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5523==    by 0x405908: ae_opcache_destroy (opcache.c:303)
==5523==    by 0x404A05: aesop_timer_finalize (timer.c:314)
==5523==    by 0x403802: __ae_worker_aesop_main (timer-cancel.ae:52)
==5523==    by 0x4034BE: aesop_main_dotimer_50_11_callback (timer-cancel.ae:50)
==5523==    by 0x4025D5: dotimer_aesop_timer_19_13_callback (timer-cancel.ae:19)
==5523==    by 0x404744: aesop_timer_poll (timer.c:182)
==5523==    by 0x405D7C: ev_async_cb (resource.c:77)
==5523==    by 0x40D27E: ev_invoke_pending (ev.c:2139)
==5523==    by 0x40E048: ev_run (ev.c:2515)
==5523==    by 0x406651: ae_poll (resource.c:346)
==5523==    by 0x403C8D: main (timer-cancel.ae:56)

In this test program, the aesop_timer_finalize() function is being called from within aesop. In this specific case this means that aesop_timer_finalize() is actually being executed in the context of the timer callback from aesop_timer_poll(). It looks like we need to protect this somehow.

Change History

comment:1 Changed 10 years ago by carns

  • Status changed from new to closed
  • Resolution set to fixed

This was fixed as a side effect of re-implementing the timer interface a while back.

Note: See TracTickets for help on using tickets.