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

Yosys crashes when an error encountered under Windows/Anaconda during file delete #3217

Closed
LispEngineer opened this issue Feb 25, 2022 · 3 comments

Comments

@LispEngineer
Copy link

LispEngineer commented Feb 25, 2022

Thank you kindly for Yosys and sorry for the trouble!

Steps to reproduce the issue

yowasp-yosys -p "read_verilog -sv crash_yosys.sv; proc; opt; write_json teroshdl_yosys_output.json; stat"

crash_yosys.sv:

`timescale 1 ns / 100 ps
module crash_yosys();

// Simulator generated clock & reset
logic  clk;
initial begin
  clk <= 1'b0;
end

always begin
  #10 clk <= ~clk;
end

// Only run the I2C transaction once
always_ff @(posedge clk) begin
  $stop;
end

endmodule

Not sure how to do this with the current git master (not much of a Python user, sorry). Using:
Yosys 0.13+39 (git sha1 9c9366895, ccache clang 11.0.0-2~ubuntu20.04.1 -Os -flto -flto)
Pip3 reports: yowasp-yosys 0.13.post39.dev297

Windows 10, using Anaconda 3, and a virtual environment with Python 3.9.7 and pip-installed Yosys. Also tried with a Python 3.8.12 virtual environment. Executed from PowerShell after conda activate of the appropriate virtual env.

Expected behavior

Normal termination without a crash deep in Python.

Actual behavior

Output:

1. Executing Verilog-2005 frontend: crash_yosys.sv
crash_yosys.sv:0: ERROR: System task `$stop' outside initial block is unsupported.
Traceback (most recent call last):
  File "C:\bin\anaconda3\envs\teroshdl\lib\shutil.py", line 628, in _rmtree_unsafe
    os.rmdir(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\Doug\\AppData\\Local\\Temp\\tmpc4boy9k2yosys'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\bin\anaconda3\envs\teroshdl\lib\tempfile.py", line 801, in onerror
    _os.unlink(path)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\Doug\\AppData\\Local\\Temp\\tmpc4boy9k2yosys'

During handling of the above exception, another exception occurred:

Then the above two things repeat hundreds of times until it finally quits with RecursionError: maximum recursion depth exceeded while calling a Python object and a long backtrace.

Same thing happens with yowasp-yosys --version as well.

@gatecat
Copy link
Member

gatecat commented Feb 26, 2022

Looks like this is the second issue mentioned in YoWASP/yosys#24 (comment)

@whitequark
Copy link
Member

Fixed as YoWASP/yosys#27.

@whitequark
Copy link
Member

Note that the binaries with the fix aren't uploaded yet; they'll be in place in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants