sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: node
Issue: Async_hooks use case
Labels: doc,async_hooks

### Affected URL(s)

https://nodejs.org/api/async_hooks.html#async-hooks

### Description of the problem

I need to track state for async contexts that I do not control. 

Specifically, I am tracking the 'stack' through `setTimeout`. 

I have overridden `setTimeout` to be (simplified):

```typescript
const handler = {
    apply(target: Function, self: unknown, args: unknown[]) {
      const [func, ...rest] = args

      const st = getStackTrace()
      var wrapper = function(...args: unknown[]) {
        getCallStack().unshift(st)
        func.apply(this, ...args)
        getCallStack().pop()
      }

      return Reflect.apply(target, self, [wrapper, ...rest])
    }
  }
setTimeout = new Proxy(setTimeout, handler)
```

and getCallStack is (simplified)
```typescript
import { createHook, executionAsyncId } from "async_hooks"
const callStacks: Map<number, string[]> = new Map()

function init() {
  const id = executionAsyncId()
  callStacks.set(0, [])

  function onThreadInit(id: number, {}, triggerId: number, {}) {
    const parentStack = callStacks.get(triggerId)
    if(!parentStack) {
      callStacks.set(id, [])
    } else {
      callStacks.set(id, [...parentStack])
    }
  }

  const hook = createHook({init: onThreadInit)
  hook.enable()
}
init()

export function getCallStack() {
  const id = executionAsyncId()
  return callStacks.get(id)
}
```
and getStackTrace uses Error to get a stacktrace. 

Within several calls deep within the setTimeout-d function, further instrumentation can access `getCallStack()` to trace where the function was called from.

I do something similar with EventEmitters -- I want to know where an event was registered

The use-case for this is an instrumentation library -- I do not control any of the code other than the specific functions that I overwrite. Thus AsyncLocalStorage, which (as far as I can tell?) requires modifying the async calls, doesn't work for this use-case. Also, threads need to be able to access/get a copy of their parent's storage, which doesn't seem possible with AsyncLocalStorage either?

It is entirely possible I am missing something obvious, but so far async_hooks seems like the only way to do this.
Repository: flutter
Issue: ☂️ [web] Ship a lighter CanvasKit variant to more browsers
Labels: a: size,platform-web,perf: app size,e: web_canvaskit,P2,team-web,triaged-web

Some browsers have more features and APIs than others. There are certain features that CanvasKit implements on its own in order to work on _all_ browsers. But when a browser already provides a feature, it's a waste to ship the same feature in CanvasKit.

We are working on shipping a lighter of CanvasKit that takes more advantage browser APIs such as:

