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

exception containing itself as nested exception, causing maven endless loop #1231

Open
Bananeweizen opened this issue Jul 19, 2023 · 7 comments
Labels

Comments

@Bananeweizen
Copy link

I've just raised an issue in Maven: https://issues.apache.org/jira/browse/MNG-7846
It's caused by an exception in JRuby when using the asciidoctor-maven-plugin.

Can one of the developers here say whether that exception is created somewhere in the code of AsciidoctorJ, or is this something to be reported for JRuby (or somewhere completely different even)? I'm trying to get the actual root cause fixed, the exception containing itself. If I'm wrong here, feel free to close.

@abelsromero
Copy link
Member

abelsromero commented Jul 19, 2023

The AsciidoctorCoreException is simply wrapping the exception coming from JRuby, with no manipulation.

Can you provide a reproducer or the repo that's causing the issue? That way we can look further and see what flow inside JRuby is causing it.

@robertpanzer
Copy link
Member

That's weird.
Intuitively I would say that I see such circular references every day when debugging any problem in whatever software.
Or am I totally wrong here?

Also looking at this old question on SO it seems like this is not uncommon:
https://stackoverflow.com/questions/9233638/is-there-any-reason-to-set-an-exceptions-cause-to-itself

We can of cause argue whether it's a bad design or not, but I would say that if this is common in many libraries Maven should be able to handle that.

@abelsromero
Copy link
Member

That's weird.
Intuitively I would say that I see such circular references every day when debugging any problem in whatever software.
Or am I totally wrong here?

Not weird, I had to research too because I had the same idea 😄 It's normal but getCause should return the null if there's such self-reference.
image

Seeing the stacktrace from the JIRA it comes from RubyLoadError which in turn ends up extending this suspicious method https://github.com/jruby/jruby/blob/73d3c1e3b5d0b6f5b774e32c30303a8d2bddb3c6/core/src/main/java/org/jruby/RubyException.java#L411-L413. But I'd like to confirm, hence the reproducer, we had had plenty of JRuby errors and never looped, I'd like to know what is the origin of the error.

@cstamas
Copy link

cstamas commented Jul 20, 2023

Just FTR Maven 3.9.4 (coming soon) have a fix for this issue, while we still think this is "not our bad".
apache/maven@36db1e3

Also reported to JRuby jruby/jruby#7861

@abelsromero
Copy link
Member

Just FTR Maven 3.9.4 (coming soon) have a fix for this issue, while we still think this is "not our bad". apache/maven@36db1e3

Also reported to JRuby jruby/jruby#7861

We are aware, I saw the posts, but I think we can do better than cross-posting. I am personally working on assumptions, not even the versions for asciidoctor-maven-plugin or AsciidoctorJ have been provided, and I haven't been able to cause a similar error on the latest releases.
If a reproducer can be provided, which I assume exists and is likely to be an open-source repo, I can pinpoint the exact repo, branch, and line of code. That will help to move the upstream fix much quicker and reduce guesses.

@Bananeweizen
Copy link
Author

@abelsromero Unfortunately this is in a company project, and it hasn't even build a build on a commit, but rather on uncommitted changes. Since I've only found that looping process several hours later, and investigated it via heap dump, I can't even say what had been done when it was started. I do know that I had played around with enabling hyphenation, and that I had caused an error message by using a non supported language code via <hyphens>en</hyphens> in asciidoctor-maven-plugin attributes (instead of the correct en_us or en_uk), but I have not been able to reproduce that error situation by running several variations of this. I'm sorry, but it seems I cannot provide a reproducer.

@abelsromero
Copy link
Member

abelsromero commented Jul 23, 2023

Thanks, at least that's something, we know now it's PDF with a theme. We found a suspicious method in jRuby. It's a matter of making a path between those 2 points.

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

4 participants