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

Segfault from bad cap in code #4496

Closed
SeanTAllen opened this issue Feb 20, 2024 · 0 comments
Closed

Segfault from bad cap in code #4496

SeanTAllen opened this issue Feb 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@SeanTAllen
Copy link
Member

          I stumbled on this while searching for clues on a similar (but unfortunately not identical) error. 

Here's the repro code and backtrace:

trait T
  fun some() =>
    "Do nothing"

class TClass is T
  let _l: String
  new create(l: String) =>
     _l = consume l
  fun some() =>
      "Do nothing"

actor Act
  let _c: T iso
  new create(c: T iso) =>
    _c = consume c

actor Main
  new create(env: Env) =>
    let c: T iso^ = TClass.create("")
    let a: Act = Act.create(consume c)

Fails with

# ponyc
Building builtin -> /usr/local/lib/pony/0.58.1-fe3895eb/packages/builtin
Building . -> /root/proj/scratch/pony/21-segfault
/root/proj/ponyc/src/libponyc/ast/ast.c:577: ast_id: Assertion `ast != NULL` failed.

Backtrace:
  ponyc(ponyint_assert_fail+0x9c) [0x89e49c]
  ponyc(ast_id+0x3b) [0x794a5b]
  ponyc(cap_fetch+0x15) [0x82c845]
  ponyc(expr_assign+0x244) [0x885714]
  ponyc(pass_expr+0x143) [0x7f6b53]
  ponyc(ast_visit+0x2aa) [0x7f78aa]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc(ast_visit+0x1e6) [0x7f77e6]
  ponyc() [0x7f83e6]
  ponyc() [0x7f7d75]
  ponyc(ast_passes_program+0x22) [0x7f7982]
  ponyc(program_load+0xbf) [0x81acef]
  ponyc() [0x793cf9]
  ponyc(main+0x270) [0x793b90]
  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f9cfc771083]
  ponyc(_start+0x2e) [0x79385e]
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Aborted

Using version 0.58.1-fe3895eb from the most recent release tag, running on Ubuntu 20.04 on Intel.

Originally posted by @nisanharamati in #4344 (comment)

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Feb 20, 2024
@SeanTAllen SeanTAllen added the bug Something isn't working label Feb 20, 2024
@SeanTAllen SeanTAllen changed the title I stumbled on this while searching for clues on a similar (but unfortunately not identical) error. Segfault from bad cap in code Feb 20, 2024
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Feb 20, 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
Projects
None yet
Development

No branches or pull requests

2 participants