palaeoware / trevosim

TREvoSim - The [Tr]ee [Evo]lutionary [Sim]ulator program
GNU General Public License v3.0
4 stars 3 forks source link

Fitness histogram output #29

Closed ms609 closed 4 weeks ago

ms609 commented 2 months ago

The Fitness histogram feature is useful, but its documentation left me with a number of questions.

RussellGarwood commented 1 month ago

I'm dealing with this now - just a note to say that on my system, this can be cancelled with either escape or hitting the stop button on the GUI - it would be good to know if this is not the case on windows!

RussellGarwood commented 1 month ago

With the above commits, I have made the following changes to address this issue:

I think that is everything!

ms609 commented 4 weeks ago

I rebuilt the software this mornining. When I run the Fitness histogram, Trevosim pauses for a couple of seconds (presumably running the calculations), then closes without writing any output files (but after creating the specified output directory).

The updated documentation reads well and is clear to follow.

RussellGarwood commented 4 weeks ago

Oh no! Many apologies. I don't get this on my end - it is definitely the most recent source code, right (as it was crashing a few days ago whilst I was fiddling)?

I will dig into the code and try and figure out what it could be, however, are you able to debug it? Hitting this button, if debugging is installed: image Should catch where it is crashing when you do the run, and if you could let me know what line it is, it would be a great help!

ms609 commented 4 weeks ago

I've pulled commit 84826bdc6e90d25d6f42932028816454f69dccff.

Here's the debug info:

image

RussellGarwood commented 4 weeks ago

Hmm, this is the assembly code - somewhere in the GUI it should also tell you the line of the source code that is causing the issue - is that visible/obvious? I can create a crash here and send you a screenshot if helpful, though we may have a slightly different IDE GUI.

RussellGarwood commented 4 weeks ago

In mine, it is selecting the last line on the bottom right that is in one of the source files: image

ms609 commented 4 weeks ago

I needed to add debug information tools to my Qt installation and build the debug version of the software... Qt is still grumbling about this but hopefully the below gives the information you need?

image image

RussellGarwood commented 4 weeks ago

Thanks for taking the time to do so, much appreciated. This is definitely a start, in that it is happening within the count peaks function itself. I'll next check whether this is a windows wide issue, and if not may come back and ask you to do a fresh rebuild just in case there is something lingering in the build chain that is messing stuff up!

alanspencer commented 4 weeks ago

Its a Windows-wide build issue. Digging into it now...

RussellGarwood commented 4 weeks ago

Thanks! It looks like a memory issue, but why it isn't segfaulting on Linux then is a bit of a mystery to me. Interested in what you find

RussellGarwood commented 4 weeks ago

@ms609 - Alan and I dug around, and turns out Windows limits stack variables to 1mb, whereas Linux to 8mb. The above commit moves the randoms to test onto the heap, and so hopefully should fix the crash for you.

ms609 commented 4 weeks ago

Fab, that's got it working – good job on tracking the issue down!

If it's easy, you might consider making the entry for "how many bits" remember the last value used, to make repeat analyses easier to perform. But this probably makes at best a miniscule improvement to user convenience!

RussellGarwood commented 4 weeks ago

Good news, thaks for checking. Sure I can make the bits value persistent. For your use case, would within session surfice, or would persisting across sessions be of utility?

ms609 commented 4 weeks ago

I think the gain in convenience is obtained within a session; in fact it's probably nice if a new session returns to the default.

RussellGarwood commented 4 weeks ago

Super, cheers - done!