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

readValues(null) causes infinite loop #122

Closed
andyeko opened this issue Feb 15, 2019 · 2 comments
Closed

readValues(null) causes infinite loop #122

andyeko opened this issue Feb 15, 2019 · 2 comments
Labels
Milestone

Comments

@andyeko
Copy link

andyeko commented Feb 15, 2019

@Test
public void testEmptyStream() throws InterruptedException {
    log.info("Start");
    SimpleModule module = new SimpleModule();
    CsvMapper csvMapper = new CsvMapper();
    csvMapper.registerModule(module);
    try {
        InputStreamReader reader = null;
        CsvSchema columns = CsvSchema.emptySchema().withHeader().withColumnSeparator(';');
        csvMapper.readerFor(Map.class).with(columns).readValues(reader);
    } catch (IOException e) {
        log.warn("Can't read data from csv file {}", e);
    }
    log.info("finish");
}

provided code can freeze execution of the thread completely
tested with: 2.9.8 version

@cowtowncoder
Copy link
Member

Interesting. Let me see if I can reproduce.

@cowtowncoder
Copy link
Member

Yes, seems to get into infinite loop somewhere. Will need to check out stack trace for more info.

@cowtowncoder cowtowncoder added this to the 2.9.9 milestone Feb 19, 2019
@cowtowncoder cowtowncoder changed the title readValue(null) cause thread to freeze and consume a lot of resources readValues(null) causes infinite loop Feb 19, 2019
pjankovsky pushed a commit to fivetran/jackson-dataformats-text that referenced this issue Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants