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

🧑‍🌾 Flaky TestGuardCondition.construction_and_destruction throwing SEH Exception in Windows repeated #2435

Closed
Crola1702 opened this issue Feb 23, 2024 · 11 comments
Assignees
Labels

Comments

@Crola1702
Copy link
Contributor

Crola1702 commented Feb 23, 2024

Bug report

Required Info:

  • Operating System:
    • Windows
  • Installation type:
    • Source
  • Version or commit hash:
    • Rollingo
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

  1. Run a build in nightly_win_rep
  2. See TestGuardCondition.construction_and_destruction test failure

Expected behavior

Test should pass

Actual behavior

Test is failing

Additional information

Reference build: https://ci.ros2.org/view/nightly/job/nightly_win_rep/3273/#showFailuresLink

Test regressions:

Log output:

[ RUN      ] TestGuardCondition.construction_and_destruction
unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.
Stack trace:


[  FAILED  ] TestGuardCondition.construction_and_destruction (0 ms)
Crola1702 added a commit to osrf/buildfarm-tools that referenced this issue Feb 23, 2024
New issues:
* ros2/rclcpp#2435
* ros2/rclcpp#2436

Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
@Crola1702 Crola1702 changed the title 🧑‍🌾 TestGuardCondition.construction_and_destruction throwing SEH Exception in Windows 🧑‍🌾 Flaky TestGuardCondition.construction_and_destruction throwing SEH Exception in Windows Feb 27, 2024
@Crola1702
Copy link
Contributor Author

Flaky ratio in the last 30 days (Apr 11th):

job_name last_fail first_fail build_count failure_count failure_percentage
nightly_win_rep 2024-04-09 2024-03-13 29 11 37.93

@Crola1702
Copy link
Contributor Author

Flaky ratio in the last 30 days (Jun 18th):

job_name last_fail first_fail build_count failure_count failure_percentage
nightly_win_rep 2024-06-16 2024-05-21 25 8 32.0

@Crola1702 Crola1702 changed the title 🧑‍🌾 Flaky TestGuardCondition.construction_and_destruction throwing SEH Exception in Windows 🧑‍🌾 Flaky TestGuardCondition.construction_and_destruction throwing SEH Exception in Windows repeated Jun 18, 2024
@ahcorde
Copy link
Contributor

ahcorde commented Jul 18, 2024

The line that is failing is https://github.com/ros2/rclcpp/blob/rolling/rclcpp/test/rclcpp/test_guard_condition.cpp#L61-L62

    auto mock = mocking_utils::inject_on_return(
      "lib:rclcpp", rcl_guard_condition_fini, RCL_RET_ERROR);

@ahcorde
Copy link
Contributor

ahcorde commented Jul 18, 2024

Segfault is happening in this line inside the inject_on_return

mock_ = mmk_mock(target_c_str(), mock_type);

@mjcarroll
Copy link
Member

Thanks for isolating the area where the segfault is coming from!

is target_c_str() or mock_type null at this point?

@ahcorde
Copy link
Contributor

ahcorde commented Jul 18, 2024

target_c_str() has some value (lib:rclcpp) but I'm still trying to understand what's inside the mock_type

@ahcorde
Copy link
Contributor

ahcorde commented Jul 24, 2024

more details:

Code is failing here

mmk_vfprintf_ = (void*) plt_get_real_fn(ctx, vfprintf);

In particular plt_get_real_fn is calling CreateToolhelp32Snapshot() which is returning an INVALID_HANLDE_VALUE and the code abort.

@ahcorde
Copy link
Contributor

ahcorde commented Jul 24, 2024

The error in particular is The program issued a command but the command lenght is incorrect

@ahcorde
Copy link
Contributor

ahcorde commented Jul 24, 2024

I made this patch in plt-pe.c

HANDLE snap;
do {
  snap = CreateToolhelp32Snapshot(TH32CS_NSAPMODULE, GetCurrentProcessId());
} while (snap == INVALID_HANDLE_VALUE);

@ahcorde
Copy link
Contributor

ahcorde commented Jul 24, 2024

Related fix ros2/Mimick#38

@clalancette
Copy link
Contributor

Given what we merged yesterday, I'm going to consider that this one is "fixed", and close this out. If it turns out not to fix the issue, please feel free to reopen.

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

No branches or pull requests

5 participants