bugmake - Bugs: bug #43221, Random string corruption when...

 
 

bug #43221: Random string corruption when recursively evaluating guile code.

Submitted by:  Taahir Ahmed <ahmedtd>
Submitted on:  Sun 14 Sep 2014 07:38:49 AM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.0 Operating System:  POSIX-Based
Fixed Release:  4.1 Triage Status:  Small Effort

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 15 Sep 2014 01:45:54 PM UTC, comment #1: 

Fixed with SHA 5623441.  Thanks for your report!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 14 Sep 2014 07:38:49 AM UTC, original submission:  

I am working on a build system that extensively uses GNU Make's new guile integration.  One of my goals is to simplify the creation and use of non-recursive makefiles (in the Recursive Make Considered Harmful sense).

I created a guile function (augmk/enter) that sets up some automatic bookkeeping and then executes 'include <subdir>/Rules.mk' using gmk-eval.  This seems to mostly work, but under certain conditions causes random corruption.

I have attached an example project that shows random string corruption on two different systems.  If you run 'make clean' from the top-level project directory, the expected output is something like:

$ make clean
rm -rf aaaaaaaaaaaaaaaaa
rm -rf bbbbbbbbbbbbbbbbb
...
rm -rf hhhhhhhhhhhhhhhhh

However, most of the time, one of the output lines will be something like this:

rm -rf <blank>
or
rm -rf <utf-8 nonsense>
or
rm -rf r/share/.... <some actual path from /usr on my system, but with the leading "/us" cut off>

Removing any of these factors from the example project causes the corruption to go away:

  1) Making the targets in question 16 characters or less.
  2) Not emitting the code for the 'clean' target from guile, but instead putting it directly in ./Rules.mk.
  3) Not including each Rules.mk file from guile (via augmk/enter), but rather directly writing 'include <subdir>/Rules.mk.

I can reproduce this corruption using both Make 4.0 (from the Gentoo repositories) and with the latest master checkin from git.

I suspect that the "real" part of the problem comes from calling 'include' from within guile.

I've tried one mitigation strategy already, to no effect: in guile.c, use scm_without_guile() to ensure that eval() is never called in guile mode.

Taahir Ahmed <ahmedtd>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #32092:  example.tar.gz added by ahmedtd (1KiB - application/gzip - A small example project that reproduces the error.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by ahmedtd (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-15 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.1
        Triage StatusNone => Small Effort
    2014-09-14 ahmedtd Attached File- => Added example.tar.gz, #32092

    Back to the top


    Powered by Savane 3.5