Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:43:28+00:00 2026-06-16T11:43:28+00:00

I have a binary that runs under my default shell. The binary runs perfectly

  • 0

I have a binary that runs under my default shell.

The binary runs perfectly o.k. with:

./binary input.dat

However, if I put this inside a make file:

 SHELL=/bin/bash

 runos:
      ./binary input.dat

The code crashes and leaves me quite helpless.
Here is what I tested so far, everything inside my Make file and in the shell:

  1. ulimit -a: identical.
  2. Set the shell to bash as seen above.
  3. diff of the environment variables in SHELL and Make with:


    env | sort > vars.1

    inside make


    env | sort > vars.2

    Then run the binary with the extra variables in Make with the following command:


    env SHLVL=2 MAKELEVEL=1 MAKEFLAGS= ./binary input.dat

  4. strace in the shell and inside make:


    strace -o debug binary input.dat

The code keeps on crashing in Make, and runs in the shell. I am already thinking to dump Make for my test cases and just write shell scripts. But I am curious to know what is the difference.

The Fortran code (a mix of F77, F90 and F95) was compiled with gfortran-4.4 and the following options:

FFLAGS= -g -fbacktrace

So, the concrete question is, what can I do to make this binary run under make in Debian!?

update:

I just tested again in a CentOS machine (v5.8), The code inside Makefile does not crash (GNU Make version 3.81).
I also tested on my Debian Wheezy and openSUSE 11.4, both with GNU Make version 3.82 – It crashes!
I tested on Debian Squeeze with GNU Make version 3.81, and it does crash. So, I think it is not dependent on the GNU Make version.

error when crashing:

 enter timeloop
 ------------------------------------------------------------------------
 timestep:     1  time: 2.500E-02 days         delt: 2.500E-02 days        
 -------------------------------------------
    terminated in routine react_snia      
    maximum number of iterations exceeded   
    bye now ...                             
 -------------------------------------------
failure in timeloop
no further time step reduction possible
try reducing min. time step, bye now ...

trying to work around ‘GNU Make’ using ‘waf’

It has been a while since I wanted to test waf, so here is another interesting observation:
I wrote a wscript which contains a function:

import os

def run(ctx):
    os.system('./binary input.dat')

And waf run runs!

If I changed the run method to:

import subprocess as sp
def run(ctx):
    sp.call('./binary input.dat', shell=True)

The binary also works as expected.

So, now I am thinking GNU Make forks a new sub-shell in a way that causes may binary to fail (although, under RHEL 5.8 Make did work).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:43:30+00:00Added an answer on June 16, 2026 at 11:43 am

    solution: compile make from sources …

    Read to find out more.

    OK, so after being pretty much desperate, I did what I simply should have done before blame make for all my troubles.
    I thought the problem is Debian specific. But I am guessing the version in CentOS-5.8 is a patched version, although it says it’s v.3.81.
    So, for those who wonder my solution was:

    wget http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
    tar xvzf make-3.82.tar.gz
    cd make-3.82
    ./configure
    ./build.sh
     # copy make to the directory with the binary and input and run the local make version
    ./make
    # everything works as expected !!!
    

    I thought let’s narrow it down –

    wget http://ftp.gnu.org/gnu/make/make-3.80.tar.gz
    tar xvzf make-3.80.tar.gz
    cd make-3.80
    ./configure
    ./build.sh
     # copy make to the directory with the binary and input and run the local make version
    ./make
    # everything works as expected !!!
    

    Is it the version 3.81 ?

    wget http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
    tar xvzf make-3.81.tar.gz
    cd make-3.81
    ./configure
    ./build.sh
     # copy make to the directory with the binary and input and run the local make version
    ./make
    # FAIL! Like with the make version in Debian.
    

    Hence, I think I bumped into some very weird bug in GNU Make v.3.81.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a binary tree in unordered list that looks like this: <ul> <li>1
I have a program that runs as 64 bit application under Windows. I want
I have a binary that I want to convert to standard MIME-compliant base64 string.
I have a binary image that represents a number in MATLAB: I'd like to
I have a binary file that contains blocks of information ( I'll refer to
I have some binary files that I'd like to embed in a dll I'm
I have a binary file that I would like to regex search/replace hex bytes
I have a binary tree class that is created with a root node and
we have a VB6 binary executable that comes with no source code. And we
I have a binary search function that will search for a word in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.