Re: Memory exhausted error

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.bugs
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 12/16/20 10:27 PM, [email protected] wrote:
> I’m porting flex/bison on windows and build M4 code inside executable.
> 
> After upgrading gnulibs I caught a runtime error “memory exhausted” in macro.c file.

What do you mean by updating gnulib, pointing the submodule to a newer
commit?  Yes, there have been a number of changes in more recent gnulib
that may require some porting efforts in the matching m4 code to follow
new semantics from what gnulib offers, and it looks like you have found
one of them.


> 
>    obstack_blank (&argv_stack, -argc * sizeof (token_data *)); << crash here!!! 
> Line 390
> 
> }
> 
> It seems now obstack_blank function doesn’t allow negative numbers (see 
> /lib/obstack.h file)

That matches gnulib/NEWS for 2014-10-29; the fix is to use
obstack_blank_fast() instead, when using a gnulib newer than that date.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.