1. **Text line breaks**: Chromium supports this through the [`v8BreakIterator`](https://code.google.com/archive/p/v8-i18n/wikis/BreakIterator.wiki) API. There was [an attempt](https://github.com/tc39/proposal-intl-segmenter-v2) to bring support to other browsers but it has stalled.

2. **Text boundaries for words and graphemes**: All browsers support this through the [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) API except for Firefox.

3. **Text BiDi regions**: No browser supports this, so we had to build an [ICU4X module](https://github.com/mdebbar/icu4x_bidi) to provide this information.

4. **Image decoding**: Available in Chromium through the [`ImageDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder) API.

<hr>

As of today, here is the browser support matrix for the above APIs:

![image](https://user-images.githubusercontent.com/1278212/229163502-c3a7564d-9b7c-4438-a9dc-88765684b47d.png)

Firefox doesn't provide any of the APIs, so it will always need the full variant of CanvasKit. That said, we might be able to reduce the ICU size by integrating [ICU4X](https://github.com/unicode-org/icu4x/) or [libgrapheme](https://libs.suckless.org/libgrapheme/) with Skia.

Other browsers (e.g. Safari) can benefit from a 3rd variant of CanvasKit that contains partial ICU data (remove word/grapheme data and keep line break data).
Repository: next.js
Issue: [NEXT-646] Can only build project on drive C:/
Labels: bug,linear: next

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

Operating System:
      Platform: win32
      Arch: x64
      Version: Windows 10 Pro
    Binaries:
      Node: 18.12.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 13.1.3-canary.5
      eslint-config-next: 13.1.2
      react: 18.2.0
      react-dom: 18.2.0

### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue

I can not give a link this is specific to the local drive

### To Reproduce

Create a new next.js project on Windows 11 on a drive which is NOT C:/ (like A:/).

`npx create-next-app@latest`

Try to build it

```npm run build```

Now take the same project, copy it to drive C:/ and retry to build it. It does without any problem

### Describe the Bug

The command ```npm run build``` failed.

```
Failed to compile.

Error: EISDIR: illegal operation on a directory, readlink 'A:\john\Issues\Next_js_build\my-app\pages\_app.tsx'
```

### Expected Behavior

The command ```npm run build``` should work on any drive, not only C;/

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_

<sub>[NEXT-646](https://linear.app/vercel/issue/NEXT-646/can-only-build-project-on-drive-c)</sub>
Repository: flutter
Issue: [webview_flutter] Add example file chooser callback to README
Labels: d: api docs,p: webview,package,team-ecosystem,P2,triaged-ecosystem

https://github.com/flutter/plugins/pull/6881 added the ability to get a callback for file `<input>`s. This issue tracks adding sample code to the `webview_flutter_android` readme for implementing the callback using `file_selector_android`, once that package lands.
Repository: node
Issue: Segmentation fault when debugging a worker from vscode
Labels: inspector

### Version

19.0.1 and 19.4.0

### Platform

Linux charlie 6.1.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000 x86_64 GNU/Linux

### Subsystem

_No response_

### What steps will reproduce the bug?

* Run `npm run debug` on [this sample repo](https://github.com/Nautigsam/node-worker-debug-crash)
* Attach to this process with vscode (v1.74.2)
* Continue the execution

### How often does it reproduce? Is there a required condition?

Always.

### What is the expected behavior?

Run the worker code with no error.

### What do you see instead?

A segmentation fault.

### Additional information

This seems linked to the presence of a private class member in the worker. If I comment out the definition of the member, the segmentation fault stops occurring.
Repository: PowerToys
Issue: [Peek] Fix opening special items like Recycling Bin
Labels: Issue-Bug,Priority-2,Product-Peek
Repository: flutter
Issue: [web] Support forced-colors feature
Labels: a: accessibility,platform-web,browser: firefox,browser: edge,P2,customer: castaway,team-web,triaged-web

Support Windows' forced-colors feature in web.

related to: https://github.com/flutter/flutter/issues/75883
Repository: flutter
Issue: [Impeller] Label decoded textures as translucent or opaque
Labels: engine,c: proposal,P2,e: impeller,team-engine,triaged-engine

We should track a `translucent` flag on `impeller::Texture` which only gets set to `false` by the Impeller image decoder if the texture is known to be completely opaque. Knowing this info at command encoding time would allow us to land many small optimizations centered around blending and draw order.

Currently we use Skia to decompress images, and so we'd need to fetch this info from Skia or ask Skia to track this info + expose it over the public API if not available. We can also partially infer this through the absence of an alpha channel on the input image.
Repository: godot
Issue: GPU particles not visible in HarmonyOS export using Android APK
Labels: platform:android,topic:rendering,documentation

### Godot version

4.0 Beta 13

### System information

Window10

### Issue description

![cpu_gpu](https://user-images.githubusercontent.com/52338846/213625344-e6fcfa97-aa94-47d0-845e-56d094cc652e.PNG)
![sdk](https://user-images.githubusercontent.com/52338846/213625357-aa1e0586-8fc5-47cf-b222-37304d3d27cf.PNG)
GPU particles are not valid in Android export.Can only be converted into cpu particles to take effect.
![5b1e54d0e9a1b264af459f1eaade6ac](https://user-images.githubusercontent.com/52338846/213625450-677a514e-2477-47a4-a24c-5b0683afb450.jpg)


### Steps to reproduce

略

### Minimal reproduction project

[new_project.zip](https://github.com/godotengine/godot/files/10463460/new_project.zip)
minimal project
Repository: godot
Issue: OpenXR basic game not working standalone and in the Quest 2 in Godot 4
Labels: bug,topic:rendering,topic:xr

### Godot version

4.0-beta13

### System information

ArchLinux Latest, GTX 1060 6 GB VRAM, 64 GB RAM, i7 6th gen

### Issue description

When I make a basic XR game (using the reference from documentation) that throws that error when I run standalone:

![image](https://user-images.githubusercontent.com/18708610/213629370-880aca4b-c7a2-4b83-9caf-21498b792a8b.png)

And when I run it in Quest 2 the screen gets entirely black with a three-point loading animation.

Meta Quest 2 (developer mode enabled) is not recognized in this version of Godot 4 and I can run over Quest 2 using directly Godot.

### Steps to reproduce

- Download the project made with Godot 4 beta 13
- Press the "play" button
- It must throw a "That version of Vulkan is not supported" error
- Export to Android
- Upload it by using sidequest
- Try the game
- It must show a black screen

### Minimal reproduction project

That is the project I made:

[OpenXRTest.zip](https://github.com/godotengine/godot/files/10463655/OpenXRTest.zip)
Repository: rust
Issue: Improve diagnostics when invariance is the root cause
Labels: A-diagnostics,T-compiler

### Code

```Rust
use std::cell::RefCell;

struct Inner<'i>(&'i ());

struct Outer<'i> {
    inner: RefCell<Inner<'i>>,
}

impl Drop for Outer<'_> {
    fn drop(&mut self) {}
}

