intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Feb 22, 2019 10:30 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Feb 14, 2019 4:23 pm 
Offline

Joined: Tue Oct 28, 2008 3:51 pm
Posts: 103
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?

_________________
IF Games I've Made / My Blog / My Twitter


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Feb 15, 2019 3:33 pm 
Offline

Joined: Mon Jun 29, 2009 5:51 am
Posts: 615
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 ...


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Feb 15, 2019 4:49 pm 
Offline
User avatar

Joined: Thu Aug 22, 2013 2:48 pm
Posts: 145
DavidK wrote:
Finding malloc/free problems in C code is often not particularly easy, sorry ...


I highly recommend valgrind for that.

_________________
Dialog. Tethered.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Feb 15, 2019 9:21 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1048
Location: Greece
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.)

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Feb 15, 2019 10:01 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1048
Location: Greece
OK, done. This is the source repo that should be used to build the Hugo compiler on both macOS as well as Linux:

https://bitbucket.org/0branch/hugo-unix

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Feb 16, 2019 12:35 am 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2600
I'll also bring that commit across to https://github.com/curiousdannii/hugo when I can.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Feb 18, 2019 12:09 pm 
Offline

Joined: Tue Oct 28, 2008 3:51 pm
Posts: 103
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.

_________________
IF Games I've Made / My Blog / My Twitter


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group