wakatime / delphi-wakatime

Embarcadero Delphi plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/delphi
BSD 3-Clause "New" or "Revised" License
29 stars 6 forks source link

Access Violation on IDE exit #5

Closed mobius1qwe closed 10 months ago

mobius1qwe commented 1 year ago

Describe the bug When exiting Delphi's IDE an Access Violation happens on rtlxxx.bpl where xxx represent delphi version. I haven't found out yet the source of the issue, apparently wakatime isn't being unloaded properly or maybe the threaded timer isn't finishing before the unload of the IDE.

To Reproduce Steps to reproduce the behavior:

  1. install wakatime
  2. run IDE
  3. Exit IDE

Desktop (please complete the following information):

diegomgarcia commented 11 months ago

I'm suspecting that the memory leaks reported on the issue #6 is causing that. Planing to work on this item at the beginning of the next month.

shaunroselt commented 11 months ago

Just for some added info. I get this also on my Delphi 11.3.

Here are the errors I get when I close my IDE:

RAD Studio 11 Access Violation RAD Studio 11 Access Violation

I also occasionally get an invalid pointer operation error:

RAD Studio 11 Invalid Pointer Operation

diegomgarcia commented 10 months ago

Hey guys,

I've just commited the fix for this issue on the development branch, can you guys test it before I merge with the main?

mobius1qwe commented 10 months ago

Just updated to the newest version of development but the error still happens, do I have to do a full clean install? Even removing the .wakatime stuff?

The rtl280 Access Violations are gone, now there's only one Invalid Pointer Operation that happens when we close the IDE after opening any project

diegomgarcia commented 10 months ago

Hi @mobius1qwe,

You don't need it. Just remove the package from the IDE using the Component -> Install Packages menu, then close delphi IDE. Checkout the new code from the branch development, open the Delphi IDE again, open the package from the repository cloned, compile and install.

This should do the work.

Don't need to mess with the CLI or the conf.

mobius1qwe commented 10 months ago

Yeah I did the regular clean install from delphi, remove the package, update, clean, build, install. But the Invalid Pointer still exist. I'm kinda used to reinstall big component packages everytime for testing purposes so it's not an issue for me.

diegomgarcia commented 10 months ago

Thats strange, I've tested on XE2 and XE3 without problems.

I could imagine that you are usually to that, just want to check if it was the same process because some times if you don't close and reopen the IDE for some reason it get a package from its cache.

Maybe you could just check if there is any other bpl in some other place that could have been loaded by the IDE besides the new version.

Another possible thing that you could try to do is to use madexcept installed on your IDE and setup to get the IDE exceptions, so if it happens on the IDE during the close you could just save the bugreport and post it here.

You should get a bug report like that:

image

shaunroselt commented 10 months ago

Hey @diegomgarcia

Thanks for the fixes.

When will this new version be available on GetIt?

diegomgarcia commented 9 months ago

Hey @shaunroselt, you are welcome =)

I will check with @alanhamlett if we need to ping Embarcadero about it.

mobius1qwe commented 9 months ago

Sorry for late response and writing on a closed issue, but the error persist on FMX project. VCL project the problem doesn't happen.

Should I open a new issue?

diegomgarcia commented 9 months ago

Hi @mobius1qwe, no worries. Please open a new one and if you could attach a bug report with all the details about what IDE you where testing it I will appreciate =)

Thanks for testing it =)

Sorry for late response and writing on a closed issue, but the error persist on FMX project. VCL project the problem doesn't happen.

Should I open a new issue?

shaunroselt commented 9 months ago

Hey @shaunroselt, you are welcome =)

I will check with @alanhamlett if we need to ping Embarcadero about it.

Hey.

I'm just checking in to find out if the new version is available on GetIt yet?

The only one I see on GetIt is v1.0.0 from 6 July 2023:

WakaTime on Delphi GetIt Package Manager

diegomgarcia commented 9 months ago

Hey @shaunroselt, sorry to not ping back you with the details. @alanhamlett had contact embarcadero team and they will update, however we don't have an ETA.

shaunroselt commented 9 months ago

Hey @shaunroselt, sorry to not ping back you with the details. @alanhamlett had contact embarcadero team and they will update, however we don't have an ETA.

It's been almost a month already. Is this something that only Embarcadero can update?

Is there not a portal where developers can update their own packages with newer versions?

Maybe Ian can help: @checkdigits

diegomgarcia commented 9 months ago

They told us that we just have to email them when we have a new version and they'll manually update it.

It would be nice if Ian guide us on that. Maybe we can find a way to automate it with github actions.

What do you think Ian? @checkdigits

checkdigits commented 9 months ago

At the moment the best way to do it is to email your GetIt contact.

You can cc me on that email too if you want and I'll chase it up.

Email is ian.barker@embarcadero.com

diegomgarcia commented 9 months ago

Awesome, @alanhamlett already sent the email, however I will do that again adding you to the cc.

Thanks Ian.

shaunroselt commented 9 months ago

WakaTime in Delphi GetIt Package Manager

I see it's updated. Thanks @checkdigits !