struct Holder<'o> {
    outer: &'o Outer<'o>,
}

impl<'o> Holder<'o> {
    /*
    fn new<'i: 'o>(outer: &'o Outer<'i>) -> Self {
        Self {
            outer
        }
    }
    */
    

    fn new(outer: &'o Outer<'o>) -> Self {
        Self { outer }
    }

    fn yep(&self) {}
}

pub fn sadness() {
    let i = ();
    {
        let outer = Outer {
            inner: RefCell::new(Inner(&i)),
        };

        {
            let _ = Holder::new(&outer);
        }
    }
}
```


### Current output

```Shell
error[E0597]: `outer` does not live long enough
  --> src/lib.rs:42:33
   |
42 |             let _ = Holder::new(&outer);
   |                                 ^^^^^^ borrowed value does not live long enough
43 |         }
44 |     }
   |     -
   |     |
   |     `outer` dropped here while still borrowed
   |     borrow might be used here, when `outer` is dropped and runs the `Drop` code for type `Outer`
```


### Desired output

_No response_

### Rationale and extra context

The problem here is really that `Outer<'i>` is invariant over `'i`. `&'o Outer<'i>` cannot be assigned to `&'o Outer<'o>`,, so the compiler requires that `'i == 'o`, but that doesn't hold since `'i` must outlive `'o` (for the `impl Drop for Outer<'i>`).  The error message is super helpful about this if the commented-out version of `new` is used instead (though at definition time, not at time of use), but doesn't explain any of this as-is.

Ideally the error message would not only point out why it thinks the borrow of `outer` must last so long (because of the invariance), but also that the user's options are either to make the type not be invariant, or to make `Holder` have two separate lifetime arguments so that a requirement that `'i == 'o` isn't inferred.

### Other cases

_No response_

### Anything else?

This may also be related to https://github.com/rust-lang/rust/issues/26804.
Repository: neovim
Issue: nvim_parse_cmd cannot parse `:map` correctly
Labels: bug,api,mappings

### Describe the bug

There is no way to parse `:map` with the second argument having multiple spaces with `nvim_parse_cmd`.
More specifically:
`nvim_parse_cmd` treats all spaces as delimiters thus making it impossible to parse commands like `:map` which may have arguments with multiple spaces.

### Steps to reproduce

```vim
nvim --clean
:lua cmd=vim.api.nvim_parse_cmd("map a b  c",{})  --two spaces between b  and c
:lua vim.cmd(cmd)
```

### Expected behavior

Creating a map `a` `b  c`

### Neovim version (nvim -v)

0.8.2

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

no

### Operating system/version

nvim_parse_cmd

### Terminal name/version

alacritty 0.11.0

### $TERM environment variable

alacritty

### Installation

system package manager
Repository: stable-diffusion-webui
Issue: [Bug]: SD freezing PC after I changed model
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Hello,

_Before you read I apologize for the messy presentation and lack of information. I have no background in programming so I have no idea what would be the correct way to define my issue._

I wanted to try out more models and upon switching the checkpoint top-left it was stuck on Loading for a long time.
I've tried restarting the webui.bat since that used to work in the past as it loaded in the model for me in case it took so long, however this time it just froze my PC entirely.
This happened already once however at the time using git pull to update SD helped the issue but that's not an option since I have the latest version and I'd like to use more models in general.

![freeze](https://user-images.githubusercontent.com/123151717/213643340-2b4d4fe1-e81b-4336-8b33-9b45d351ae67.jpg)

Freeze happens shortly after the line "Commit hash: ...." appears.

I've tried removing --medvram as well in case that's what caused the issue but it also didn't work.
One curious thing to note is that when I took the screenshot before my PC froze for some reason instead of 1920x1080 it was 1920x2536 but the space beneath was empty. This could be completely irrelevant, however it only happens when I run the bat and while sd operates normally screenshots are also taken correctly.

If anyone could point me to the right direction with this one that would be appreciated. I have a lot of fun using SD and got no clue on how to fix this.

### Steps to reproduce the problem

1. Go to .... Top left on SD
2. Press .... The checkpoint to load another model
3. ... Wait for 10-20 minutes to fail loading it
4. ... Start crashing when you try to restart webui.bat


### What should have happened?

SD should've started without freezing my PC

### Commit where the problem happens

b165e341e70300f66c8a77b9383041f4147b24a8

### What platforms do you use to access UI ?

Windows

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
only added and removed --mmedvram
```


### Additional information, context and logs

_No response_
Repository: neovim
Issue: `autocmd BufRead * autocmd FileType <buffer> ++once` doesn't work
Labels: bug,documentation

### Describe the bug

The autocmd described in `:help restore-cursor` doesn't work.

### Steps to reproduce

A simple reproducer would be:

```
autocmd BufRead * autocmd FileType <buffer> ++once echo "wurst"
```

### Expected behavior

It should print "wurst" once.

### Neovim version (nvim -v)

0.8.2

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

yes

### Operating system/version

Fedora 37

### Terminal name/version

konsole

### $TERM environment variable

tmux-256color

### Installation

system package manager
Repository: pytorch
Issue: Add rearrange operator to PyTorch natively
Labels: feature,good first issue,triaged,actionable,module: python frontend,module: functorch,matrix multiplication,module: first class dims

### 🚀 The feature, motivation and pitch

Today, the rearrange from einops is very essential to write cleaner code within most transformers architecture and beyond. 

```python
     q = rearrange(query, 'b s (h d) -> (b s) h d', h=h)
     kv = rearrange(kv, 'b s t (h d) -> (b s) t h d', h=h)
```

However, einops comes with some caviats and need to be installed additionally to PyTorch.

I strongly believe PyTorch should provide its own optimised rearrange functional operator.

Best,
T.C

### Alternatives

Stick with einops, but I would prefer not.

### Additional context

_No response_

cc @albanD @zou3519 @Chillee @samdow @kshitij12345 @janeyx99
Repository: opencv
Issue: VideoCapture - Can we use device names instead of numbers?
Labels: feature

### Descripe the feature and motivation

I'm using OpenCV and Python on a Raspberry Pi  to read streams from 3 Cameras using the VideoCapture object. The cameras might be removed and reattached from time to time, thus resulting in different videodevices (/dev/videox) for the same cameras now and then. My code cannot be adjusted everytime, so I cannot be certain which device number to pass to the VideoCapture object.
I usually use Udev rules to create symbolic links to the real devices, however, OpenCV only accepts device numbers and no paths to actual devices.

People usually have to resort to a collection of hacks to get the right device number. I, for example, read the target of my simlink (e.g. /dev/video6) and take the last character (6) as device number.

Is there any strong reason against using device names on linux systems? If no, would that be possible?

### Additional context

_No response_
Repository: rust
Issue: E0521 borrowed data escapes outside of associated function incorrect
Labels: A-lifetimes,A-borrow-checker,T-compiler,C-bug,T-types

Maybe duplicate of: https://github.com/rust-lang/rust/issues/104766

```rust
use std::sync::Arc;

trait ColumnValues<T>{
    fn get_val(&self, row: u32) -> T;
}

impl<T> ColumnValues<T> for std::sync::Arc<dyn ColumnValues<T>> {
    fn get_val(&self, idx: u32) -> T {
        self.as_ref().get_val(idx)
    }
}

#[derive(Clone)]
pub enum ColumnIndex<'a> {
    Multivalued(Arc<dyn ColumnValues<u32> + 'a>),
}
impl<'a> ColumnIndex<'a> {
    pub fn value_row_ids(&self, row_id: u32) -> u32 {
        match self {
            ColumnIndex::Multivalued(multivalued_index) => {
                multivalued_index.get_val(row_id)
            }
        }
    }
}

```

```
error[E0521]: borrowed data escapes outside of associated function
  --> src/lib.rs:21:17
   |
17 | impl<'a> ColumnIndex<'a> {
   |      -- lifetime `'a` defined here
18 |     pub fn value_row_ids(&self, row_id: u32) -> u32 {
   |                          ----- `self` is a reference that is only valid in the associated function body
...
21 |                 multivalued_index.get_val(row_id)
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                 |
   |                 `self` escapes the associated function body here
   |                 argument requires that `'a` must outlive `'static`

For more information about this error, try `rustc --explain E0521`.
error: could not compile `playground` due to previous error
```

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=0391af5c862914b2d31a7aa0ec9103b3

### Solutions
1.`(&**multivalued_index).get_val(row_id)`
2. Remove impl on Arc
3. Remove Lifetime on `ColumnIndex`
Repository: godot
Issue: ENetPacketPeer.Send requires a byte[] but casts it to a Span<byte> internally
Labels: enhancement,discussion,topic:network,topic:dotnet

### Godot version

v4.0.beta13.mono.official [caacade56]

### System information

Win11

### Issue description

When sending packet with a [ENetPacketPeer](https://docs.godotengine.org/en/latest/classes/class_enetpacketpeer.html), the `Send` method in C# requires a `byte[]` as the second argument which requires allocating a temporary array (The array size does not match the size of the data inside which is common when dealing with pooled array).

However, I noticed the generated code simply cast the `byte[]` to a `Span<byte>` and uses to call `Marshaling.ConvertSystemArrayToNativePackedByteArray` (see below)

```csharp
internal static unsafe int godot_icall_3_362(IntPtr method, IntPtr ptr, int arg1, byte[] arg2, int arg3) {
    long ret;
    if (ptr == IntPtr.Zero)
        throw new ArgumentNullException(nameof(ptr));
    long arg1_in = arg1;
    using godot_packed_byte_array arg2_in = Marshaling.ConvertSystemArrayToNativePackedByteArray(arg2);
    long arg3_in = arg3;
    void** call_args = stackalloc void*[3] { &arg1_in, &arg2_in, &arg3_in };
    NativeFuncs.godotsharp_method_bind_ptrcall(method, ptr, call_args, &ret);
    return (int)ret;
}
```

After some investigation, I found [this code](https://github.com/godotengine/godot/blob/f0326297b319fb632ba5a28c7c8528b1800132f4/modules/mono/editor/bindings_generator.cpp#L3677) which is responsible for generating `PackedByteArray` binding in C# but I have no clue how it really works.

Ideally, the method would accept a `ReadOnlySpan<byte>` which would remove the awkard temporary array I have, but I have no idea of easy or even possible a fix is.

I hope this issue is not a duplicates, but I could not find anythind with the terms "span", "byte", "byte array" nor "allocation"

### Steps to reproduce

1. Create a variable of type `ENetPacketPeer`
2. Remark the definition of `Send(channel, data, flags)`

### Minimal reproduction project

N/A
Repository: flutter
Issue: [web][CanvasKit][golden] add golden test for pixelated images on web-canvasKit
Labels: a: tests,framework,engine,platform-web,a: images,c: proposal,e: web_canvaskit,P2,team-web,triaged-web

### Description

`pixelated images on web-canvasKit` bug keeps coming back to `stable` release;
please add a test/golden-test to prevent the issue to re-emerge

**Expected results:** 

when a PR causes aforementioned bug to re-emerge a test fails and prevents it to be merged
(let alone reach `"stable"`)

**Actual results:**

the bug keeps coming back

**Comments:**

please note the comments below
- https://github.com/flutter/flutter/issues/115529#issuecomment-1318401681

> this problem **_keeps coming back_** (or never really went away), maybe needs some attention! 
> [...]
> * [Images are not sharp on desktop apps on external monitor #113366](https://github.com/flutter/flutter/issues/113366)
> * [Images Pixelate Using canvaskit on Some Monitors #89605](https://github.com/flutter/flutter/issues/89605)
> * [[web] [CanvasKit] Images gets pixelated when scaling down #80520](https://github.com/flutter/flutter/issues/80520)
> * [Transform.rotate Degrades Image Quality #79662](https://github.com/flutter/flutter/issues/79662)
> * [[web] Images pixelated on CanvasKit #79846](https://github.com/flutter/flutter/issues/79846)
> * [Anti aliasing is not working for images on Web #79645](https://github.com/flutter/flutter/issues/79645)
> * [Flutter Web with CanvasKit renders images unreadable #60120](https://github.com/flutter/flutter/issues/60120)
> * [[web] CanvasKit bitmap upscale algorithm #58355](https://github.com/flutter/flutter/issues/58355)

- _Originally posted by @exaby73 in https://github.com/flutter/flutter/issues/115529#issuecomment-1398019527_


> Running the gallery app locally on the latest master does not reproduce the issue, but the one hosted on gallry.flutter.dev, still does. @alanwutang11 If this issue is fixed, maybe raising another issue to include the golden files would be more suitable than clubbing it with this issue?