sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: godot
Issue: Ambient occlusion not working inside visual shader sampler2D
Labels: discussion,needs testing,topic:shaders


### Tested versions

4.2.1

### System information

Windows 10

### Issue description

Ambient occlusion not working inside visual shader sampler2D through the texture2D samplerPort.

### Steps to reproduce

<img width="999" alt="ao_issue" src="https://github.com/godotengine/godot/assets/70328320/548310df-7a30-4b7f-9527-6825207dff82">
 see picture

### Minimal reproduction project (MRP)

[bug_report_shader.zip](https://github.com/user-attachments/files/15917658/bug_report_shader.zip)
Repository: godot
Issue: LocalVector can crash with very large sizes
Labels: bug,topic:core,needs testing,crash

### Tested versions

master (b75f0485ba15951b87f1d9a2d8dd0fcd55e178e4)

### System information

Ubuntu 20.04 LTS

### Issue description

- Allocating a `LocalVector` with size > 0x80000000, with a non-trivially-constructible type, crashes.
- Allocating a `LocalVector` with size > 0x80000000, with a trivially-constructible type, silently does not crash when indexed despite capacity == 0.

One potential fix is to change the code here:
https://github.com/godotengine/godot/blob/master/core/templates/local_vector.h#L159-L163

From:
``` C++
if (unlikely(p_size > capacity)) {
  capacity = tight ? p_size : nearest_power_of_2_templated(p_size);
  data = (T *)memrealloc(data, capacity * sizeof(T));
  CRASH_COND_MSG(!data, "Out of memory");
}
```
To:
``` C++
if (unlikely(p_size > capacity)) {
  if (tight) {
    capacity = p_size;
  } else {
    // equivalent:
    //   capacity = max(nearest_power_of_2_templated(p_size), p_size)
    // or since this almost always doesn't happen
    //   U nearest = nearest_power_of_2_templated(p_size);
    //   if (unlikely(nearest < p_size)) {                 
    //     capacity = p_size;
    //   } else {
    //     capacity = nearest;
    //   }
    U nearest = nearest_power_of_2_templated(p_size);
    capacity = nearest < p_size ? p_size : nearest;
  }
  data = (T *)memrealloc(data, capacity * sizeof(T));
  CRASH_COND_MSG(!data, "Out of memory");
} 
```

This will need to be done in other functions in `LocalVector`, as well as look over other places that use `nearest_power_of_2_templated` (and similar functions) in case they don't handle zero.

### Steps to reproduce

Add this somewhere that is guaranteed to be executed when launching the app/editor:
``` C++
LocalVector<Callable> vec;
vec.resize(0x80000001);
```

Compile and run:
``` bash
# I added dev_build=yes in hopes of a more detailed stack trace.  It can be removed.
scons -j $(nproc) dev_build=yes target=editor optimize=debug && ./bin/godot.linuxbsd.editor.dev.x86_64
```

Output:
```
================================================================                                                                                                                                             
free(): invalid pointer                                                                               
Aborted (core dumped)
```

Trivially constructible types can result in undefined behavior or crash:
``` C++
LocalVector<int> vec;
vec.resize(0x80000001);
print_line("size", vec.size(), "capacity", vec.get_capacity());
fflush(stdout);

// this usually doesn't crash, though it is undefined
print_line("vec[0]", vec[0]);
fflush(stdout);

// segmentation fault, usually
print_line("this usually crashes, but not this time", vec[0x80000000]);
```

Output
```
size 2147483649 capacity 0
vec[0] -671903936
Segmentation fault (core dumped)
```

### Minimal reproduction project (MRP)

N/A
Repository: godot
Issue: `memalloc` and `memrealloc` return non-nullptr when size is 0
Labels: enhancement,discussion,topic:core

### Tested versions

master (b75f0485ba15951b87f1d9a2d8dd0fcd55e178e4)

### System information

Ubuntu 20.04 LTS

### Issue description

This can be argued as "not a bug" because the standard malloc and realloc also say that behavior is implementation dependent (or undefined since C23)
https://en.cppreference.com/w/c/memory/malloc
https://en.cppreference.com/w/c/memory/realloc

However, a lot of code assumes that since the pointer is non-nullptr then it must be okay to dereference.
I found a few places where it was ambiguous if the size is non-zero, which can result in undefined behavior or crashes later on.

```
local_vector.h (capacity can be 0, see https://github.com/godotengine/godot/issues/93398)
  data = (T *)memrealloc(data, capacity * sizeof(T));

paged_array.h (pages_allocated can be zero if it overflowed.  This overflow potential is true in several other places too)
  page_pool = (T **)memrealloc(page_pool, sizeof(T *) * pages_allocated);

audio_driver_coreaudio.cpp (returned size can be zero)
  AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &prop, 0, nullptr, &size);
  AudioDeviceID *audioDevices = (AudioDeviceID *)memalloc(size);

display_server_windows.cpp (layout_count can be zero, or negative though that's a different issue)
    int layout_count = GetKeyboardLayoutList(0, nullptr);
    HKL *layouts = (HKL *)memalloc(layout_count * sizeof(HKL));

modules/xatlas_unwrap/register_types.cpp (output.vertexCount can be zero)
  *r_vertex = (int *)memalloc(sizeof(int) * output.vertexCount);

display_server_x11.cpp (size can be zero)
  cursor_image->pixels = (XcursorPixel *)memalloc(size);
```

### Steps to reproduce

Add this somewhere that is guaranteed to be executed when launching the app/editor:
``` C++
{
  void* ptr = memalloc(0);
  if (ptr == nullptr) { 
    print_line("memalloc: ptr is nullptr");
  } else { 
    print_line("memalloc: ptr is non-nullptr");
  }
  memfree(ptr);
}

{
  void* ptr = memrealloc(nullptr, 0);
  if (ptr == nullptr) { 
    print_line("memrealloc: ptr is nullptr");
  } else { 
    print_line("memrealloc: ptr is non-nullptr");
  }
  memfree(ptr);
}
```

Compile and run (debug)
``` bash
scons -j $(nproc) target=editor && ./bin/godot.linuxbsd.editor.x86_64
```

Output
```
memalloc: ptr is non-nullptr
memrealloc: ptr is non-nullptr
```

One potential fix is to change the code here:
https://github.com/godotengine/godot/blob/master/core/os/memory.cpp#L68
From:
``` C++
void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
  #ifdef DEBUG_ENABLED
```
To:
``` C++
void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
  if (p_bytes == 0) {
    return nullptr;
  }
  #ifdef DEBUG_ENABLED
```

Then, at minimum, crashes will be easier to track down since nullptr dereferences always crash (well, I have never seen them not crash).  This is preferred over running undefined code for a while and crashing in an unrelated place

### Minimal reproduction project (MRP)

N/A
Repository: rust
Issue: Index out of bounds: the len is 229 but the index is 229
Labels: I-ICE,T-compiler,C-bug

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code
[rustc-ice-2024-06-20T16_31_45-30676.txt](https://github.com/user-attachments/files/15917150/rustc-ice-2024-06-20T16_31_45-30676.txt)

```Rust
<code>
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.80.0-nightly (f67a1acc0 2024-06-01)
binary: rustc
commit-hash: f67a1acc04c7ecbf05751b17592dd8d245b75256
commit-date: 2024-06-01
host: x86_64-pc-windows-msvc
release: 1.80.0-nightly
LLVM version: 18.1.6
```

### Error output

```
<output>
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
<backtrace>
```

</p>
</details>
Repository: PowerToys
Issue: I beg for update, for HID Macros, Auto HotKey, SharpKey aren't able to do what I need, multiple support of keyboards.
Labels: Needs-Triage

### Description of the new feature / enhancement

Detect Multiple Keyboards as I have like Four.



### Scenario when this would be used?

Photoshop Digital Painting, and After Effects Composition

### Supporting information

HID MACROS are the most amazing one at detecting multiple keyboard. but Autohotkeys are awful at detecting it. But the Powertoy Tools is amazing at remapping CTRL, ALT, SHIFT, APPMENU without a problem. 
As you see I'm not using mechanical keyboard, but very cheap Membrane. I had been reading from 2023/2020 for the support, and it will be greatly lovely to have this support.
Right now, I have two keyboards. When I'm using the first keyboard, I'm removing all my POWERTOY KEYBOARD REMAP, and changing them to regular one as they are set by HID MACROS. When I'm using Photoshop keyboard I'm remapping all to different keys, like pageup, page down, insert, delete, home into CTRL, SHIFT, ALT, SPACE, AND ESC. 

I am not seeing any update about this, so I decided to write.
![448759250_462539463175532_6959068414101901911_n](https://github.com/microsoft/PowerToys/assets/164487126/461800bd-4103-422f-80be-ffc8acb45d59)
Repository: deno
Issue: Implement WASI 0.2 support for Deno
Labels: suggestion,runtime

Deno currently offers partial support for WASI through the `wasicap_snapshot_preview1` interface. While this allows running some WASI modules, it lacks compatibility with the latest and evolving WASI 0.2 standard. Implementing full [WASI 0.2](https://github.com/WebAssembly/WASI/blob/main/preview2/README.md) support would significantly enhance Deno's capabilities and unlock exciting possibilities for WebAssembly development and deployment.

### Benefits for Deno Users:

- **Broader Module Compatibility:** Run a wider range of WASI modules designed for modern environments, opening doors to more functionalities and libraries.
- **Enhanced Security:** Leverage stricter security boundaries and capabilities in WASI 0.2 for more secure WASM execution within Deno.
- **Cutting-Edge Development:** Position Deno at the forefront of WebAssembly development, attracting developers and fostering a robust WASI ecosystem.
- **Production-Ready Features:** Enable the execution of WASI modules in server-side and cloud environments that increasingly rely on WASI for secure and performant sandboxes.

### Production Use Cases:

- **Serverless Functions:** Create secure and performant serverless functions with Deno and WASI 0.2, leveraging the benefits of both WebAssembly and Deno's runtime.
- **Edge Computing:** Deploy WASI modules on edge devices for efficient and secure computations, facilitated by Deno's integration with WASI 0.2.
- **Sandboxed Microservices:** Utilize WASI's secure sandbox for running untrusted code, making Deno with WASI 0.2 ideal for building microservices that require secure isolation.

### Call to Action:

Implementing WASI 0.2 support now will:

- Significantly enhance Deno's capabilities for running WebAssembly modules.
- Improve security for WASM execution within Deno.
- Position Deno as a leading platform for WASI development and deployment in various production use cases.

We strongly encourage the Deno team to prioritize the implementation of WASI 0.2 support and unlock its potential benefits for the Deno community.

### Additional Notes:

https://github.com/WebAssembly/WASI/blob/main/preview2/README.md
Repository: angular
Issue: `TestBed.overrideProviders` does not override providers of imported standalone directives
Labels: area: testing

### Which @angular/* package(s) are the source of the bug?

core

### Is this a regression?

No

### Description

If a directive is standalone, and provides something, if it's included _only_ (non-transitively) in the `imports` array of `configureTestingModule`, then `TestBed.overrideProviders` will not override the providers for that directive.

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-avb6ge?file=src%2Fdirective%2Fdirective.spec.ts

### Please provide the exception or error you saw

```true
yarn run v1.22.19
$ jest
 FAIL  src/directive/directive.spec.ts (8.55 s)
  AppComponent
    ✕ should have the right overridden token (56 ms)

  ● AppComponent › should have the right overridden token

    Expected value   undefined
    Received:
      undefined
    
    Message:
      expect(received).toBe(expected) // Object.is equality
    
    Expected: "overridden"
    Received: "not overridden"

    Difference:

    Compared values have no visual difference.Error:

      33 |
      34 |   it('should have the right overridden token', () => {
    > 35 |     expect(directive.service.value).toBe('overridden');
         |                                     ^
      36 |   });
      37 | });
      38 |

      at eval (src/directive/directive.spec.ts:35:37)
      at _ZoneDelegate.invoke (node_modules/zone.js/bundles/zone.umd.js:412:32)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing.umd.js:2164:43)
      at _ZoneDelegate.invoke (node_modules/zone.js/bundles/zone.umd.js:411:38)
      at ZoneImpl.run (node_modules/zone.js/bundles/zone.umd.js:147:47)
      at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing.umd.js:450:38)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        9.119 s
Ran all test suites.
✨  Done in 11.16s.
```


### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI: 18.0.4
Node: 18.20.3
Package Manager: yarn 1.22.19
OS: linux x64

Angular: 18.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.4
@angular-devkit/build-angular   18.0.4
@angular-devkit/core            18.0.4
@angular-devkit/schematics      18.0.4
@angular/cli                    18.0.4
@schematics/angular             18.0.4
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.7
```


### Anything else?

_No response_
Repository: godot
Issue: Duplicating nodes with text is very slow
Labels: bug,topic:editor,needs testing,topic:gui,performance

### Tested versions

Godot 4.2.2 , Godot 4.3 beta2

### System information

Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated Radeon RX 560 Series (Advanced Micro Devices, Inc.; 31.0.14001.45012) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 Threads)

### Issue description

I noticed that duplicating Button type nodes greatly reduces the productivity of the editor, I also checked this with Label, and there were also freezes, perhaps this is due to the text.

I tested it on other types of graphic nodes, and I didn’t notice any slowdown in the editor.

### Steps to reproduce

1. Open a project
2. Duplicate the "Panel" node using Ctrl+D and quickly press it several times to make sure there are no freezes.
3. Also duplicate the Button node with a quick press to see the editor slow down

### Minimal reproduction project (MRP)

[test.zip](https://github.com/user-attachments/files/15917616/test.zip)
Repository: deno
Issue: Improve error message for uninstalled bin commands
Labels: feat

Version: Deno 1.44.4

With `DENO_FUTURE=1` when I run 
```
git clone https://github.com/chalk/chalk.git
cd chalk
deno task test
```
I get this error
```
# deno task test
Task test xo && c8 ava && tsd
xo: command not found
```

Without `DENO_FUTURE=1` everything runs fine. It might be useful to have a better error message here?
Repository: deno
Issue: Problem using AWS CDK with Deno
Labels: bug,node compat

History:

I'm trying to create a Lambda function on AWS using CDK, and I'm using Deno for this purpose. Every other service is working well, but this specific Lambda function is not. The CDK starts but never deploys it; it just freezes. The problem lies in the following line of code:

```javascript
lambda.Code.fromAsset("path/of/code")
``` 

If I change this to use ImageDocker for the Lambda, it works. However, in this case, I need to use this function because I've already built the Lambda code (it's using cargo-lambda for Rust).

I reverted to Node.js, and it worked fine. I tried downgrading and upgrading Deno, clearing the cache, changing the version of CDK, and nothing worked. This is a big CDK project, and everything else is working except for this part.


Snippet of code:

```javascript
const fn = new lambda.Function(queueStack, "lambda-digest", {
  functionName: `my_function`,
  runtime: lambda.Runtime.PROVIDED_AL2,
  code: lambda.Code.fromAsset("path/of/code"),
  handler: "bootstrap",
  timeout: Duration.seconds(60),
  retryAttempts: 2,
  architecture: lambda.Architecture.ARM_64,
  memorySize: 128,
  maxEventAge: Duration.hours(6),
  environment: {
    TIMEOUT: String(60),
    DATE_IDENTIFIER: new Date().toISOString().split("T")[0],
  },
});
``` 

Deno details:

```shell
$ deno --version
deno 1.44.4 (release, aarch64-apple-darwin)
v8 12.6.228.9
typescript 5.4.5
``` 

Deno.json

```json
{
  "imports": {
    "aws-cdk-lib": "npm:aws-cdk-lib@2",
    "path": "jsr:@std/path@0.225.2"
  }
}

```
Repository: go
Issue: x/tools/go/analysis/passes/nilness: nilness tracking across functions
Labels: NeedsInvestigation,Analysis

### Proposal Details

nilness checks currently only seem to apply to the scope of a single function. I.e. it doesn't detect and flag this obvious nil pointer dereference:

```
package main

import (
	"fmt"
)

type Foo struct {
	Bar string
}

func printBar(f *Foo) {
	fmt.Println(f.Bar)
}

func main() {
	printBar(nil)
}
```
It would be beneficial to track nilness issues _across_ function calls in order to flag scenarios such as this.

Maybe nilness isn't the right analyzer for this; basically I want to achieve the same level of safety as .NET's nullable static analyzer, but in go
Repository: next.js
Issue: Nested intercepted routes fail
Labels: bug,Parallel & Intercepting Routes

### Link to the code that reproduces this issue

https://github.com/pedro757/intercepting-bugs

### To Reproduce

I have two reproduction sandboxes, the `main` branch is **Next 14.2.4** based and the branch `v15` is **Next 15 RC** based

First, let's see the behavior with **Next 14.2.4:**
1. Start dev server `npm run dev`
2. Click the button to see the modal
3. Click a row of the table
4. See, nothing happens...

Now compare that to **NEXT 15:**
1. Switch to v15 branch
1. `npm i`
1. Start dev server `npm run dev`
2. Click the button to see the modal
3. Click a row of the table
4. The background route changes but is not intercepted,
5. Click the row again, now it is intercepted

### Current vs. Expected behavior

In Next 14.2.4 it does nothing when using router.push() or <Link> to show a nested intercepted route 

In Next 15 It changes the background route but It doesn't intercept unless you click the row twice.

I believe next.js should be able to nest intercepted routes.

### Provide environment information

For the main branch (next 14.2.4) in the reproduction link:

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Mon May 27 03:37:00 UTC 2024
  Available memory (MB): 15398
  Available CPU cores: 4
Binaries:
  Node: 20.13.1
  npm: 10.8.0
  Yarn: 1.22.22
  pnpm: 9.1.4
Relevant Packages:
  next: 15.0.0-rc.0 // Latest available version is detected (15.0.0-rc.0).
  eslint-config-next: 14.2.4
  react: 19.0.0-rc-e684ca66ab-20240619
  react-dom: 19.0.0-rc-e684ca66ab-20240619
  typescript: 5.5.2
Next.js Config:
  output: N/A

```
For the v15 branch (next 15):

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Mon May 27 03:37:00 UTC 2024
  Available memory (MB): 15398
  Available CPU cores: 4
Binaries:
  Node: 20.13.1
  npm: 10.8.0
  Yarn: 1.22.22
  pnpm: 9.1.4
Relevant Packages:
  next: 15.0.0-rc.0 // Latest available version is detected (15.0.0-rc.0).
  eslint-config-next: 14.2.4
  react: 19.0.0-rc-e684ca66ab-20240619
  react-dom: 19.0.0-rc-e684ca66ab-20240619
  typescript: 5.5.2
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Parallel & Intercepting Routes

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

See the two branches in the reproduction link, main is `next 14.2.4` and the branch named `v15` is `next 15 rc`
Repository: terminal
Issue: `settings.json` gets regenerated after it is deleted while Windows Terminal is running
Labels: Issue-Bug,Area-Settings,Product-Terminal,Priority-3

<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

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
I store most of my configs in git, I link them with [dploy](https://github.com/arecarn/dploy) tool, but, there is a problem with Windows Terminal behavior, on windows 11 windows terminal is set as default terminal application, this means all powershell script that I will run from explorer context menu will spawn windows terminal, the problem with windows terminal started is that to link my `settings.json` config file (for windows terminal) I need to first delete it from `$HOME\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState` folder, but, when windows terminal is running it will almost immediately will write `settings.json` to disk even thought you are not changing any settings at this moment, this breaks `dploy` linking as `settings.json` file is present.

As a workaround l link this config with `New-Item -ItemType SymbolicLink` as it's fast enough to create link before this config is written to disk:
```
Remove-Item -Path $env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
New-Item -ItemType SymbolicLink -Path $env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json -Target $HOME\git\dotfiles_windows\dotfiles\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
```

# Proposed technical implementation details (optional)

<!-- 
A clear and concise description of what you want to happen.
-->