Skip to content

Cygwin: Cygwin test failures analysis #303

@Blackhex

Description

@Blackhex

Description

As a follow up of #257 investigate the root causes of Cygwin tests failures. Update definition of done of the following issues or create new ones if another unimplemented APIs will be identified based on your findings:

Acceptance Criteria

  • We know answers for the follwing questions:
    • What are the root causes of Cygwin tests failures?
    • What Cygwin tests are failing because of definicencies in what Cygwin POSIX APIs?
  • The definition of done of the issues listed above were updated or new issues requesting implementation of additional APIs were created.

Analysis

  • Cause: Tests are Hanging due to WaitForMultipleObjects (num, wait_objects, FALSE, INFINITE) function call in cygwait.cc line no:79. Until any one of the object is signalled the function will wait. Signals to be ported for deeper analysis of these tests.

    • winsup.api/ltp/pause01
    • winsup.api/checksignal
    • winsup.api/ltp/signal03
  • Cause: In fcntl07, calling do_exec(subprog_path, **tcp, *tcd) returns 1, leading to a switch-case that breaks due to waitpid returning status 2. Internally, waitpid() calls wait4(), which invokes cygwait(waitfor, cw_infinite, cw_cancel | cw_cancel_self), modifying w->status.

    • winsup.api/ltp/fcntl07
    • winsup.api/ltp/fcntl07B
  • Cause: The waitpid call in spawn.cc at line 894 is returning 11, which is stored in the return variable. This value (11) indicates that the process was terminated by a SIGSEGV (segmentation fault), rather than exiting normally.

    • winsup.api/systemcall
  • Cause:The tests fails due to cygserver being unavailable, causing the CreateFileW function in transport_pipes.cc to return an invalid handle value (-1).

    • Winsup.api/semtest
    • Winsup.api/shmtest
    • Winsup.api/msgtest
  • Cause: Siganl is not handled properly in test file.Siganls to be ported for deeper analysis of these tests.

    • Winsup.api/sigchld
  • cause: The condition for permission fails at line no:102 in test file.

    • Winsup.api/ltp/umask03
  • cause:The posix_spawnp call fails with "No such file or directory" because the provided environment is empty and lacks a PATH, preventing it from locating the "sh" executable at test file line no:20.

    • Winsup.api/posix_spawn/spawnp
  • Cause: Missing pthread_wrapper implemenentation at https://github.com/Windows-on-ARM-Experiments/newlib-cygwin/blob/woarm64/winsup/cygwin/create_posix_thread.cc#L103:

  • Cause: The failures occur due to insufficient pointer validation in the Cygwin implementation. When invalid pointers are passed as arguments (e.g., -1, NULL), the functions crash with access violations instead of returning -1 and setting errno as expected for negative test cases.

    • winsup.api/ltp/link04
    • winsup.api/ltp/stat03
    • winsup.api/ltp/symlink01
    • winsup.api/ltp/symlink03
    • winsup.api/ltp/unlink07
    • winsup.api/ltp/stat06
    • winsup.api/ltp/rmdir05
    • winsup.api/ltp/mkdir01
    • winsup.api/ltp/munmap01
    • winsup.api/ltp/munmap02
    • winsup.api/ltp/mmap05
    • winsup.api/ltp/times02
    • winsup.api/ltp/mmaptest02
    • winsup.api/ltp/mmaptest03
    • winsup.api/ltp/rename08
    • winsup.api/ltp/chmod01
    • winsup.api/ltp/chdir04
    • winsup.api/ltp/access01
    • winsup.api/ltp/access03
    • winsup.api/ltp/access05
  • The following tests not working in the Larger pipeline at mingw-woarm64-build repo even after introducing cygwin environment variable.

    • winsup.api/ltp/access01
    • winsup.api/ltp/chmod01
    • winsup.api/ltp/link02
    • winsup.api/ltp/link03
    • winsup.api/ltp/link05
    • winsup.api/ltp/lseek04
    • winsup.api/ltp/lseek10
    • winsup.api/ltp/lstat02
    • winsup.api/ltp/readlink01
    • winsup.api/ltp/readlink02
    • winsup.api/ltp/rename01
    • winsup.api/ltp/select03
    • winsup.api/ltp/stat02
    • winsup.api/ltp/symlink04
    • winsup.api/ltp/symlink05
    • winsup.api/ltp/unlink06
    • winsup.api/ltp/mknod01
    • winsup.api/ltp/dup05
  • Cause: The fork-based child process failed to copy Cygwin internal memory (cygheap) due to an invalid handle (Win32 error 6), leading to a segmentation fault (signal 11) and termination of the child process.

    • winsup.api/posix_spawn/fds
    • winsup.api/posix_spawn/signals
    • winsup.api/posix_spawn/chdir
    • winsup.api/signal-into-win32

n at path.cc line no:715.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions