GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Concurrency problem with _lastline in LCDSocketPoller · Issue #4 · lcdproc/lcdjava

Concurrency problem with _lastline in LCDSocketPoller #4

New issue
Copy link
New issue
Copy link
Open
Open
Concurrency problem with _lastline in LCDSocketPoller#4
Copy link

Description

@antoneliasson
antoneliasson
opened on Sep 17, 2016
Issue body actions

I've observed crashes like the following:

sep 17 11:08:19 raspberrypi java[537]: Exception in thread "Thread-1" java.lang.NullPointerException
sep 17 11:08:19 raspberrypi java[537]: at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
sep 17 11:08:19 raspberrypi java[537]: at java.util.regex.Matcher.reset(Matcher.java:309)
sep 17 11:08:19 raspberrypi java[537]: at java.util.regex.Matcher.<init>(Matcher.java:229)
sep 17 11:08:19 raspberrypi java[537]: at java.util.regex.Pattern.matcher(Pattern.java:1093)
sep 17 11:08:19 raspberrypi java[537]: at org.boncey.lcdjava.LCDSocketPoller.run(LCDSocketPoller.java:90)
sep 17 11:08:19 raspberrypi java[537]: [main] INFO org.boncey.lcdjava.LCD - Connected

Looking inside LCDSocketPoller, it's clear that access to _lastline is not concurrency correct. A different thread (inside LCD) can call getLastLine, setting it to null, while the LCDSocketPoller thread is reading _lastline inside the run() loop. This can cause it to be equal to null on line 90, even though there is a not-null-check on line 87.

Using org.boncey.lcdjava 0.5.0

Activity

  1. antoneliasson commented on Oct 2, 2016

    @antoneliasson
    antoneliasson
    on Oct 2, 2016
    CollaboratorAuthor
    More actions

    Work on this has started in the dev branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.