Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] crash report : this plugin should stop its obs_output before obs_shutdown #38

Open
walker-WSH opened this issue Nov 14, 2024 · 4 comments
Labels
question Further information is requested

Comments

@walker-WSH
Copy link

walker-WSH commented Nov 14, 2024

crash callstack

1731548055

in obs_shutdown, normally it should not appear that there is an obs_outout_t object not destroied here.
for output object in this plugin, it should register OBS's front event (OBS_FRONTEND_EVENT_EXIT), and stop output when event arrives.

please confirm it, thanks ~

@YorVeX
Copy link
Owner

YorVeX commented Nov 14, 2024

it should register OBS's front event (OBS_FRONTEND_EVENT_EXIT), and stop output when event arrives.

That's exactly what Beam is doing. Actually it is visible from your stack trace, because the code where OBS wants to destroy its output during OBS shutdown is where it crashes for you.

I cannot reproduce that here, so I would assume it's a subsequent error caused by another issue happening earlier during your session. If you can provide the OBS log of a full session from start to exit I can have a look.

Or what would also help would be a repro scenario that starts with an empty/fresh OBS installation with only Beam installed where the crash is eventually happening on exit.

@YorVeX YorVeX added the question Further information is requested label Nov 14, 2024
@walker-WSH
Copy link
Author

	2024-11-11 08:16:05.170+09:00 (24800)  0000026999EA9FC0-obs_output_create: id=Beam Output, name=Beam Output

	2024-11-11 08:16:06.130+09:00 (24800)  000002AA79E75160-obs_output_create: id=Beam Output, name=Beam Output

	2024-11-11 08:16:14.239+09:00 [obs-app.cpp:1172] (24800)  Start invoking obs_shutdown

	2024-11-11 08:16:14.317+09:00 (24800) {3016} 000002AA79E75160-obs_output_destroy: [Enter]

	2024-11-11 08:16:14.317+09:00 (24800) {3027} 000002AA79E75160-obs_output_destroy: [Exit]

	2024-11-11 08:16:14.356+09:00 (24800) {3038} 0000026999EA9FC0-obs_output_destroy: [Enter]

	crash at xObsSteam::destory for 0000026999EA9FC0

sorry I can't provide the full logs.

for the above logs, we can see the obs_output_destroy for xObsStream is called after obs_shutdown.
that means the obs_output_destory has been called too late

@YorVeX
Copy link
Owner

YorVeX commented Nov 14, 2024

It's not called after obs_shutdown, it's called during obs_shutdown. It's normal that obs_shutdown is invoked and then calling various destroy operations on all objects that need to be free'd, that's the job of obs_shutdown you could say.

Not sure whether I am interpreting your trace right, but it seems that Beam creates an output twice for you, as I see two obs_output_create calls. That shouldn't happen and might be the actual bug, it also would explain while it fails during the 2nd destroy operation - the 1st one already free'd some global resources, so the 2nd is trying to free resources that don't exist anymore. That also matches your crash trace where it runs into an error on FreeHeap().

But as I said, I would need a repro scenario to further investigate, as it doesn't occur for me here, especially without logs to get more info. Currently I don't have any idea how to trigger an output being created twice, maybe if something during creation fails in a way that leaves the output in a half-created state.

@walker-WSH
Copy link
Author

@YorVeX yes, there are two output objects created.
the log is from user, and I did not reproduce this crash.

I will tell you if I reproduce it. thanks for your job~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants