Opened 8 years ago

Closed 7 years ago

#486 closed Bug Report (worksforme)

Ingen crash after deleting plugin

Reported by: Gabriel M. Beddingfield Owned by: David Robillard
Priority: major Component: Ingen
Keywords: Cc: gabrbedd@…

Description

I'm using Ingen SVN Rev 2484 with the newly released Composite Sampler plugin (0.004).[1] I get a crash whenever I do the following:

  • ingen -eg
  • Add the Composite Plugin to the flow canvas
  • Right-click the Plugin and select Delete. (It goes away without error, AFAIK the rest of the Ingen session goes OK.)
  • Close Ingen, get segfault

A gdb session is attached. I know it's likely that my plugin is somehow causing the problem -- but it's happening long after my plugin is unloaded, and I'm having trouble pinpointing the issue.

When I single-step through the code, it always happens here, on the line that is 'delete n;' (PostProcessor?.cpp:88)

void PostProcessor::process() {

/* [SNIP] */

/* Process normal events */ Raul::List<Event*>::Node* n = _events.head(); while (n) {

if (n->elem()->time() > end_time)

break;

Raul::List<Event*>::Node* next = n->next(); n->elem()->post_process(); _events.erase(_events.begin()); delete n->elem(); delete n; n = next;

}

}

Attachments (1)

ingen-gdb-composite-crash.txt (22.6 KB) - added by David Robillard 8 years ago.
Backtrace

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by David Robillard

Backtrace

comment:2 Changed 8 years ago by Gabriel M. Beddingfield

Cc: gabrbedd@… added

comment:3 Changed 8 years ago by Gabriel M. Beddingfield

I think what's happinging is this: Composite uses QThread from libQtCore. QThread allocates some thread-local storage (pthread_key_create) with a destructor function. When Composite (and Qt) is unloaded... it does not call pthread_key_delete. When Ingen closes and pthread de-allocates all the thread-local storage, it tries to call the destructor that QThread set. This is where it segfaults.

So, it looks like this is /not/ and ingen bug. I'm writing a test case to prove the bug and will submit it to Qt. I'll also report back then.

comment:4 Changed 8 years ago by Gabriel M. Beddingfield

comment:5 Changed 7 years ago by David Robillard

Resolution: worksforme
Status: newclosed

Works for me. Nice plugin, BTW, we need more samplers :)

Note: See TracTickets for help on using tickets.