m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make m4 only call macros surrounded by brackets.


From: Eric Blake
Subject: Re: Make m4 only call macros surrounded by brackets.
Date: Tue, 03 Mar 2015 09:46:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 03/03/2015 07:38 AM, Zack Piper wrote:
> On Mon, Mar 02, 2015 at 06:53:56AM -0700, Eric Blake wrote:
>> On 02/28/2015 04:21 PM, Zack Piper wrote:
>>
>>>
>>> Hm, I found out how to do it. Unfortuently it seems to segfault when using 
>>> "changeword(`#<\([_a-zA-Z0-9]*\)>)')", and then trying to invoke a macro:
>>>
>>> (gdb) run gpp.m4
>>> Starting program: /usr/local/bin/m4 gpp.m4
>>> Got object file from memory but can't read symbols: File truncated.
>>>
>>
>> A segfault is never good.  Can you please post the contents of gpp.m4,
>> show the exact version of m4 you are testing, and possible provide more
>> of the backtrace, so that we can debug what went wrong?
>>

> 
> ```{shell command="cat gpp.m4"}
> define(`test', `hi')
> changecom(`/*', `*/')
> changeword(`#<\([_a-zA-Z0-9]*\)>')
> 
> #<test>

Seems simple enough.  I was able to reproduce this:

./src/m4: internal error detected; please report this bug to
<address@hidden>: Segmentation fault


> 
> /usr/local/bin/m4: stack overflow

Hmm, you didn't mention that before.  Did you compile with libsigsegv?
If so, it should have given a nice error message instead of a SEGV stack
dump.  But the point remains, if your input has triggered an infinite
recursion parse loop, then this behavior is expected (m4 can't prevent
inputs that cause infinite parse recursion).  Still, I'm going to step
through it to see if something else is wrong in the code.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]