Crap, spent two hours trying to find a memory leak in the generator and wasn't able to. >:|


TIL a few things about debugging, terminal shortcuts and what GDB stands for. Still haven't actually fixed the damn thing though.

@rostiger fun fact I setup a C debugger in vscode yesterday night.😅

@thomasorus I can handle GDB pretty well by now, but I'm struggling with a memory leak somewhere that causes the program to crash when the lexicon hits a line count of around 400.

@thomasorus I can see what happens (an array index int is going crazy at a certain moment), but I don't know why. I have been on this issue for the past days, it's driving me nuts.

@rostiger Maybe it's time to summon... super @cancel, the C hero of Merveilles!

@thomasorus @rostiger get on IRC if you want interactive help. Conversations on Mastodon suck :)

@cancel @thomasorus I found it. I didn't allocate enough memory for a string buffer. feel so dumb having spent 7 hours on this.
Thanks for the offer of trouble shooting, I really appreciate it. The fear of coming on IRC to waste everyone's time on my ridiculously noob problem was the motivation I needed. :)

@rostiger @thomasorus Well, you are probably doing something else wrong. Because allocating a too-small buffer for a string should result in an error code path in your application or the string being truncated, not corruption.

@rostiger @thomasorus (Unless some other library or piece of code specifically asked you to allocate a buffer of a certain size, and you failed to do it. But copying or printing a formatted string into a buffer that's too small shouldn't cause a corruption, unless you are using the bad C string functions.)

@cancel @thomasorus Thanks for the heads up. You probably are right, there must be some problem elsewhere. Which I'll fix once it starts to make troubles again. :)

@rostiger @thomasorus I meant you are probably using sprintf() instead of snprintf() or something

Sign in to participate in the conversation

Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.