Opened 10 years ago

Closed 9 years ago

Last modified 5 years ago

#11213 closed bug (fixed)

[media_addon_server] crashes in BTimeSource::GetTime ()

Reported by: diver Owned by: Barrett
Priority: normal Milestone: R1/beta2
Component: Servers/media_addon_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #11228, #11388, #12606
Platform: All

Description

This is hrev47837 running in Parallels Desktop 10 for Mac 10.0.2

Second boot from anyboot image (with extension renamed from .anyboot to .hdd) crashed media_addon_server.

Attachments (1)

media_addon_server-713-debug-08-09-2014-09-26-09.report (11.7 KB ) - added by diver 10 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by diver, 10 years ago

Blocking: 11228 added

comment:2 by korli, 10 years ago

MultiAudioNode::NodeRegistered() uses BTimeSource::Now(), though BTimeSource::FinishCreate() has not yet been called. Questions:

  • is it OK to use the timesource in NodeRegistered()?
  • if yes, should BTimesource simply avoid crashing? Or should FinishCreate() be called before NodeRegistered()

It's probably OK to push parameters change with a zero performance time on node registration, this would fix this bug.

comment:3 by pulkomandy, 10 years ago

Blocking: 11388 added

comment:4 by Barrett, 10 years ago

I think BTimeSource should still work when called in NodeReceived() as the node is just about to become operating, and we may still have need to know at which performance time we are.

What i'm going to say should be seen from the perspective of the Media Kit creators :

I think the only reason to have this FinishCreate function, is that it should be done as soon as we have a working id and just a bit before we call NodeRegistered().

The reason for this is that the most simpler way should have been to do it directly inheriting BMediaNode::NodeRegistered in BTimeSource. But the problem is that in the case we have a mixed BTimeSource and BMediaEventLooper (such as the multi audio node) the bebook force us to call BMediaEventLooper::NodeRegistered() in subclasses only at the end of the function. Textually "if you implement NodeRegistered() you should call through to BMediaNode::NodeRegistered() after you've done your custom operations.". So that's why there's this FinishCreate() function, we are forced to notify the base class at the end of NodeRegistered but we need the TimeSource to be operating once we get a call to it. If there was not this problem, BTimeSource child classes would have called it's father implementation and no more.

I have already to test the calls order under BeOS, so i may be eventually wrong, but i'm pretty certain it works this way.

In the end those are mine conclusions :

  • There are a lot of nodes in the Haiku source, such as the AudioMixer (which isn't calling it's father class NodeRegistered) and the MultiAudioNode which is calling it at the begin of the function.
  • FinishCreate() should be called before NodeRegistered().

I'm about to prepare a patch to fix those issues around the source code, but any concern or refute is good as well as it come.

comment:5 by Barrett, 9 years ago

Owner: changed from axeld to Barrett
Status: newassigned

comment:6 by Barrett, 9 years ago

Resolution: fixed
Status: assignedclosed

I asked Diver to recheck this some months ago and the issue seems resolved. Closing this until the bug reappear, it doesn't make sense to continue with the plan right now.

comment:7 by diver, 5 years ago

Blocking: 12606 added

comment:8 by nielx, 5 years ago

Milestone: R1R1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.