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

Removing code while executing in hot code mode may cause Segmentation fault #6669

Open
Anthony-Gaudino opened this issue Oct 23, 2020 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.

Comments

@Anthony-Gaudino
Copy link

V version: 0.1.29 c3626bf.8ffbcdc
OS: linux, Ubuntu 20.04.1 LTS

What did you do?
While running a hot code, if one deletes the [live] it causes a Segmentation fault.

module main

import time
import os

[live] // <- Delete this while running
fn print_message() {
    println('Hello! Modify this message while the program is running.')
}

fn main() {
    for {
        print_message()
        time.sleep_ms(500)
    }
}

Also deleting all lines under the [live] also causes a Segmentation fault.

What did you expect to see?
Execute the program again without hot code reloading and finish execution or display a compilation error.

What did you see instead?

Hello! Modify this message while the program is running.
>       compilation cmd: /home/anthony/Documents/v2/v   -sharedlive -shared -o /home/anthony/.cache/tmp.2.bug ./bug.v
Hello! Modify this message while the program is running.
Hello! Modify this message while the program is running.
compilation took: 777ms
> compile_and_reload_shared_lib compiled: /home/anthony/.cache/tmp.2.bug.so
live mutex locking...
live mutex locked
> load_lib OK, new live_lib: 0x7f1ba80015a0
live mutex unlocking...
live mutex unlocked
Segmentation fault (core dumped)
@Anthony-Gaudino Anthony-Gaudino added the Bug This tag is applied to issues which reports bugs. label Oct 23, 2020
@ArtemkaKun
Copy link
Contributor

Still valid, an actual error message (on the V 0.2.4)

signal 11: segmentation fault
/tmp/v_1000/main.2911200685921105863.tmp.c:7513: at print_backtrace: Backtrace
/tmp/v_1000/main.2911200685921105863.tmp.c:7579: by v_segmentation_fault_handler

@ArtemkaKun ArtemkaKun added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor.
Projects
None yet
Development

No branches or pull requests

2 participants