* * *

Author Topic: FPCJVM Bug + Proposed fix (3.0.2rc1)  (Read 2341 times)

derek.john.evans

  • Guest
FPCJVM Bug + Proposed fix (3.0.2rc1)
« on: February 17, 2017, 12:58:03 pm »
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.
« Last Edit: February 17, 2017, 01:05:25 pm by Geepster »

Cyrax

  • Hero Member
  • *****
  • Posts: 544
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #1 on: February 17, 2017, 01:32:39 pm »
Please report your findings in the bugtracker, so they can be fixed in time.

Thaddy

  • Hero Member
  • *****
  • Posts: 4652
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #2 on: February 17, 2017, 03:54:51 pm »
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.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

derek.john.evans

  • Guest
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #3 on: February 17, 2017, 05:52:59 pm »
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.

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

  • Hero Member
  • *****
  • Posts: 4652
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #4 on: February 17, 2017, 06:29:53 pm »
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.

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.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #5 on: February 17, 2017, 06:54:38 pm »
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.

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

  • Guest
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #6 on: February 17, 2017, 07:02:24 pm »
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.

How is that bug report related at all?

As 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.

There 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.
« Last Edit: February 17, 2017, 07:04:26 pm by Geepster »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #7 on: February 17, 2017, 07:09:51 pm »
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.

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.

Quote
As 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.

Quote
There 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?

Quote
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.

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

  • Guest
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #8 on: February 17, 2017, 07:19:29 pm »
Let'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

  • Sr. Member
  • ****
  • Posts: 259
    • Jacmoe's Cyber SoapBox
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #9 on: February 17, 2017, 07:27:45 pm »
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..
more signal - less noise

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 556
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #10 on: February 17, 2017, 07:47:03 pm »
Let'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.

Quote
Thats all i'm willing to contribute.
That is obviously your right.

Thaddy

  • Hero Member
  • *****
  • Posts: 4652
Re: FPCJVM Bug + Proposed fix (3.0.2rc1)
« Reply #11 on: February 17, 2017, 07:50:23 pm »
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.
« Last Edit: February 17, 2017, 07:56:56 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus