sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: node
Issue: How to use `new tls.TLSSocket(...)` to establish a secure connection?
Labels: tls,doc

### Affected URL(s)

https://nodejs.org/docs/latest-v18.x/api/tls.html

### Description of the problem

What is the correct, non-deprecated way to use the `new tls.TLSSocket(...)` constructor to establish a secure connection? Context: https://github.com/typelevel/fs2/security/advisories/GHSA-2cpx-6pqp-wf35

According to two unmerged docs PRs, when directly calling `new tls.TLSSocket(...)` it is the user's responsibility to validate peer certificates and identity.

In https://github.com/nodejs/node/pull/10846 it says:

> ***Warning***: When directly constructing a `tls.TLSSocket` instead of using
[`tls.connect()`][] it is the caller's responsibility to:
> - manage the lifetime of the the underlying socket, including connecting it;
> - validate the peer certificate and identity, see the [`'secure'`][] event.

> Before using the connection, the user *must* make the following
checks or the connection should be considered completely insecure:
> 
> 1. Verify that the peer certificate is valid, see [`ssl.verifyError()`][].
> 2. Verify that the peer certificate is for the expected host, see
   [`tls.checkServerIdentity()`][] and [`tls.TLSSocket.getPeerCertificate()`][].


In https://github.com/nodejs/node/pull/23915 it says:

> It is important to remember, however,
that it is the caller's responsibility to manage the lifecycle of the provided
`net.Socket`, including establishing the connection and validating peer
certificates and identity. See the [`'secure'`][] event.

And includes an example:
```javascript
tlsSocket.on('secure', function() {
  const err = this.verifyError() ||
    tls.checkServerIdentity(hostname, this.getPeerCertificate());
  if (err)
    this.destroy(err);
});
```

Both PRs demonstrate how to do this validation, but require use of:

1. The `'secure'` event. In the current Node.js documentation, the only mention of `'secure'` is under the deprecated `tls.SecurePair`, and is itself deprecated. It is also not clear that the `'secure'` event is also emitted on `tls.TLSSocket`.
  https://nodejs.org/docs/latest-v18.x/api/tls.html#event-secure
2. `tlsSocket.ssl.verifyError()`, which does not appear at all in the current documentation. Furthermore, according to https://github.com/nodejs/node/pull/840#issuecomment-74343250 `tlsSocket.ssl` is a "legacy property".

Note that the described validation steps appear to be consistent with internal use
https://github.com/nodejs/node/blob/5fbf33ef8641cf57bfbb7f0c87f83447c44266b8/lib/_tls_wrap.js#L1106
https://github.com/nodejs/node/blob/5fbf33ef8641cf57bfbb7f0c87f83447c44266b8/lib/_tls_wrap.js#L1044-L1055

This leaves me with two concerns:
1. The current documentation does not indicate that using `new tls.TLSSocket(...)` by itself does not result in a secure connection.
2. As far as I can tell it is impossible to use `new tls.TLSSocket(...)` to establish a secure connection without relying on APIs that are undocumented, deprecated, and/or legacy.
Repository: youtube-dl
Issue: VRT NU 1080p videos
Labels: account-needed

VRT NU (https://www.vrt.be/vrtnu/) is a supported website by youtube-dl. The site now runs 1080p episodes, which are downloadable through manifest.mpd, but youtube-dl still sees the 540p resolution as the best one and downloads that.
Repository: neovim
Issue: nvim_buf_clear_namespace removes extmarks with end_col = -1 on line before specified range
Labels: bug,api,needs:discussion,marks

### Neovim version (nvim -v)

v0.8.0-dev-nightly-4-ge9b58a619

### Vim (not Nvim) behaves the same?

N/A

### Operating system/version

debian

### Terminal name/version

xterm

### $TERM environment variable

xterm-256color

### Installation

appimage

### How to reproduce the issue

Save the following script as ~/test.lua
```lua
cur_row = cur_row or 1
vim.api.nvim_buf_add_highlight(0, -1, "IncSearch", 0, 0, -1)
function doit()
	-- Clear the highlight of the current row and sets the highlight again.
	-- Ideally it should be a nop as we clear and set back the same highlight
	-- "IncSearch". In effect, we should see one more line highlighted as
	-- "IncSearch" when this script is executed once.
	vim.api.nvim_buf_clear_namespace(0, -1, cur_row - 1, cur_row)
	vim.api.nvim_buf_add_highlight(0, -1, "IncSearch", cur_row - 1, 0, -1)
	cur_row = cur_row + 1
	-- However, with conceallevel set, nvim_buf_add_highlight did not compensate
	-- nvim_buf_clear_namespace and thus we see one new row is highlighted as
	-- "IncSearch" but the previous line got cleared. If the following lines are
	-- commented, there's no such problem.
	local old = vim.wo.conceallevel
	vim.wo.conceallevel = 0
	vim.wo.conceallevel = old
end

doit()
```
$ nvim -u NORC ~/test.lua
:luafile %
:luafile %
:luafile %

### Expected behavior

Expected to see all lines become highlighted after several calls to `luafile %`. 

### Actual behavior

Only one line is highlighted.
Repository: go
Issue: x/crypto/cryptobyte: non allocating AddUint*LengthPrefixed and AddASN1 API
Labels: Proposal,Proposal-Accepted,Proposal-Crypto

The (*Builder).AddUint\*LengthPrefixed allocates on every call a new *Builder.
This allocation cause ~17% of all heap allocations of a crypto/tls tls handshake.

Proposal:

Add new non allocating API Uint*LengthPrefixed:
```
p := NewBuilder(make([]byte,0,512))
p.Uint8LengthPrefixed(func () {
	p.Uint8LengthPrefixed(func () {
		p.AddUint8(42)
	})
	p.AddUint8(11)
})
```
The new methods will not return a *Builder in the func(), as the original API does.
Instedad it will require the usage of the original *Builder.
All writes to the original *Builder, inside Uint\*LengthPrexied methods will
write them accordingly to the LengthPrefixed part in which they were executed.

Implementation example: [commit](https://github.com/mateusz834/crypto/commit/2e92e6f248cc61bd5e0cfbc299d32481e2a30ba6#diff-dfca7344561d167761973708929e128083ce95b21a6b57285f44620c3c35c8c7)

Benchmarks:
```
BenchmarkLengthPrefixed-4            15930202                70.18 ns/op            0 B/op          0 allocs/op
BenchmarkAddLengthPrefixedOld-4          2160042               762.2 ns/op           292 B/op          7 allocs/op
```

```
b := NewBuilder(buf)
b.Uint8LengthPrefixed(func() {
	b.AddBytes([]byte("123456"))
})
b.Uint8LengthPrefixed(func() {
	b.AddBytes([]byte("abcdef"))
})
b.Uint8LengthPrefixed(func() {
        b.AddBytes([]byte("qwerty"))
})
```
Repository: pytorch
Issue: RuntimeError: "reflection_pad2d" not implemented for 'Half' in autocast enabled region
Labels: triaged,module: amp (automated mixed precision)

### 🐛 Describe the bug

I'm trying to convert a model to jit fp16  as described here https://pytorch.org/docs/stable/amp.html#torch.autocast

```
    image = torch.rand(1, 3, 120, 120, dtype=torch.float16)
    mask = torch.rand(1, 1, 120, 120, dtype=torch.float16)

    torch._C._jit_set_autocast_mode(False)

    with torch.cpu.amp.autocast(cache_enabled=False):
        traced_model = torch.jit.trace(jit_model_wrapper, (image, mask), strict=False).to(device)
```

and i get this error 
  File "/home/venv/lib/python3.8/site-packages/torch/nn/modules/padding.py", line 174, in forward
    return F.pad(input, self.padding, 'reflect')
RuntimeError: "reflection_pad2d" not implemented for 'Half'

### Versions

torch==1.12.0

cc @mcarilli @ptrblck
Repository: ant-design
Issue: Custom Object Structure for TreeSelect Value State
Labels: Inactive

### What problem does this feature solve?

The current implementation only allows the value state for the TreeSelect to be of type string or string[]. In some cases you want to have more information for each selected value. For instance: When building a search UI you might want to add a different search type to each selected value like "and", "or", "not" in order to indicate how the values are going to be used. In that case it would be nice to have the option to store objects in that state like {value: "testValue", type: "and"}

This is different from the fieldNames property since fieldNames only tells the TreeSelect the name of the properties for the TreeNodes not for the state of the currently selected values

So I need the state to look line this:
{
value: [{value: "selectedValue1", type: "and"}, {value: "selectedValue2", type: "or"}, ...]
}

not like this:

{
value: ["selectedValue1", "selectedValue]
}


### What does the proposed API look like?

Well there should by a possibility to tell the component which property of the value state object is going to be the label value  within the value state where the selected values are stored NOT the fieldNames of the Treenodes. So it is similar to the fieldNames Property but not for the Nodes of the tree. It should work for the selected values instead

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: terminal
Issue: Add a means by which UIA clients can determine whether a build of Windows Terminal does or doesn't support notifications
Labels: Area-TerminalControl,Area-Accessibility,Product-Terminal,Issue-Task

<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement.
2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement.
3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number).
4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement.
5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement.

All good? Then proceed!
-->

# Description of the new feature/enhancement
#12358 adds support for UIA notifications, allowing screen readers and other UIA clients to easily determine exactly what new text to report without doing any of the heavy lifting themselves (diffing, etc..). However, as not all terminals support notifications, UIA clients need a way to determine when this support is available and when they should fall back to performing diffing themseles. (if clients diff even when notifications are available, we risk doing extra work and/or double-reporting incoming text).
<!-- 
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
-->

# Proposed technical implementation details (optional)
* In #12358 and over email at various times, we discussed using a different class name (TermCtrl2) for situations when notifications are available. NVDA supports this new ID today, but there were concerns from JAWS.
* We also discussed sending an "API version" of sorts through a custom property. This is necessary since wt and conhost versions aren't necessarily tied to particular Windows releases/aren't reliable for feature detection.
Repository: PowerToys
Issue: open a new windows outside of another window that it is always on top
Labels: Idea-New PowerToy,Product-Window Manager,Needs-Triage

### Description of the new feature / enhancement

smarter windows manager
opens new window on free space on screen

### Scenario when this would be used?

Hi
I pinned a small windows on top of all apps.
when I open a new window(explorer, task manager,....), it opens behind of pinned window.

### Supporting information

_No response_
Repository: vscode
Issue: Throwing exceptions across extension host RPC boundaries doesn't preserve Error.name
Labels: extension-host,under-discussion

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: No

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.69.2
- OS Version: macOS 12.4 arm64

Steps to Reproduce:

1. Clone https://github.com/AddieCohen/auth-provider-error 
2. `npm install` & run the extension.
3. Run the command "Login with Azure DevOps"
4. Check the debug console, the error name property is "Error" instead of `LoginTimeOutError`.

The line in: https://github.com/microsoft/vscode/blob/2980862817f29911a2231f4c88bfc783bd763cab/src/vs/workbench/services/extensions/common/rpcProtocol.ts#L428 doesn't seem to work to preserve the exception name.
Repository: pytorch
Issue: iOS TestApp from mobile performance recipes tutorial doesn't build on macOS
Labels: oncall: mobile,module: ios

### 📚 The doc issue

I'm trying the following tutorial: https://pytorch.org/tutorials/recipes/mobile_perf.html#android-benchmarking-setup

The model preparation part works fine. When I'm trying to build TestApp in Xcode, I get 11 `Target Integrity` errors, yielding i.e.
`/Users/derrkater/repo/pytorch/ios/TestApp/TestApp.xcodeproj Building for iOS Simulator, but the linked library 'libcpuinfo.a' was built for macOS.`

My environment is:
Macbook 12", MacOS Monerey 12.4
Python 3.9.12
Xcode 13.4.1
iPhone 13 Pro simulator
commit: ea6fa8dc95

Possibly importantly, I have modified `build_ios.sh` script with a following line: `CMAKE_ARGS+=("-DCMAKE_IOS_SDK_ROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk")`

How can I proceed to build the test app correctly?

### Suggest a potential alternative/fix

_No response_
Repository: pytorch
Issue: backward not available for index and mask 
Labels: needs reproduction,module: autograd,triaged,module: sorting and selection

### 🐛 Describe the bug

When use index or mask for tensor indices, the forward can run normally, but the backward is not available. After change it to _index_select_ or _masked_select_, the backward can run normally. If there any bug for index graph?

```
## pred（float）: B x M x D, mask(bool): B x M, xs_layer(float): B x M

# not work:
pred_layer_reshape = pred.reshape(-1,D)[mask.reshape(-1)]
gt_box3d = gt.reshape(-1, D)[mask.reshape(-1)]
# work:
pred_layer_reshape = torch.index_select(pred.reshape(-1, D), 0, mask.reshape(-1).nonzero().squeeze())
gt_box3d = torch.index_select(gt.reshape(-1, D), 0, mask.reshape(-1).nonzero().squeeze())

# not work:
xs_layer_reshape = xs_layer.reshape(-1)[mask.reshape(-1)].unsqueeze(-1)
ys_layer_reshape = ys_layer.reshape(-1)[mask.reshape(-1)].unsqueeze(-1)
# work:
xs_layer_reshape = torch.masked_select(xs_layer.reshape(-1), mask.reshape(-1)).unsqueeze(-1)
ys_layer_reshape = torch.masked_select(ys_layer.reshape(-1), mask.reshape(-1)).unsqueeze(-1)

```
RuntimeError: merge_sort: failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered

```

### Versions

torch                     1.8.2+cu111

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7
Repository: godot
Issue: Godot crashes when re-importing Sprite3D texture with filter disabled
Labels: bug,topic:import,crash

### Godot version

3.4.4 (downloaded from the official website)

### System information

Windows 11, GLES3, x86_64

### Issue description

After dragging and dropping a texture into the texture slot of a Sprite3D, the compression automatically changes from Lossless to VRAM. However, going into the import settings and disabling filter for said texture and re-importing causes Godot to hang and close. After re-opening the project, the filter is disabled and everything is fine.

What doesn't work:
- Disabling Etc2 compression in Project Settings. I thought it was quite similar to #51930, so I disabled Etc2 and tried the same thing, but the bug still appears.

What does work:
- Changing the compression mode to VRAM and disabling filter on the texture without dragging it into a Sprite3D texture slot.

Some other points of note:
- If you disable the filter on the texture before dragging it into the Sprite3D texture slot, the filter is re-enabled.
- If this is done for multiple textures (i.e. create multiple Sprite3Ds, drag a texture into each one, shift-click on all textures, disable their filter and click re-import), the re-import loading bar stops just before the last texture is re-imported before Godot closes. i.e. When this is done for 2 textures, the loading bar stops at 50% before closing. For 6 textures, it stops at 83%, or 5/6 of 100%. When this is done for 1 texture, it stops at 0%.
- If the filter is enabled and then disabled again, the bug doesn't re-appear.

### Steps to reproduce

Using MRP:
1. Open Import settings for icon.png, untick Filter, and click Re-import
The editor should hang for a while before closing

From scratch:
1. Open up a new project
2. Create a Sprite3D, drag and drop icon.png into the texture slot, and save the scene
3. Go to Import settings for icon.png, untick Filter, and click Re-import
The editor should hang for a while before closing

### Minimal reproduction project

[VRAM import disable filter.zip](https://github.com/godotengine/godot/files/9189732/VRAM.import.disable.filter.zip)
Repository: godot
Issue: Backport support for F17-F35 keys to 3.x
Labels: enhancement,topic:input

### Godot version

v3.4.4.stable.official [419e713a2]

### System information

Windows 10, GLES3

### Issue description

In Editor Settings when trying to add shortcuts, you cannot add Function buttons above F16. So only working is F1-F16 and F17-F24 is called "Unknown". When setting any of these non working buttons, they share the same "identity" so every unknown button then works as shortcut for the set shortcut.

### Steps to reproduce

Go to Editor > Editor Settings > Shortcuts and choose a shortcut. Edit the binding and press any key from F17 to F24. You will see 
```
Please Confirm...
Unknown
```
(First Bug)
Press OK and exit the Editor Settings. Now try that shortcut with the key you set it: it should work. But then press a differen unknown button (F17 - F24) and the shortcut should be triggered as well. (Second Bug)

### Minimal reproduction project

Just create a new project, nothing more.
Repository: godot
Issue: ResourceInteractiveLoader in Thread produces 100 lines of error log spam
Labels: bug,topic:core

### Godot version

v3.4.4.stable.official [419e713a2]

### System information

Arch Linux 5.18.13, nVidia 3080 Mobile, OpenGL ES 3.2 NVIDIA 515.57

### Issue description

`ResourceInteractiveLoader.poll()` produces error logs when called in a `Thread`.

![ril-errors](https://user-images.githubusercontent.com/500820/181020316-c1b7ee76-0825-4b48-b3d7-178e66d89762.png)
(symptomatic [error](https://github.com/godotengine/godot/blob/419e713a29f20bd3351a54d1e6c4c5af7ef4b253/core/rid.h#L140))

Everything looks to be loaded just fine though. It looks very much like a bug to me unless there's something wrong with the following utility. However, if that's the case please let me know what / how to fix it.

```gdscript
extends Reference
class_name ResourceAsyncLoader

# main thread only
var _path : String
var _resource : Resource = null
var _progress : float = 0.0
var _thread : Thread = Thread.new()
# shared
var _mutex : Mutex = Mutex.new()
var _shared_result : int = OK
var _shared_progress : float = 0.0


func _init(path : String) -> void:
	assert(path != null) # and ResourceLoader.exits(path))
	self._path = path
	

func get_progress() -> float:
	return self._progress


func get_resource() -> Resource:
	return self._resource


func poll() -> int:
	var result : int

	if self._resource != null:
		result = ERR_FILE_EOF
	elif not self._thread.is_active():
		#print("START THREAD")
		result = self._thread.start(self, "_thread_run", ResourceLoader.load_interactive(self._path))
	else:
		self._lock("poll")
		result = _shared_result
		self._progress = self._shared_progress
		self._unlock("poll")

	#print("Progress: %s" % [self._progress])

	if result != OK and self._thread.is_active():
		self._progress = 1.0
		self._resource = self._thread.wait_to_finish()
	
	return result


func _thread_run(loader : ResourceInteractiveLoader) -> Resource:
	#print("THREAD STARTED")
	var run : bool = true
	while run:
		var result : int = loader.poll()
		var progress : float = (1.0 + loader.get_stage()) / float(loader.get_stage_count())
		self._lock("_thread_run")
		self._shared_result = result
		self._shared_progress = progress
		#print("Stage: %s / %s" % [loader.get_stage(), loader.get_stage_count()])
		self._unlock("_thread_run")
		if result != OK:
			#print("THREAD is FINISHED!!!")
			return loader.get_resource()
	return null
	

func _lock(_caller : String) -> void:
	#print("LOCK: " + _caller)
	self._mutex.lock()


func _unlock(_caller : String) -> void:
	self._mutex.unlock()
	#print("UNLOCK: " + _caller)
```

### Steps to reproduce

Easiest is with the attached, minimal project:

1. Open the project
2. Press Play / F5
3. Observe Errors Tab inside the Debugger Panel

But my guess is any call to `ResourceInteractiveLoader.poll()` on a GDscript `Thread` in a loop causes this?

### Minimal reproduction project

[ril-async-bug.zip](https://github.com/godotengine/godot/files/9190245/ril-async-bug.zip)
Repository: pytorch
Issue: [feature request] DataLoader to accept num_threads argument to auto-set number of threads for OpenMP / intra-op parallelism
Labels: module: dataloader,triaged,module: openmp

### 🚀 The feature, motivation and pitch

In the typical single-node multi-gpu DDP + multi-threaded DataLoader + intra-op OpenMP parallelism, there might be CPU thread oversubscription leading to slower perf compared to no intra-op parallelism.

Probably a better choice would be to support a helper argument for DataLoader that would call torch.set_num_threads at thread init. Currently this is possible via custom worker_init_fn, but having it as constructor argument would be simpler and bring more visibility.

Currently there is a debatable workaround: DDP sets OMP_NUM_THREADS=1 by default: https://github.com/pytorch/pytorch/blob/master/torch/distributed/run.py#L653 assuming CPU intra-op parallelism almost doesn't happen at all (and not only in DataLoader) - this is rather strange and can be unexpected



### Alternatives

_No response_

### Additional context

_No response_

cc @SsnL @VitalyFedyunin @ejguan @NivekT