Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread 'main' panicked at runtime/permissions/lib.rs:695:19 #23294

Open
ladauze opened this issue Apr 9, 2024 · 8 comments · May be fixed by #23590
Open

thread 'main' panicked at runtime/permissions/lib.rs:695:19 #23294

ladauze opened this issue Apr 9, 2024 · 8 comments · May be fixed by #23590
Labels
bug Something isn't working cli related to cli/ dir needs info needs further information to be properly triaged

Comments

@ladauze
Copy link

ladauze commented Apr 9, 2024

Platform: linux x86_64
Version: 1.42.1
Args: ["deno", "run", "icallersa.js"]

thread 'main' panicked at runtime/permissions/lib.rs:695:19:
called Result::unwrap() on an Err value: InvalidLabelChar
stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: core::result::unwrap_failed
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
3: core::result::Result<T,E>::unwrap
4: deno_permissions::UnaryPermission<deno_permissions::NetDescriptor>::check_url
5: deno_fetch::op_fetch::v8_fn_ptr
6: Builtins_CallApiCallbackGeneric

@littledivy
Copy link
Member

Please provide a reproducible example

@littledivy littledivy added bug Something isn't working cli related to cli/ dir permissions related to --allow-* flags needs info needs further information to be properly triaged labels Apr 10, 2024
@mmastrac
Copy link
Member

Repro:

08:31 $ target/debug/deno repl
Deno 1.42.1
exit using ctrl+d, ctrl+c, or close()
> Deno.connect({hostname:'foo@bar.com.', port: 1})

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.42.1
Args: ["target/debug/deno", "repl"]

thread 'main' panicked at runtime/permissions/lib.rs:695:19:
called `Result::unwrap()` on an `Err` value: InvalidLabelChar
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@mmastrac mmastrac removed the permissions related to --allow-* flags label Apr 10, 2024
@0f-0b
Copy link
Contributor

0f-0b commented Apr 13, 2024

This bug was introduced in #23084 and makes it impossible to listen on an IPv6 address (Deno.listen({ hostname: "::", port: 0 })) without full net permission.

@yazan-nidal
Copy link

Hi, i will work on fix this bug,
so, what the expected outcome?

@bartlomieju
Copy link
Member

so, what the expected outcome?

  1. Deno is not panicking
  2. We either need to be able to parse domains ending with a dot . or error gracefully

@yazan-nidal
Copy link

yazan-nidal commented Apr 28, 2024

so, what the expected outcome?

  1. Deno is not panicking
  2. We either need to be able to parse domains ending with a dot . or error gracefully

@bartlomieju

I am trying to push code for fix but i don't have permissions for pushing.

remote: Permission to denoland/deno.git denied to yazan-nidal.
fatal: unable to access 'https://github.com/denoland/deno.git/': The requested URL returned error: 403

yazan-nidal added a commit to yazan-nidal/deno that referenced this issue Apr 28, 2024
…acro

This commit addresses issue denoland#23294 by enhancing the error handling and dot handling logic within the fqdn! macro. Specifically, it:
- Handles parsing errors gracefully using pattern matching instead of unwrap().
- Adjusts substring parsing to correctly handle domain names ending with a dot.

This change improves the reliability and robustness of the fqdn! macro, ensuring more accurate parsing of fully qualified domain names.

Fixes: denoland#23294
@yazan-nidal
Copy link

2. or error gracefully
@bartlomieju
@mmastrac

what did u mean with error gracefully?
application should print an error and exit? or print an error and give user another chance to try another time?

@bartlomieju
Copy link
Member

what did u mean with error gracefully?
application should print an error and exit?

Yes, it should print the error and exit. That means you just need to return an Err variant from relevant function call.

yazan-nidal added a commit to yazan-nidal/deno that referenced this issue May 6, 2024
…n! macro

This commit addresses issue (denoland#23294 , denoland#23552) by enhancing the error handling and dot handling logic within the fqdn! macro. Specifically, it:

Handles parsing errors gracefully using pattern matching instead of unwrap().
Adjusts substring parsing to correctly handle domain names ending with a dot.
This change improves the reliability and robustness of the fqdn! macro, ensuring more accurate parsing of fully qualified domain names.

Fixes: denoland#23294 , denoland#23552
yazan-nidal added a commit to yazan-nidal/deno that referenced this issue May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli related to cli/ dir needs info needs further information to be properly triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants