Hugo - malloc_error with OSX compiler

I am getting the following error attempting to compile my work in progress using the hc OSX compiler:

➜ cyberganked git:(master) _mac/hc cyberganked.hug
hc(72306,0x7fff8f119380) malloc: *** error for object 0x10c957970: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[1] 72306 abort _mac/hc cyberganked.hug

It’s a big game but it’s not bigger than the last one I made, so I don’t quite understand what is going on.

I have done some searches on this error to try to set a break point, but I don’t see how that is possible with a command line program like hc - anyone know how to troubleshoot this one?

It sounds like you’d need to rebuild hc with debugging info enabled and then use gdb to debug it. Finding malloc/free problems in C code is often not particularly easy, sorry …

I highly recommend valgrind for that.

Just to make sure people aren’t wasting time looking into it: the issue should have been fixed some years ago in the Unix sources. The macOS sources are out of date and don’t contain the fix.

The macOS sources contain only one change that doesn’t exist in the Unix source. I’ll merge that into the Unix sources and the macOS repo can be deleted (there’s no point in having two separate code bases.)

OK, done. This is the source repo that should be used to build the Hugo compiler on both macOS as well as Linux:

bitbucket.org/0branch/hugo-unix

I’ll also bring that commit across to github.com/curiousdannii/hugo when I can.

I successfully compiled the hugo-unix code for both my Linode instance running Ubuntu and on my Macbook. I will eliminate the Mac repo I had going on bitbucket as we don’t need it any longer. Also next chance I get I shall:

  1. Ensure the IF Wiki entry for Hugo has the update of where to get the code
  2. Put my compiled versions somewhere just in case - I think anyone doing Hugo in Unix probably can run a make file, but it’d be nice to have the Mac version just available for download
  3. Update the IF Wiki entry with Dannii’s repo if it hasn’t been updated already.

Thanks, everyone. It’s been six or seven years since I released a game but I truly have been working on one most nights since 2012, it just got bigger than I had really wanted and I do use these tools in the creation of the next one.

I just noticed that the license says “BSD.” Was Hugo relicensed at some point? If it’s really BSD now, that means we can potentially change some things in Hugo that would otherwise be not OK under the normal Hugo License.

Kent’s Trac repository is BSD-2-Clause licensed. I’m not sure when he decided to switch. Sometime before the end of 2014.

Hm. It seems Kent was working on a 3.2 update. Will need to check what the differences are.

Not a lot of substance: https://github.com/curiousdannii/hugo/compare/v3.2

Btw, if you want to merge all these together (including Garglk’s) I’d be very happy to make my Github repo mirror yours instead of me trying to navigate these branches of code I barely understand.

Not sure how to coordinate things further with everyone, as it looks like I could get banned from this forum (I’m being threatened privately by the “higher ups.”)

Not sure what the best way is to coordinate things when that happens. If it does happen, the discussion will probably continue on the Hugo section of Jolt Country:

http://www.joltcountry.com/phpBB3/viewforum.php?f=8