source-extractor issueshttps://gitlab.eurecom.fr/asrael/source-extractor/-/issues2019-05-28T09:39:42Zhttps://gitlab.eurecom.fr/asrael/source-extractor/-/issues/2Heap Buffer overflow in2019-05-28T09:39:42ZGhost UserHeap Buffer overflow inHeap overflowHeap overflowhttps://gitlab.eurecom.fr/asrael/source-extractor/-/issues/1File descriptors leak with Wapiti models2019-05-28T15:07:06ZThibault Ehrhartthibault.ehrhart@eurecom.frFile descriptors leak with Wapiti modelsIt looks like the primary/secondary models are being loaded everytime a request is made to `/sourceExtractor/extractNewsML`, except they are never closed and are kept in memory, which leads to the error "Too many files open" after a whil...It looks like the primary/secondary models are being loaded everytime a request is made to `/sourceExtractor/extractNewsML`, except they are never closed and are kept in memory, which leads to the error "Too many files open" after a while, once the OS runs out of file descriptors.
Truncated output of `lsof -a -p <pid>`:
```
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
...
java 29717 semantic 200r REG 8,2 10691781 12598248 /source-extractor/lib/wapiti_models/model_primary_bio
java 29717 semantic 201r REG 8,2 799578 12598252 /source-extractor/lib/wapiti_models/model_secondary_bio
java 29717 semantic 202r REG 8,2 799578 12598252 /source-extractor/lib/wapiti_models/model_secondary_bio
java 29717 semantic 203r REG 8,2 10691781 12598248 /source-extractor/lib/wapiti_models/model_primary_bio
java 29717 semantic 204r REG 8,2 10691781 12598248 /source-extractor/lib/wapiti_models/model_primary_bio
java 29717 semantic 205r REG 8,2 799578 12598252 /source-extractor/lib/wapiti_models/model_secondary_bio
...
```
## How to reproduce
1. Run the source extractor with default configuration.
2. Do a POST request to `/sourceExtractor/extractNewsML`.
3. Inspect open files using `lsof`.
4. Repeat step 2 and 3.
5. Observe that the list of open files is growing.
Please let me know if you need more details.Bertrand GoupilBertrand Goupil