Opened 9 years ago

Closed 4 years ago

#6188 closed bug (fixed)

[media_addon_server] crashes in BBuffer::SetHeader ()

Reported by: samui Owned by: axeld
Priority: normal Milestone: R1
Component: Servers/media_addon_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #6195, #9516, #10848
Has a Patch: yes Platform: All

Description

Try this

open more videos than your processor can handle. the playback will become jerky and choppy.

then try to adjust system volume from the deskbar widget. it does not respond to clicking. after few clicks deskbar crashes sporadically.

tested under virtualbox, 256mb of mem (that there was plenty free even with all the video going on).

Attachments (5)

procdiehaiku.png (158.4 KB) - added by samui 9 years ago.
screenshot6.png (140.5 KB) - added by Barrett 4 years ago.
0002-Clean-SharedBufferList.h.patch (2.8 KB) - added by Barrett 4 years ago.
0003-Correctly-check-when-the-BBuffer-failed-the-registra.patch (2.0 KB) - added by Barrett 4 years ago.
0001-BBuffer-Unregister-buffer-when-clone_area-fail-fixes.patch (2.1 KB) - added by Barrett 4 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 Changed 9 years ago by axeld

Can you provide a stack trace from the crash?

See ReportingBugs under "Application Bugs" for more details, thanks!

Does it only happen when you play videos, or also if you are running apps like GLTeapot that also produce heavy load.

Changed 9 years ago by samui

Attachment: procdiehaiku.png added

comment:2 Changed 9 years ago by samui

attached image.

When processor is pegged to the max, deskbar becomes garbled and is unresponsive. this time i tested, media player died first, let me do the kdl thing and then died again giving the same popup. had about 14 h.264 vids running at the same time.

after the media player items were flushed, the deskbar redrew itself but was unresponsive and got garbled with processcontroller and volume controller drawing on top of each other. even five mins after the crash the deskbar shows 100% processor usage and is behaving slowly and erratically. virtualbox hovewer says haiku is not taxing the processor almost at all so its just processcontroller not redrawing the current state.

comment:3 Changed 9 years ago by samui

tested on the latest nightly too, same thing happens. intel i5 processor, virtual memory disabled in haiku.

comment:4 Changed 9 years ago by stippi

Can you please check if your test case runs without problems now?

comment:5 Changed 8 years ago by diver

Component: - GeneralServers/media_addon_server
Owner: changed from nobody to axeld

comment:6 Changed 8 years ago by diver

On attached screenshot it is media_addon_server which crashed MediaPlayer. Can you reproduce deskbar crash on recent revision?

comment:7 Changed 5 years ago by diver

Summary: tracker deskbar volume control dies under heavy load[media_addon_server] crashes in BBuffer:SetHeader ()

comment:8 Changed 5 years ago by diver

Blocking: 6195 added

comment:9 Changed 5 years ago by diver

Blocking: 10848 added

comment:10 Changed 5 years ago by diver

Summary: [media_addon_server] crashes in BBuffer:SetHeader ()[media_addon_server] crashes in BBuffer::SetHeader ()

comment:11 Changed 5 years ago by diver

Blocking: 9516 added

(In #9516) Thanks for the note.

comment:12 Changed 4 years ago by diver

Version: R1/alpha2R1/Development

Still here in hrev48956. Easily reproducible when playing movies over sshfs (from haikuporter).

comment:13 Changed 4 years ago by Barrett

All those BBuffer issues around, might be related to #4954? When enabling debugging, i realized that his happens when there's a fail in registering a BBuffer to the media_server, this seems a good clue to begin investigating on the source of the problems.

Changed 4 years ago by Barrett

Attachment: screenshot6.png added

comment:14 Changed 4 years ago by Barrett

Has a Patch: set

Changed 4 years ago by Barrett

comment:15 Changed 4 years ago by Barrett

Unregistering the buffer when it fails fixes the bug in my system.

comment:16 Changed 4 years ago by korli

0001:

  • BBuffer::ID() should return a negative value on bad registration (0 isn't a good one).

0003:

  • "return OK;" could be factorized.

Thanks for your efforts! It's appreciated.

comment:17 Changed 4 years ago by korli

Sorry but memset() writes bytes, you need to set fMediaHeader.buffer to a negative value, possibly fArea.

comment:18 Changed 4 years ago by Barrett

I think i should avoid to do things at 00:00, sorry. I've not figured out that memset was unneeded.

comment:19 Changed 4 years ago by Barrett

I think BBuffer::ID should be set to -1 until it's correctly registered to the media server, this also apply for other members. I've also set ID to fArea when cloning fails, as it seems you meant that.

Version 0, edited 4 years ago by Barrett (next)

comment:20 Changed 4 years ago by stippi

All three patches look good to me. Thanks for your efforts!

comment:21 Changed 4 years ago by pulkomandy

Resolution: fixed
Status: newclosed

Patches applied in hrev49035.

Note: See TracTickets for help on using tickets.