Skip to content

[Windows] failed to enable debugging npipe #5356

@thxCode

Description

@thxCode

Description

Steps to reproduce the issue:

  1. Follow sig-windows-tools/Install-Containerd.ps1 to configure ContainerD in Windows Server 2019 (10.0.17763.1817).
  2. Enable debugging in config.toml as below.
[debug]
  address = "\\\\.\\pipe\\containerd-debug"
  level = "info"

Describe the results you received:

containerd: failed to get listener for debug endpoint: listen tcp: address \\.\pipe\containerd-debug: missing port in address

Describe the results you expected:

Support debugging.

What version of containerd are you using:

$ containerd --version
containerd github.com/containerd/containerd v1.4.4 05f951a3781f4f2c1911b05e61c160e9c30eaa8e

Any other relevant information (runC version, CRI configuration, OS/Kernel version, etc.):

The debug listener creation detects by the result of filepath.IsAbs in the following logic.

if filepath.IsAbs(config.Debug.Address) {
if l, err = sys.GetLocalListener(config.Debug.Address, config.Debug.UID, config.Debug.GID); err != nil {
return errors.Wrapf(err, "failed to get listener for debug endpoint")
}
} else {
if l, err = net.Listen("tcp", config.Debug.Address); err != nil {
return errors.Wrapf(err, "failed to get listener for debug endpoint")
}
}
serve(ctx, l, server.ServeDebug)

However, the UNC path in form of \\.\pipe\<xyz> is not an absolute path in the implementation of filepath.IsAbs.

// is it UNC? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
if l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) &&
	!isSlash(path[2]) && path[2] != '.' {
	// ....
}
return 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions