Skip to content

upload_coredumps: Upload backtrace if COREDUMP_WITH_BACKTRACE is set#25137

Open
ricardobranco777 wants to merge 2 commits intoos-autoinst:masterfrom
ricardobranco777:backtrace
Open

upload_coredumps: Upload backtrace if COREDUMP_WITH_BACKTRACE is set#25137
ricardobranco777 wants to merge 2 commits intoos-autoinst:masterfrom
ricardobranco777:backtrace

Conversation

@ricardobranco777
Copy link
Copy Markdown
Contributor

@ricardobranco777 ricardobranco777 commented Mar 29, 2026

@ricardobranco777 ricardobranco777 marked this pull request as draft March 29, 2026 19:46
@ricardobranco777 ricardobranco777 force-pushed the backtrace branch 4 times, most recently from 0802259 to f37ac6b Compare March 29, 2026 21:54
@ricardobranco777 ricardobranco777 marked this pull request as ready for review March 30, 2026 08:17
Copy link
Copy Markdown
Member

@foursixnine foursixnine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have a minor niptick

@ricardobranco777 ricardobranco777 added the WIP Work in progress label Mar 30, 2026
@ricardobranco777 ricardobranco777 force-pushed the backtrace branch 2 times, most recently from 2a38bc9 to 391484a Compare March 31, 2026 07:14
Copy link
Copy Markdown
Contributor

@grisu48 grisu48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intention is good, but adding host modifications to a subroutine which should only collect data adds to overall developer confusion and unintended side-effects when using a global library function.

I think we should extract the parts of the routine which modifies the system to ensure that the data collection remains side-effect free.

record_info("COREDUMPS found", "we found coredumps on SUT, attempt to upload");
# Record soft-failure only on selected cases to collect data
record_soft_failure("poo#197969 - Coredumps are being silently ignored in openQA tests") if (is_tumbleweed || get_var("CONTAINER_RUNTIMES"));
my $get_backtrace = get_var("COREDUMP_WITH_BACKTRACE") && !is_transactional;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the !is_trancational switch needed when a dedicated setting is applied here?

Why not simply not apply the setting on transactional systems?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the !is_trancational switch needed when a dedicated setting is applied here?

Why not simply not apply the setting on transactional systems?

Because we're not scheduling the console/coredump_collect module in SLEM and only SLEM > 6.0 have the systemd-coredump package.

record_soft_failure("poo#197969 - Coredumps are being silently ignored in openQA tests") if (is_tumbleweed || get_var("CONTAINER_RUNTIMES"));
my $get_backtrace = get_var("COREDUMP_WITH_BACKTRACE") && !is_transactional;
if ($get_backtrace) {
script_run('sed -i s/enabled=0/enabled=1/ /etc/zypp/repos.d/*-[Dd]ebug.repo');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be part of this routine.

This is an action with severe consequences for the host system. As such this should not be handled in the upload_coredumps routine, which does not suggest that new packages are installed and zypper repos are modified. This adds undesired side-effect to a routine, which should only collect data.

I'd suggest this gets it's own subroutine as preparation step either inside the library or in another test module.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be part of this routine.

This is an action with severe consequences for the host system. As such this should not be handled in the upload_coredumps routine, which does not suggest that new packages are installed and zypper repos are modified. This adds undesired side-effect to a routine, which should only collect data.

I'd suggest this gets it's own subroutine as preparation step either inside the library or in another test module.

This is not a problem because this is only done if you clone the job with COREDUMP_WITH_BACKTRACE=1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I have to disagree with this for a library function. If this would be a subroutine in a test module, it would be ok like this.

But this is adding an invisible side-effect into a core library function, which is widely used. Here we should demand more careful handling.

Also counter-argument: This is action is only needed when COREDUMP_WITH_BACKTRACE=1 is set, then it shouldn't be difficult to find a matching place where this can be done outside the library function.

Copy link
Copy Markdown
Contributor Author

@ricardobranco777 ricardobranco777 Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I have to disagree with this for a library function. If this would be a subroutine in a test module, it would be ok like this.

But this is adding an invisible side-effect into a core library function, which is widely used. Here we should demand more careful handling.

This is expected when you clone with COREDUMP_WITH_BACKTRACE=1 which transforms the VM into one used only for debugging purposes.

Also counter-argument: This is action is only needed when COREDUMP_WITH_BACKTRACE=1 is set, then it shouldn't be difficult to find a matching place where this can be done outside the library function.

What's your suggestion? It must be called from this function where it makes sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to move the installation parts to coredump_collect.pm and add a "backtrace" parameter to the subroutine.

I think that's better because it makes the subroutine side-effect free and the specific actions that require additional packages is then disabled by default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to move the installation parts to coredump_collect.pm and add a "backtrace" parameter to the subroutine.

I think that's better because it makes the subroutine side-effect free and the specific actions that require additional packages is then disabled by default.

This subroutine is not used only by the coredump_collect module. We want to enable all callers of upload_coredumps to get backtraces on coredumps when they set this variable.

@ricardobranco777 ricardobranco777 changed the title upload_coredumps: Upload backtrace if DEBUG is set upload_coredumps: Upload backtrace if COREDUMP_WITH_BACKTRACE is set Mar 31, 2026
By cloning a job with COREDUMP_WITH_BACKTRACE=1 it's possible to get a
backtrace on non-transactional systems.

Related ticket: https://progress.opensuse.org/issues/197969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants