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

As per commit 0b3ffab application core dumps on files update #14

Closed
gcarreno opened this issue Jul 11, 2020 · 7 comments
Closed

As per commit 0b3ffab application core dumps on files update #14

gcarreno opened this issue Jul 11, 2020 · 7 comments

Comments

@gcarreno
Copy link
Collaborator

Hi there,

As per commit 0b3ffab the application core dumps, after about 30 to 40 seconds after you press the Update button.

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Jul 11, 2020

Cannot reproduce. Please give precise and complete list of parameters selected (selection "Data" combo, checked "Cases", "Moving average" checked?, country selected in tree, etc; or post the corona.cfg file )

@gcarreno
Copy link
Collaborator Author

gcarreno commented Jul 11, 2020

Hey @wp-xyz,

First of all please accept my deepest apologies. I've should've done that in the issue posting.

I re-ran the application and it core dumps with or without country selection. I also noted that the message that indicates the files are downloaded flashes right before it core dumps. Well, something flashes before core dump. It's too quick to read and I'm assuming.

Edit
Just checked and files are actually refreshed. So it must be issues with loading data right after download, cuz the app restarts fine after core dump. And I can even select a country. UK in my testing.
Edit

Here's the config file: corona.cfg.zip

I'm on Ubuntu 20.04, 64b and compiled the application with lazbuild 2.0.10 and FPC 3.2.0

Cheers,
Gus

@gcarreno
Copy link
Collaborator Author

Hey @wp-xyz,

With all due respect and if you don't mind, let me tell you what I'm thinking here:

Due to the fact that the core dump is right after the download, I'm guessing that it as to do with the release of the containers of the old data and the creation of the containers with the new data.
OR the clearing of the TTreeView.

Now... What really baffles me is the fact that it's a core dump, very catastrophic, and not an access violation, potentially catastrophic.

If you're using pointers, and I know and you know you shouldn't 😉, I would tend to think that a access violation would be more common.

But with a core dump, the only thing that comes to mind is the application going into an infinite loop? Maybe? Like I said, the core dump instead of an access violation is really throwing me off.

So... if I was chasing this bug my priorities would be: (And this is just me spitballing, don't take me serious)

  • If I'm using lists, find out if the list is owning the items and who is responsible for releasing the items memory.
  • Double check if I don't fall into circular referencing in any way.
  • If I'm using pointers, by a shot gun and aim it at my foot, pull trigger. 😜
  • Make sure all my procedure/function 's params are being passed by value and not by ref (use const AParam:Type).
  • If I have recursion and cannot be avoided, double check exit condition. Just in case, buy shotgun, aim at foot, pull trigger. 😜
  • Make sure TTreeView is not messing with my data containers, like taking ownership of said containers and adding a double call to the destructor of the container. NOR anything attached to any event of the TTreeView.
  • Take a look at data containers for the graphs. This has to be you I've never done graphs before.
  • Make sure there's no rogue TAction being called in the clean up before reading the new data.
  • I know I'm forgetting something, but I've been awake for more than 24h and my brain is melting.

In any case, good luck my friend. A core dump is a bastard bug to chase, sorry!!

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Jul 11, 2020

Reading these new notes I get the impression that the core dump happens immediately after clicking "Update", not 30 to 40 seconds later as you said in the first post. Which statement is correct?

Another question: Is the issue reproducible in the sense that EVERY press of "Update" leads to the core dump?

Does the core dump happen only after the commit that you specify in the first post, or did is happen already with older versions?

@wp-xyz
Copy link
Owner

wp-xyz commented Jul 11, 2020

I am now compiling the program with FPC 3.2.0 for the first time and I am getting a crash in the routine which reads the locations file at line "New(loc)" . loc is a pointer to a simple record containing two integers (plus an optional shortstring). This did not happen with fpc 3.0.4. It occurs only after pressing "Update" - similar to your bug, probably the same (I am on Windows).

wp-xyz added a commit that referenced this issue Jul 12, 2020
…for LocationParams records. Issue #14. Update of data files.
@wp-xyz
Copy link
Owner

wp-xyz commented Jul 12, 2020

Found an issue with memory allocation introduced for reading the US data file. No more crash for me on Win10. Please test on your system.

@gcarreno
Copy link
Collaborator Author

Hey @wp-xyz ,

Reading these new notes I get the impression that the core dump happens immediately after clicking "Update", not 30 to 40
seconds later as you said in the first post. Which statement is correct?

I have a really bad internet connection and I also forgot I had my PascalCoin Miner running, so my times may be a bit longer than usual.

I've git pull the latest version with your new fix and the problem seams to be fixed. Will close issue.

Pointers, bah, always them buggers 😉

Cheers,
Gus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants