swarm-lab / trackR

trackR - A simple video tracking software for R
https://swarm-lab.github.io/trackR/
GNU General Public License v3.0
30 stars 9 forks source link

R crashes upon executing any function #36

Closed IBlancoA closed 10 months ago

IBlancoA commented 11 months ago

Hello,

R encounters a fatal error and the session is terminated when I try to execute a function from the package in Rstudio (trackR, trackplayer, and trackFixer all give the same result). When I try to execute the same function in R without using Rstudio, a window appears briefly before the session is terminated.

image

System info:

Thanks!

pmme5 commented 11 months ago

Hi, It also happens to me. Do you know why and how to fix it?

Thanks!

sjmgarnier commented 11 months ago

@pmme5 Is it with Windows 11 as well?

pmme5 commented 11 months ago

yes!

sjmgarnier commented 11 months ago

Ok, I'll try to find some time over the weekend to look into it. I don't have access to a Windows 11 machine, so if it's specific to that system, it might take some time to track down the issue.

@IBlancoA @pmme5 Is your R installation all up to date? Also, can you launch and use the Rvision library (just some of the examples would be fine)?

pmme5 commented 11 months ago

Hi, yes, my R installation is up to date. I have the same error when I try to plot an image provided by Rvision or when I try to create a newdesplay window...for example...

sjmgarnier commented 11 months ago

@pmme5 Ok, it might be related to this Rvision issue: https://github.com/swarm-lab/Rvision/issues/93. I could never reproduce this bug here, so I'm not sure what the problem is. I'll try to dig deeper.

pmme5 commented 11 months ago

Ok, thanks!

sjmgarnier commented 11 months ago

@pmme5 Just to make sure, you have the very latest version of RTools installed as well, right?

pmme5 commented 11 months ago

I think so, RTools 4.3

jubelik commented 10 months ago

Hi! I'm working with @IBlancoA and have the same problem as well on Windows 11. R, RStudio and all the packages are installed with the last version. When I lauch trackR() in R, the windows of trackR appears but it shut down half a second after. It make me think of a power/CPU problem, but I checked it while running trackR() and it doesn't reach 100%. My computer is quite new, so I think it has enough power I'm looking at Rvision93 now. Thanks for your help so far.

jubelik commented 10 months ago

Hello @sjmgarnier, any ideas? I tried many many things but trackR keeps crashing. trackR Thanks

sjmgarnier commented 10 months ago

@jubelik It seems to be a problem with Rvision on Windows 11. I don't have a Win 11 machine at my disposal, so it's hard for me to debug at the moment. I've been trying to install Win 11 on a virtual machine, but it's giving me all sorts of headaches to even run the machine in the first place. I'll keep trying.

jubelik commented 10 months ago

Ok, thanks a lot!!

IBlancoA commented 10 months ago

It does seem like there is a problem with Rvision, as its plot() function also makes R crash:

path_to_image <- system.file("sample_img", "balloon1.png", package = "Rvision") my_image <- image(filename = path_to_image) plot(my_image)

sjmgarnier commented 10 months ago

@jubelik @IBlancoA @pmme5 I have good and bad news. The good news is that I have finally managed to install a functioning Windows 11 VM on my Macbook M1. The bad news is that I cannot reproduce the problem; everything seems to be working just fine here. So, if you could all post your full system information, I can start looking for known hardware incompatibilities. Use the System Information app on Windows and post everything under System Summary and under Components > Display. That should cover the basics. Thanks.

jubelik commented 10 months ago

Screenshot 2023-12-07 150958 I hope that's what you need. Thanks a lot.

sjmgarnier commented 10 months ago

@jubelik Thanks. I also need everything that's under the System Summary (just click on System Summary to display it).

jubelik commented 10 months ago

Sorry, read to fast. Screenshot 2023-12-07 151350- Screenshot 2023-12-07 151404-

pmme5 commented 10 months ago

image

pmme5 commented 10 months ago

image

sjmgarnier commented 10 months ago

@jubelik @pmme5 Thanks for the information. You have both very different configurations. The only obvious difference between your configurations and mine is that mine runs on an ARM processor (Apple silicon) while yours are on a more traditional x64 processor. Unfortunately, I don't have access at the moment to an x64 machine with Windows 11 to attempt to reproduce and - ultimately - fix the bug.

sjmgarnier commented 10 months ago

Ok, some progress was made, finally. I set up an x64 VM with Windows 11 on Azure (thanks to Microsoft for the free credits!) and could reproduce the bug there. I don't know how fast I'll be able to find the source of the problem, but at least I have a starting point now.

pmme5 commented 10 months ago

ok, thank you so much! I'll be looking forward to updates!

sjmgarnier commented 10 months ago

I have made progress in identifying the root cause of the issue. However, the solution might be beyond my skills. I have reported it to the OpenCV repo (you can follow the discussion, if any, here: https://github.com/opencv/opencv/issues/24707#issue-2045247196). Let's hope someone can provide an easy fix.

sjmgarnier commented 10 months ago

Well, I ended up finding a fix (more like a workaround really, a real fix will have to be done in OpenCV directly). It's implemented in https://github.com/swarm-lab/ROpenCVLite/commit/85a94ef05c60fc4f7e6184de7340441e4bb92b9a. You should be able to install it from the develop branch of the ROpenCVLite repository as follows:

remotes::install_github("swarm-lab/ROpenCVLite@85a94ef")

You'll then need to reinstall OpenCV and Rvision with:

ROpenCVLite::installOpenCV()
# Answer 'yes' when asked if you would like to reinstall OpenCV

remotes::install_github("swarm-lab/Rvision", force=TRUE)

I will provide a more permanent solution when I release the next version of ROpenCVLite.

IBlancoA commented 10 months ago

It works great for me, thank you very much!

sjmgarnier commented 10 months ago

@IBlancoA Fantastic! It is such a narrow bug with such big consequences. I'm glad the workaround is working.

pmme5 commented 10 months ago

It also works for me, thank you very much!!