Skip to content

typecheck segfault on failure to unify #602

New issue

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

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

Already on GitHub? # to your account

Closed
paulstansifer opened this issue Jun 30, 2011 · 2 comments
Closed

typecheck segfault on failure to unify #602

paulstansifer opened this issue Jun 30, 2011 · 2 comments
Labels
A-type-system Area: Type system I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@paulstansifer
Copy link
Contributor

The type error makes this segfault:

use std;
import std::option::*;

fn main() {
  let t[int] x = none;
  x = 5;
}

Looks like stack overflow. The interesting part of the backtrace:
#1019 0x080df952 in middle::ty::fold_ty ()
#1020 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()
#1021 0x0827bc13 in middle::ty::unify::fixup_vars::subst_vars::thunk3323 ()
#1022 0x080e3e7f in middle::ty::fold_ty ()
#1023 0x080df952 in middle::ty::fold_ty ()
#1024 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()
#1025 0x0827bc13 in middle::ty::unify::fixup_vars::subst_vars::thunk3323 ()
#1026 0x080e3e7f in middle::ty::fold_ty ()
#1027 0x080df952 in middle::ty::fold_ty ()
#1028 0x080f985f in middle::ty::unify::fixup_vars::subst_vars ()
#1029 0x0827be33 in middle::ty::unify::fixup_vars::thunk3333 ()
#1030 0x080e3e7f in middle::ty::fold_ty ()
#1031 0x080f9bb7 in middle::ty::unify::fixup_vars ()
#1032 0x08137e5a in middle::typeck::demand::full ()
#1033 0x0814097a in middle::typeck::check_expr ()
#1034 0x08145d44 in middle::typeck::check_expr ()
#1035 0x0813fdca in middle::typeck::check_expr::check_then_else ()
#1036 0x08145e0f in middle::typeck::check_expr ()
#1037 0x081530aa in middle::typeck::check_block ()
#1038 0x08146df7 in middle::typeck::check_expr ()
#1039 0x081530aa in middle::typeck::check_block ()
#1040 0x08146df7 in middle::typeck::check_expr ()
#1041 0x081530aa in middle::typeck::check_block ()
#1042 0x0813f85a in middle::typeck::check_expr::check_for_or_for_each ()
#1043 0x08146170 in middle::typeck::check_expr ()
#1044 0x08152ee7 in middle::typeck::check_block ()
#1045 0x08154ee0 in middle::typeck::check_fn ()
#1046 0x08156bda in middle::typeck::check_item ()
#1047 0x0829730e in middle::typeck::check_crate::thunk5452 ()
#1048 0x080fce01 in middle::walk::walk_item ()

@jdm
Copy link
Contributor

jdm commented Jul 3, 2011

Helpful note from ty.rs?

fn unify_step(&@ctxt cx, &t expected, &t actual) -> result {
    // TODO: occurs check, to make sure we don't loop forever when
    // unifying e.g. 'a and option['a]

@catamorphism
Copy link
Contributor

I'm calling this a duplicate of #229 and the fact that stack overflow is currently a crash.

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Added the sync() function from unistd.h

This fixes rust-lang#601.
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 24, 2022
implement minimal epoll_create1 shim

Implements minimal shim for rust-lang#602
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
implement minimal epoll_create1 shim

Implements minimal shim for rust-lang#602
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this issue Jan 24, 2025
tgross35 pushed a commit to tgross35/rust that referenced this issue Jun 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

3 participants