Function LSParseDateTime() is not thread safe

Description

I just started getting exceptions when I updated my server to the latest Lucee release from v5.1.x to 5.2.4.37. I'm seeing weird exceptions coming through that make no sense at all. For example, the following code occassionally generates the error: For input string: "", which is impossible since the code would never pass the if statement.

After some research, it appears that the java function SimpleDateFormat() is not thread safe. See: https://stackoverflow.com/questions/11368632/multiple-exceptions-thrown-parsing-date-string, and looking at the Lucee source code, LSParseDateTime() calls it.

It also looks like this has been in the Lucee source code since Sep 11, 2015, so this may not be a bug specific to this release.

Environment

Windows Server 2012 R2

Activity

Show:
Michael Offner
June 28, 2018, 7:04 AM

thanks a lot for your input, i did completely miss that.

Michael Offner
June 28, 2018, 7:41 AM
Edited
Eric Stein
August 5, 2019, 8:50 PM

did you ever file an issue for your NumberFormatException error? I think I have the same problem you had..

JP
August 5, 2019, 10:43 PM

No I don’t believe I did.

Eric Stein
August 5, 2019, 11:02 PM

Thanks for confirming I filed - please take a look and see if it makes sense to you.

Fixed

Assignee

Michael Offner

Reporter

JP

Priority

Critical

Labels

Fix versions

Sprint

None

Affects versions