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: Server does not exit gracefully #1571

Open
dimitry-ishenko opened this issue Sep 20, 2024 · 3 comments
Open

Bug: Server does not exit gracefully #1571

dimitry-ishenko opened this issue Sep 20, 2024 · 3 comments
Labels

Comments

@dimitry-ishenko
Copy link
Contributor

dimitry-ishenko commented Sep 20, 2024

Observed Behavior

For example, starting server in an empty directory (without casparcg.config), I get this:

dimitry@laptop:~/tmp$ casparcg 
Type "q" to close application.
Aborted

If there is an earlier backtrace in the directory, I will get this:

dimitry@laptop:~/tmp$ casparcg 
[2024-09-19 23:12:11.593643] [0x000079c055fba700] [error]    0# 0x00005D8FCAB0C9B4
 1# 0x0000708F77A45320
 2# 0x0000708F77A9EB1C
 3# 0x0000708F77A4526E
 4# 0x0000708F77A45320
 5# 0x00005D8FCAB850BC
 6# 0x00005D8FCAB80955
 7# 0x00005D8FCAB85E25
 8# 0x0000708F86CD797F
 9# 0x0000708F77A9CA94
10# 0x0000708F77B29C3C

Type "q" to close application.
Aborted

If the config file is corrupt, I may get one of these:

dimitry@laptop:~/tmp/casparcg$ casparcg-server-2.4 
Type "q" to close application.
dimitry@laptop:~/tmp/casparcg$ casparcg-server-2.4 
Type "q" to close application.
Aborted
dimitry@laptop:~/tmp/casparcg$ casparcg-server-2.4 
[2024-09-19 23:15:11.469021] [0x000070382a705700] [error]    0# 0x000059878C21D9B4
 1# 0x000071F27B845320
 2# 0x000071F27B89EB1C
 3# 0x000071F27B84526E
 4# 0x000071F27B845320
 5# 0x000059878C2960BC
 6# 0x000059878C291955
 7# 0x000059878C296E25
 8# 0x000071F28C19A97F
 9# 0x000071F27B89CA94
10# 0x000071F27B929C3C

Type "q" to close application.

Similar thing happens if I try to launch it with, eg casparcg -h or casparcg --help or any other invalid path to the config file.

Expected behaviour

Looking at the code, I should be getting an error message:

 ### Invalid configuration file. ###

But, I don't. Running in Debug mode, it seems to abort on this line:

append_timestamp(pre_message_stream, boost::log::extract<boost::posix_time::ptime>("TimestampMillis", rec).get());

There appears to be some sort of a race condition, because if I step through the code it does sometimes display the message...

Steps to reproduce

See above.

Environment

  • Server version: v2.4.0
  • Operating system: Ubuntu Linux 24.04
@alevecchio
Copy link

I have a similar exit when I try to start CasparCG without a mounted drive. I didn't check the error code to see if is the same.
Config file is ok, but the media drive "is not there".

@dimitry-ishenko
Copy link
Contributor Author

I have a similar exit when I try to start CasparCG without a mounted drive. I didn't check the error code to see if is the same. Config file is ok, but the media drive "is not there".

I suspect it's the same problem. The server tried to access the media path, an exception gets thrown and it aborts during logging.

@dimitry-ishenko
Copy link
Contributor Author

Just confirmed that if I set media path to a non-existent directory and the server doesn't have write access to create it, it will fail in the same way.

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

No branches or pull requests

2 participants