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

dlt_log_init_multiple_logfiles_support () is triggered twice during startup #452

Closed
michael-methner opened this issue Mar 10, 2023 · 3 comments · Fixed by #459
Closed

dlt_log_init_multiple_logfiles_support () is triggered twice during startup #452

michael-methner opened this issue Mar 10, 2023 · 3 comments · Fixed by #459
Assignees

Comments

@michael-methner
Copy link
Collaborator

dlt_log_init_multiple_logfiles_support () is triggered twice during startup. This might not be a problem or even a desired behavior.

I am creating this ticket in order to investigate if there might be issues arising from the fact. A potential fix might be a simplified initailization code for DLT.

First call:
#0 dlt_log_init_multiple_logfiles_support (mode=DLT_LOG_TO_FILE, enable_multiple_logfiles=true, logging_file_size=200, logging_files_max_size=1000)
at dlt-daemon/src/shared/dlt_common.c:1837
#1 0x000055555555d624 in main (argc=1, argv=0x7fffffffdb78) at /home/mmethner/src/dlt_size_limits/dlt-daemon/src/daemon/dlt-daemon.c:960

Second call:
#0 dlt_log_init_multiple_logfiles_support (mode=DLT_LOG_TO_FILE, enable_multiple_logfiles=true, logging_file_size=200, logging_files_max_size=1000)
at dlt-daemon/src/shared/dlt_common.c:1837
#1 0x00005555555617c3 in dlt_daemon_local_init_p1 (daemon=, daemon_local=0x7fffffff7370, verbose=)
at dlt-daemon/src/daemon/dlt-daemon.c:1198
#2 0x000055555555d792 in main (argc=, argv=)
at dlt-daemon/src/daemon/dlt-daemon.c:1007
(gdb)

@lvklevankhanh
Copy link
Contributor

Hi @michael-methner ,
I am working on this issue.

Regards,

@lvklevankhanh
Copy link
Contributor

hi @michael-methner ,

In the dlt_daemon_daemonize() method, I'm not sure in which case of fork() should/shouldn't re-initialize internal logging. So, I think we should re-initialize in any case of fork() when daemon mode option enable.
Please review the code change at #459

@lvklevankhanh
Copy link
Contributor

Hi @michael-methner ,
After reviewed and tested code changes of committed "dlt-daemon: fix internal logging to file after daemonize", I think the re-initializing internal logging after fork() could be removed. There are not any potential issues without the second call.
Please review the code change at #459

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

Successfully merging a pull request may close this issue.

2 participants