jeudi 15 novembre 2018

Unexplainable malloc.c:2401: sysmalloc: Assertion Error

I challenge you to find what the heck is causing my program to break, I've been trying to find a reasoning behind this but I haven't been able to find even the slightest bit.

My program is supposed to read values from a file and depending on what it reads create 2 matrix: first value on the file is rows and second one cols. (Then it's supposed to do some algorithms but that works just fine, it's failing before that)

So here's my problem: I keep getting the following error message when running the program only when the rows value is 30. I haven't been able to find a single value that makes this fail other than 30. I want to fix this but I can't find what's causing the program to fail to begin with, I don't know what else to try. I debugged it and the program fails when creating the first matrix after reading all the info from the file.

    potter: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted (core dumped)

The funniest thing is the program was working just fine before adding the last function. I must have changed something without noticing and broken the program (I don't have any older versions and removing the function doesn't help)

Thank you so much in advance! Here's a link to the hole code and test files if anyone is interested: https://drive.google.com/open?id=1tcKXainj021fwjAAGN3cNdsU50p2Neou

Aucun commentaire:

Enregistrer un commentaire