rasmusto / vtr-verilog-to-routing

Automatically exported from code.google.com/p/vtr-verilog-to-routing
0 stars 0 forks source link

abc crashes if genlib library is in a read-only directory and no super is available #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Put genlib library in a read-only directory
2.  Execute "read-library <genlib_library>
3.  Crash.

Please provide any additional information below.

Simple error:  abc_with_bb_support/src/map/mapper/mapperLib.c
line 184:
   pFile = fopen( FileNameGenlib, "w" );
is followed by
   Mio_WriteLibrary( pFile, pLib, 0 );

without any check for pFile == NULL.  pFile == NULL should generate an error 
message and fail gracefully instead of crashing.  Ideally, in the case that the 
super library can't be written, abc should make an attempt to change the super 
library path to the current working directory, or maybe that should be the 
default, as there is no particular reason for the temporary auto-generated 
super library to be in the same location as the original genlib library.

Original issue reported on code.google.com by rtedwar...@gmail.com on 24 Jul 2013 at 3:24