You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by "subbudvk (via GitHub)" <gi...@apache.org> on 2026/05/05 14:13:59 UTC
[PR] Prevent OOM during Array Allocation (opennlp)
subbudvk opened a new pull request, #1035:
URL: https://github.com/apache/opennlp/pull/1035
## Summary
- `HeadRules` (English) and `AncoraSpanishHeadRules` (Spanish) parsed the
tag count field from head rules files with `Integer.parseInt()` and used
the result directly as an array size with no bounds check. A crafted model
file with a count of `Integer.MAX_VALUE` would trigger an immediate
`OutOfMemoryError` during parser model loading.
- Added a bounds check in `readHeadRules()` in both classes: values outside
`[0, 1000]` throw `IOException` before any allocation.
Since this is constrained by the size of the POS tagset being used this is already a safe margin and a configurable override may not have benefit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OPENNLP-1826 : Prevent OOM during Array Allocation (opennlp)
Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 merged PR #1035:
URL: https://github.com/apache/opennlp/pull/1035
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OPENNLP-1826 : Prevent OOM during Array Allocation (opennlp)
Posted by "subbudvk (via GitHub)" <gi...@apache.org>.
subbudvk commented on PR #1035:
URL: https://github.com/apache/opennlp/pull/1035#issuecomment-4408290100
Yeah will do that
On Thu, 7 May, 2026, 5:22 pm Richard Zowalla, ***@***.***>
wrote:
> *rzo1* left a comment (apache/opennlp#1035)
> <https://github.com/apache/opennlp/pull/1035#issuecomment-4396853010>
>
> @subbudvk <https://github.com/subbudvk> LGTM from my side. Could you
> create a cherry-pick version targeting 2.x too ?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/opennlp/pull/1035#issuecomment-4396853010>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A3SG4T74SAFFEV2MXW5MR534ZR2IPAVCNFSM6AAAAACYRVGCZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DGOJWHA2TGMBRGA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OPENNLP-1826 : Prevent OOM during Array Allocation (opennlp)
Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #1035:
URL: https://github.com/apache/opennlp/pull/1035#issuecomment-4396853010
@subbudvk LGTM from my side. Could you create a cherry-pick version targeting 2.x too ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] OPENNLP-1826 : Prevent OOM during Array Allocation (opennlp)
Posted by "rzo1 (via GitHub)" <gi...@apache.org>.
rzo1 commented on PR #1035:
URL: https://github.com/apache/opennlp/pull/1035#issuecomment-4409054927
> Yeah will do that
> […](#)
> On Thu, 7 May, 2026, 5:22 pm Richard Zowalla, ***@***.***> wrote: *rzo1* left a comment ([apache/opennlp#1035](https://github.com/apache/opennlp/pull/1035)) <[#1035 (comment)](https://github.com/apache/opennlp/pull/1035#issuecomment-4396853010)> @subbudvk <https://github.com/subbudvk> LGTM from my side. Could you create a cherry-pick version targeting 2.x too ? — Reply to this email directly, view it on GitHub <[#1035 (comment)](https://github.com/apache/opennlp/pull/1035#issuecomment-4396853010)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/A3SG4T74SAFFEV2MXW5MR534ZR2IPAVCNFSM6AAAAACYRVGCZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DGOJWHA2TGMBRGA> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgith
ub>. You are receiving this because you were mentioned.Message ID: ***@***.***>
Thanks or the PR. Looking forward for the 2.x PR, thx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@opennlp.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org