-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Maybe a bug #258
Comments
This definitely looks suspect. As a start, I would rewrite this to use an actual named variable rather than doing funny things with taking addresses of temporaries and then using static_cast.
|
its not,
same problem. |
The segmentation fault in the ifstream constructor along with gdb saying it's malloc_consolidate points to some kind of memory corruption. I don't see anything else obviously wrong with the portion of the program that you've posted. Is if the array Are you able to post the contents of entrada.json? |
of course:
try explain entrada.json. reforcing the error just happen when i call the function pair, if call a IndividuoBinario normal this work fine with 16.17...30 bits.
|
Next I would see if the json lib is actually involved in the error, by first replacing all the direct calls in the constructor with their respective values, and then in a separate test run removing the parse call in openJson, since it looks like everything should work fine with that input file. |
I have not thought about it. Did this and continue, so sorry. Will try continue find this bug. thanks a lot for help, and sorry. |
My english is not so well, but i'll try show what happening.
I'm creating a genetic algorithm and when create a string with 16 or more bits the lib have a bug, will explain better.
First i'm reading like this:
I have a class IndividuoBinario with this constructor:
Working fine, BUT when i make a pair this bug happen:
using printf to find the error (error is Segmentation fault) i found in this line (of method openJSON):
when run:
but more weird its because this happen just when my string (this->cromossomo) is more then 16 chars and just when use pairs, if invoke normal class IndividuoBinario work fine, just using pair this happen and with more then 16 chars.
I used gdb and this happen
I dont know if this is because the lib, but maybe. I'm trying hard to solve this.
The text was updated successfully, but these errors were encountered: