-
Notifications
You must be signed in to change notification settings - Fork 38
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
Segmentation Fault using globale variables #8
Comments
I could reproduce the problem before 7e84d91, but not after. Can you run the program with gdb, and show the backtrace after the program crashes here?
|
I confirm I can reproduce the segfault after 7e84d91. I confirm that replace OUTPUT_A by "outA and large_motor by "lego-ev3-l-motor" in the construtor of the large_motor allow to remove the segfault. my backtrace:
|
Can you please test if 009cdc3 resolves the issue for you? |
Yes and not! *** main menu *** (s)ensors Choice: m *** motor menu *** (1) lego-ev3-l-motor motor on port outA (b)ack Choice: 1 *** lego-ev3-l-motor motor (outA) actions *** (i)nfo |
|
OK, in this case, the problem comes from me! I didn't see this change. I use 3.16.7-ckt21-9-ev3dev-ev3. I don't have the time to update now and check with the new kernel. So It is ok for me. Once gain, thank you! |
I thank you for the last fix about global variable, but it seems is not enough to fix my problems. I continue to get segmentation fault declaring global variable.
To reproduce my problem, you can edit the file ev3dev-lang-demo.cpp, replacing the full main() method by :
The problem can be reproduce with all motors and sensors. It seems be the const like OUTPUT_A which are not yet initialized when we call them, but not sure.
The text was updated successfully, but these errors were encountered: