Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: When is mem.c / malloc called?



On Feb 10,  7:17am, Sebastian Gniazdowski wrote:
} Subject: Re: When is mem.c / malloc called?
}
} Don't know why, but now when I have the fprintf() ...
} then I see "Hello", and shell startup always ends in:
} 
}  mem.c:1341: MEM: allocation error at sbrk, size 20480.
} 
} i.e. aborts, so I guess I'm safe - the pathway to use non-standard,
} thread unsafe malloc() is blocked because it's not working.

What's not working is your debugging technique.  fprintf/fflush invoke
memory allocation, so if you use them *inside* the allocator, things
break.  You would need to use low-level system calls e.g. write()
directly to avoid this, or use an actual debugger like GDB and put a
breakpoint in malloc.



Messages sorted by: Reverse Date, Date, Thread, Author