gabrielzschmitz / Tomato.C

A pomodoro timer written in pure C.
GNU General Public License v3.0
320 stars 20 forks source link

Cannot launch tomato app because of fatal glibc error #14

Closed ghost closed 1 year ago

ghost commented 1 year ago

I installed all the dependencies and the program itself, as indicated in the instructions. When I run the program through the "tomato" command, I get the following error:

Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old size) >=MINSIZE && prev_inuse (old_top) && ((unsigned long) old_env & (page size - 1)) = 0)

and then the core dumped

gabrielzschmitz commented 1 year ago

Redownloading the app by using git pull at the folder of clone, then sudo make install again, resolve the problem?

ghost commented 1 year ago

Redownloading the app by using git pull at the folder of clone, then sudo make install again, resolve the problem?

Unfortunately, the same problem

gabrielzschmitz commented 1 year ago

My thesis is that there is some error in some malloc at createLog() and readLog(), so try commenting this lines at initApp() (tomato.c):

void initApp(appData * app){
    /* One Second Based in the Frames per Second */
    app->sfps = (2 * sqrt(15));

    app->longPause = (LONGPAUSE * 60 * 8);
    app->workTime = (WORKTIME * 60 * 8);
    app->shortPause = (SHORTPAUSE * 60 * 8);
    app->pomodoros = POMODOROS;
    app->menuPos = 1;
    app->pomodoroCounter = 0;
    app->currentMode = 0;
    app->logoFrame = 0;
    app->coffeeFrame= 0;
    app->bannerFrame= 0;
    app->frameTimer = 0;
    app->timer = 0;
    app->framems = 0;
    app->timerms = 0;
    app->pausedTimer = 0;
    app->cycles = 0;
    app->needToLog = 0;
    app->needResume = 0;
    app->resume = 0;
    app->newDay = 1;
    app->runOnce = 1; 

    /* Defined in the config.mk */
    app->logPrefix = LOGPREFIX;
    app->logFile = LOGFILE;
    app->tmpFile = TMPFILE;
    app->timerFile = TIMERFILE;

    //createLog(app);
    //readLog(app);
}

Them sudo make install and give me a feedback. If the program starts normally it means there's something wrong at those functions, so I'll try my max to fix it!

ghost commented 1 year ago

My thesis is that there is some error in some malloc at createLog() and readLog(), so try commenting this lines at initApp() (tomato.c):

void initApp(appData * app){
    /* One Second Based in the Frames per Second */
    app->sfps = (2 * sqrt(15));

    app->longPause = (LONGPAUSE * 60 * 8);
    app->workTime = (WORKTIME * 60 * 8);
    app->shortPause = (SHORTPAUSE * 60 * 8);
    app->pomodoros = POMODOROS;
    app->menuPos = 1;
    app->pomodoroCounter = 0;
    app->currentMode = 0;
    app->logoFrame = 0;
    app->coffeeFrame= 0;
    app->bannerFrame= 0;
    app->frameTimer = 0;
    app->timer = 0;
    app->framems = 0;
    app->timerms = 0;
    app->pausedTimer = 0;
    app->cycles = 0;
    app->needToLog = 0;
    app->needResume = 0;
    app->resume = 0;
    app->newDay = 1;
    app->runOnce = 1; 

    /* Defined in the config.mk */
    app->logPrefix = LOGPREFIX;
    app->logFile = LOGFILE;
    app->tmpFile = TMPFILE;
    app->timerFile = TIMERFILE;

    //createLog(app);
    //readLog(app);
}

Them sudo make install and give me a feedback. If the program starts normally it means there's something wrong at those functions, so I'll try my max to fix it!

Yeah, it works for me. Commented only two lines: //createLog(app); and //readlog(app); so, the problem may be coming from this

gabrielzschmitz commented 1 year ago

I think I've fixed! Try git pulling the app again.

ghost commented 1 year ago

I think I've fixed! Try git pulling the app again.

There is no problem anymore! Awesome, thx a lot