#25944 closed defect (fixed)

Investigate and fix tortls/context_new test failure on win32 CI builds

Reported by: isis Owned by: saper
Priority: Medium Milestone:
Component: Core Tor/Tor Version: Tor: 0.3.3.5-rc
Severity: Normal Keywords: tor-ci tor-windows tor-testing
Cc: Actual Points:
Parent ID: #25549 Points: 1
Reviewer: Sponsor:

Description

From #25549, the tortls/context_new is reliably failing. We should investigate why and fix it.

Child Tickets

Change History (7)

comment:1 Changed 19 months ago by catalyst

Parent ID: #25549

comment:2 Changed 19 months ago by nickm

This code doing some of the same stuff as in #25943 -- creating X509 objects via tor_malloc_zero. If that's causing trouble there, it could also be the cause here.

Honestly, both this test and the test at issue in #25943 seem very overfitted to me -- they're testing internal paths of the functions they test without much rhyme or reason, using objects that violate our invariants. If we can't fix them, we should just replace them.

comment:3 Changed 19 months ago by saper

With additional debug

diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c
index 3fb1b39c7..b76124462 100644
--- a/src/ext/tinytest.c
+++ b/src/ext/tinytest.c
@@ -142,12 +142,12 @@ testcase_run_forked_(const struct testgroup_t *group,
                       " called from within tinytest_main.\n");
                abort();
        }
-       if (opt_verbosity>0)
-               printf("[forking] ");
-
        snprintf(buffer, sizeof(buffer), "%s --RUNNING-FORKED %s %s%s",
                 commandname, verbosity_flag, group->prefix, testcase->name);
 
+       if (opt_verbosity>0)
+               printf("[forking: %s] ", buffer);
+
        memset(&si, 0, sizeof(si));
        memset(&info, 0, sizeof(info));
        si.cb = sizeof(si);
@@ -166,8 +166,10 @@ testcase_run_forked_(const struct testgroup_t *group,
                return OK;
        else if (exitcode == MAGIC_EXITCODE)
                return SKIP;
-       else
+       else {
+               printf("Exit code: 0x%08lx\n", exitcode);
                return FAIL;
+        }
 #else
        int outcome_pipe[2];
        pid_t pid;

tortls/context_new: [forking: C:\projects\appveyor\i686-w64-mingw32\src\test\test.exe --RUNNING-FORKED tortls/context_new] Exit code: 0xc0000005

0xc0000005 in Windows means ACCESS_VIOLATION which also means "the process has crashed"

comment:4 Changed 19 months ago by saper

Owner: set to saper
Status: newaccepted

comment:5 Changed 19 months ago by saper

comment:6 Changed 19 months ago by saper

Status: acceptedneeds_review

comment:7 Changed 19 months ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Excellent! I've added a changes file and merged your patch.

Note: See TracTickets for help on using tickets.