Skip to content

ice: panicked at "no such file or directory" #698

@thetayloredman

Description

@thetayloredman

Before we begin...

  • I have updated the Zirco toolchain to the latest version
  • I have searched the issue tracker for duplicates

What was the ICE diagnostic?

error: internal compiler error encountered: thread panicked
note: this is not your fault! this is ALWAYS a compiler bug.
note: compiler bugs threaten the Zirco ecosystem -- we would appreciate a bug report:
note: bug reporting link: https://github.com/zirco-lang/zrc/issues/new?template=ice.yml

note: version: zrc_cli 0.1.0 (commit unknown, release build, macos [aarch64])

note: command line arguments: zrc repro.zr


thread 'main' (7520879) panicked at compiler/zrc_preprocessor/src/lib.rs:375:22:
failed to canonicalize path: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: zrc_preprocessor::preprocess_internal
   4: zrc::compile::compile
   5: zrc::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: end internal compiler error. compilation failed.

What were you doing when the panic occured?

Testing path traversal in the playground

Provide an example of code that causes the panic.

#include "./this-file-does-not-exist.zh"

Other Context

This occurs when handling relative paths in the canonicalize call, but not global include paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-zppRelating to the preprocessor and includesE-good-first-issueCall for participation: Easy issue. Good for newcomers.P-mediumThe bug is noticeable but does not significantly affect most use casesT-ICEInternal Compiler Errors (panics or crashes)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions