Open github-actions[bot] opened 4 months ago
Error: Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.HashMap.get(Object)" is null
Error: at com.vladsch.flexmark.html.renderer.HeaderIdGenerator.generateId(HeaderIdGenerator.java:124)
Error: at com.vladsch.flexmark.html.renderer.HeaderIdGenerator.getId(HeaderIdGenerator.java:148)
Error: at dotty.tools.scaladoc.tasty.comments.markdown.SectionRenderingExtension$SectionHandler$.render(SectionRenderingExtension.scala:38)
Error: at dotty.tools.scaladoc.tasty.comments.markdown.SectionRenderingExtension$SectionHandler$.render(SectionRenderingExtension.scala:32)
Error: at com.vladsch.flexmark.html.renderer.NodeRenderingHandler.render(NodeRenderingHandler.java:16)
Error: at com.vladsch.flexmark.html.HtmlRenderer$MainNodeRenderer.renderNode(HtmlRenderer.java:779)
Error: at
...
According to the CI build history for pushes on main
, this was broken by https://github.com/lampepfl/dotty/pull/19860
/cc @Linyxus
This needs to be addressed today, as we're moving the repo tomorrow morning and we need the CI to be working at that time. If it's not fixed by 3pm, I will revert the PR.
Reverting #19860 does not fix the issue. Any idea what else could have caused this?
Duplicate of #18344
details in https://github.com/lampepfl/dotty/issues/19524#issuecomment-1910357898
cc @Florian3k
Huh. It's been quite consistent in the past few builds, though.
Yeah, it's a not-too-often flaky failure. But there's a whole bunch of backreferences to the various duplicates
I think it's a race-condition:
if (headerBaseIds.containsKey(baseRefId)) {
int index = headerBaseIds.get(baseRefId);
index++;
headerBaseIds.put(baseRefId, index);
baseRefId += "-" + index;
} else {
headerBaseIds.put(baseRefId, 0);
}
The get is being called concurrently while one of those puts caused the hashmap to rehash its internal table. I'm not sure, though, how we fix that in SectionRenderingExtension.SectionHandler
...
We may put this as a temporary fix in SectionRenderingExtension.scala
:
val id = idGenerator.synchronized:
idGenerator.getId(headerText + ifSuffixStr)
Not sure how much this will affect performance, but I guess it's better than nothing for now.
Yes, let's do that. Can you send a PR?
See https://github.com/lampepfl/dotty/actions/runs/8150374165