coin-or / CoinUtils

COIN-OR Utilities
Other
46 stars 42 forks source link

missing newline / end of line at end of `.lp` file gives funny error message #145

Closed dlaehnemann closed 3 years ago

dlaehnemann commented 3 years ago

It seems that a missing newline at the end of an .lp file causes parsing problems and then throws a funny warning:

Welcome to the CBC MILP Solver 
Version: devel 
Build Date: Feb 18 2021 

command line - /path/to/bin/cbc no_eol_at_file_end.lp solve (default strategy 1)
### CoinLpIO::readLp(): Binary variable End5702_35702 does not appear in objective function or constraints
#CoinLpIO scan_next(): End inserted
Line 1 End
### CoinLpIO::readLp(): Binary variable  does not appear in objective function or constraints

It seems to then run forever without any further output, so I am assuming that the parsing does go awry altogether and runs into some endless loop (without grabbing memory, though).

A minimal example is attached, just rename it to the correct file extension .lp: no_eol_at_file_end.txt

dlaehnemann commented 3 years ago

Closed by @jjhforrest via https://github.com/coin-or/CoinUtils/commit/86ab8d39f90f3119ce372ff88c9e62b54dc2cfe9