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

Dropper was not dropped in how_to_ontop example #38

Open
apatrushev opened this issue Feb 27, 2019 · 14 comments
Open

Dropper was not dropped in how_to_ontop example #38

apatrushev opened this issue Feb 27, 2019 · 14 comments
Labels

Comments

@apatrushev
Copy link

apatrushev commented Feb 27, 2019

I tried how_to_ontop example and found that dropper is not dropped - no message presented in log:

x86_64 macOS
rustc 1.32.0 (9fda7c223 2019-01-16)
$ cargo clean; cargo run --example how_to_ontop
   Compiling cc v1.0.29
   Compiling libc v0.2.49
   Compiling context v2.1.0 (<...>/context-rs)
    Finished dev [unoptimized + debuginfo] target(s) in 4.05s
     Running `target/debug/examples/how_to_ontop`
Entering context_function...
Everything's set up!
Resuming => Yielding 0 => Got 0
Resuming => Yielding 1 => Got 1
Resuming => Yielding 2 => Got 2
Resuming => Yielding 3 => Got 3
Resuming => Yielding 4 => Got 4
Resuming => Yielding 5 => Got 5
Resuming => Yielding 6 => Got 6
Resuming => Yielding 7 => Got 7
Resuming => Yielding 8 => Got 8
Resuming => Yielding 9 => Got 9
Resuming context with unwind_stack() ontop!
Unwinding stack by panicking!
Recovered from a panic!
Defer stack deallocation by returning to main()!
Deleting stack!
Stack has been deleted!
Finished!

I tried to switch toolchain to an older one, but did not find working till 1.24.0.

@zonyitoo
Copy link
Owner

Well, it seems to be the same problem as #37 .

@apatrushev
Copy link
Author

On stable rust example working until the end without crash, but Dropper is not dropped. I was not sure and decided to create the separate issue.

@zonyitoo
Copy link
Owner

zonyitoo commented Feb 27, 2019

In this example, I uses panic::resume_unwind to trigger a stack unwinding process, which should call all the Drop::drop() as I was expected.

In the other issue, the program crashes when calling to panic::resume_unwind, so there must be something changes in the latest rustc and LLVM's implementation.

@apatrushev
Copy link
Author

Have you an idea about versions of LLVM/rustc which is definitely working?

@zonyitoo
Copy link
Owner

zonyitoo commented Feb 27, 2019

I think those rustc versions in 2017 works.

@apatrushev
Copy link
Author

Nope. There is nothing about dropping Dropper in log.

@zonyitoo
Copy link
Owner

Yes, my fault.
Confirmed not working in:
Linux VM-65-106-debian 4.18.0-1-amd64 #1 SMP Debian 4.18.8-1 (2018-09-18) x86_64 GNU/Linux
rustc 1.24.1 (d3ae9a9e0 2018-02-27)

@apatrushev
Copy link
Author

Probably that means that it is not frontend/rustc problem, but llvm one?

@zonyitoo
Copy link
Owner

I think so.

@zonyitoo
Copy link
Owner

Maybe we have missed some registers that panic::catch_unwind and panic::resume_unwind are relying on.

@apatrushev
Copy link
Author

apatrushev commented Feb 27, 2019

I suppose that at the beginning this example works as expected, so the good idea is to find environment to reproduce working instance and find the difference in generated code.

@zonyitoo

This comment has been minimized.

@zonyitoo
Copy link
Owner

zonyitoo commented Feb 27, 2019

No, sorry. It is not working. I have compiled a wrong piece of code.

@zonyitoo
Copy link
Owner

zonyitoo commented Feb 27, 2019

Older version of cargo is not working with the latest crates-io. Cannot test those versions that are any older than 1.20.0.

@zonyitoo zonyitoo added the bug label Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants