FPCJVM Bug + Proposed fix (3.0.2rc1) lazarus / 64-FPC development ---------------------------------------------------------------------- derek.john.evans · 2017-02-17 11:58 I cant reproduce this issue in a small test case, but my FPCJVM project wont compile without the fix below. The error message is: Code: [Select]Compile Project, OS: java, CPU: jvm, Target: cheetah: Exit code 1, Errors: 1, Hints: 1 ideformeditors.pas(70,6) Error: Duplicate identifier "__fpc_virtualclassmethod_pv_t38" ideformeditors.pas(70,6) Hint: Identifier already defined in unit UELEMENTATTRIBUTES at line 50 For 2 months I've been resolving this issue but writing more code. ie: When you add more methods or properties to a class, the problem goes away. But, recently I had to start adding dummy methods/properties. Eventually my library was impossible to compile. EDIT: What happen was, if I got the error in a lower class, after adding a method, the error would move to a higher class. Adding a method there would then move the error somewhere else. It was crazy stuff. Anyway, this morning I looked at the 3.0.2rc1 compiler code, and traced the problem to jvm_wrap_virtual_class_method() in pjvm.pas. I changed line 651: (pjvm.pas) OLD: symtablestack.top.insert(typ); NEW: symtablestack.top.insert(typ, False); My code now compiles without issue. Testing this against: 200+ classes / ~28000 lines of code Im unsure if the trunk provides another fix, since It caused more issues. ---------------------------------------------------------------------- Cyrax · 2017-02-17 12:32 Please report your findings in the bugtracker, so they can be fixed in time. ---------------------------------------------------------------------- Thaddy · 2017-02-17 14:54 since issue 31240 I have had no issues at all with ppcjvm and I use it on a daily basis. I'd recommend using trunk to check if your issues are fixed. ---------------------------------------------------------------------- derek.john.evans · 2017-02-17 16:52 Quote from: Thaddy on February 17, 2017, 03:54:51 pmsince issue 31240 I have had no issues at all with ppcjvm and I use it on a daily basis. I'd recommend using trunk to check if your issues are fixed. Thanks for the revision number. I just tried r31240 and the issue is still there. Fixed with: pjvm.pas line: 648 symtablestack.top.insert(typ, False); ---------------------------------------------------------------------- Thaddy · 2017-02-17 17:29 Quote from: Geepster on February 17, 2017, 05:52:59 pmQuote from: Thaddy on February 17, 2017, 03:54:51 pmsince issue 31240 I have had no issues at all with ppcjvm and I use it on a daily basis. I'd recommend using trunk to check if your issues are fixed. Thanks for the revision number. I just tried r31240 and the issue is still there. Fixed with: pjvm.pas line: 648 symtablestack.top.insert(typ, False); Plz report on the bug tracker with a compilable example... I am not sure that fix is correct, but feel free to suggest it. ---------------------------------------------------------------------- Jonas Maebe · 2017-02-17 17:54 Quote from: Geepster on February 17, 2017, 05:52:59 pmQuote from: Thaddy on February 17, 2017, 03:54:51 pmsince issue 31240 I have had no issues at all with ppcjvm and I use it on a daily basis. I'd recommend using trunk to check if your issues are fixed. Thanks for the revision number. I just tried r31240 and the issue is still there. It was not a revision number, but a bug number: http://bugs.freepascal.org/view.php?id=31240 As others said: please report a bug with code that reproduces the problem (you can mark it private in case you don't want other people to be able to see your code). There is no way for us to know that you have been having this problem for two months. ---------------------------------------------------------------------- derek.john.evans · 2017-02-17 18:02 Quote from: Jonas Maebe on February 17, 2017, 06:54:38 pmIt was not a revision number, but a bug number: http://bugs.freepascal.org/view.php?id=31240 As others said: please report a bug with code that reproduces the problem (you can mark it private in case you don't want other people to be able to see your code). There is no way for us to know that you have been having this problem for two months. How is that bug report related at all? Quote from: Jonas Maebe on February 17, 2017, 06:54:38 pmAs others said: please report a bug with code that reproduces the problem As I said, I cant write a small example. The bug is there. Quote from: Jonas Maebe on February 17, 2017, 06:54:38 pmThere is no way for us to know that you have been having this problem for two months. Ask? or, look at my project list? JavaVCL https://sourceforge.net/p/javavcl/code/HEAD/tree/src/ I really haven't anymore time to spend on this issue. Problem is fixed at this end. ---------------------------------------------------------------------- Jonas Maebe · 2017-02-17 18:09 Quote from: Geepster on February 17, 2017, 07:02:24 pmQuote from: Jonas Maebe on February 17, 2017, 06:54:38 pmIt was not a revision number, but a bug number: http://bugs.freepascal.org/view.php?id=31240 As others said: please report a bug with code that reproduces the problem (you can mark it private in case you don't want other people to be able to see your code). There is no way for us to know that you have been having this problem for two months. How is that bug report related at all? He merely said he hadn't experienced any problems with the JVM compiler since that bug report had been resolved. QuoteQuote from: Jonas Maebe on February 17, 2017, 06:54:38 pmAs others said: please report a bug with code that reproduces the problem As I said, I cant write a small example. There bug is there. Fine, then create a bug report stating that. QuoteQuote from: Jonas Maebe on February 17, 2017, 06:54:38 pmThere is no way for us to know that you have been having this problem for two months. Ask? I don't understand what you mean with this. It seems unlikely that you mean that I should ask regularly on the forum whether anyone has experienced problems with the JVM compiler? Quoteor, look at my project list? JavaVCL https://sourceforge.net/p/javavcl/code/HEAD/tree/src/ I really haven't anymore time to spend on this issue. Problem is fixed at this end. I'm sorry, but this is not the way I can work. It's much less time for you to create a bug report with a) a link to your source files b) the compilation command that should be given c) the output you currently get when compiling than it is for me to look up all of that information. Let's use optimal efficiency by dividing the work into tasks carried out by the people that are best placed to do so. ---------------------------------------------------------------------- derek.john.evans · 2017-02-17 18:19 Quote from: Jonas Maebe on February 17, 2017, 07:09:51 pmLet's use optimal efficiency by dividing the work into tasks carried out by the people that are best placed to do so. You have got to be kidding! I just coded 28000+ lines of code using FPCJVM, gave it away for free, found a bug, found a fix and posted a solution. Thats all i'm willing to contribute. If noone else has the issue then fine. ---------------------------------------------------------------------- jacmoe · 2017-02-17 18:27 Open source development has rules. No one is entitled to anything. The only thing that happens now is that you have to apply your fix locally for evermore. Instead of following procedure and get it applied upstream.. ---------------------------------------------------------------------- Jonas Maebe · 2017-02-17 18:47 Quote from: derek.john.evans on February 17, 2017, 07:19:29 pmQuote from: Jonas Maebe on February 17, 2017, 07:09:51 pmLet's use optimal efficiency by dividing the work into tasks carried out by the people that are best placed to do so. You have got to be kidding! I just coded 28000+ lines of code using FPCJVM, gave it away for free, found a bug, found a fix and posted a solution. I coded many more lines of FPC and gave that away for free too... Your fix is unlikely to be correct and will mostly likely result in other issues down the line. QuoteThats all i'm willing to contribute. That is obviously your right. ---------------------------------------------------------------------- Thaddy · 2017-02-17 18:50 Note that I am prepared to help if I can. I am a user (and I think I posted most ppcjvm bugs.. or things that I interpreted as bugs but were not the case). Jonas is a principle engineer regarding ppcjvm but also a user. We are fully aware that you are trying to make a contribution, but, plz, narrow down the issue and present us with a way to replicate it. It may very well be that your "patch" is correct, but patches are applied if and only if there is proof that there really is an issue and not something else. This is really, really important! I am not even grumpy. Such issues are too important for that. This is really, really important: provide code with which other users can verify the issue(s) you have. And provide it on the bug tracker.