I am doing a school project on AVL tree in C. And the code is presenting the following errors. It compiles nicely but it is terminating with Segmentation fault (core dumped)
.
==210456== Invalid read of size 8
==210456== at 0x1095B5: rotate_left (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10968C: rotate_double_right (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109C6E: treat_shrink_left (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109DBC: remove_leftmost_son (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109E15: actual_remove (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10A098: remove_info (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109FB6: remove_info (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10A31E: main (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== Address 0x18 is not stack'd, malloc'd or (recently) free'd
==210456==
==210456==
==210456== Process terminating with default action of signal 11 (SIGSEGV)
==210456== Access not within mapped region at address 0x18
==210456== at 0x1095B5: rotate_left (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10968C: rotate_double_right (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109C6E: treat_shrink_left (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109DBC: remove_leftmost_son (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109E15: actual_remove (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10A098: remove_info (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x109FB6: remove_info (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== by 0x10A31E: main (in /home/asteria/Documents/MC202/MC202_024/lab05/main)
==210456== If you believe this happened as a result of a stack
==210456== overflow in your program's main thread (unlikely but
==210456== possible), you can try to increase the size of the
==210456== main thread stack using the --main-stacksize= flag.
==210456== The main thread stack size used in this run was 8388608.
I need to make sense out of this, but I am strugling. Can someone help?
Thank u! 🙂
New contributor
Asteria101 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.