Opened 5 years ago

Closed 4 years ago

#11213 closed bug (fixed)

[media_addon_server] crashes in BTimeSource::GetTime ()

Reported by: diver Owned by: Barrett
Priority: normal Milestone: R1
Component: Servers/media_addon_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #11228, #11388
Has a Patch: no 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 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by diver

Blocking: 11228 added

comment:2 Changed 5 years ago by korli

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 Changed 4 years ago by pulkomandy

Blocking: 11388 added

comment:4 Changed 4 years ago by Barrett

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 Changed 4 years ago by Barrett

Owner: changed from axeld to Barrett
Status: newassigned

comment:6 Changed 4 years ago by Barrett

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.

Note: See TracTickets for help on using tickets.