bugmake - Bugs: bug #43887, shell function blocks for x64...

 
 

bug #43887: shell function blocks for x64 builds with MSVC compiler

Submitted by:  Christian Boos <cboos>
Submitted on:  Thu 25 Dec 2014 05:55:11 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.1Operating System: MS Windows
Fixed Release: 4.2Triage Status: Verified

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 27 Dec 2014 08:58:06 AM UTC, comment #1:

Thanks, I pushed your patch.

Eli Zaretskii <eliz>
Project Member
Thu 25 Dec 2014 05:55:11 PM UTC, original submission:

Season's greetings!

I've recently built Make 4.1 using Visual Studio 2012, for the x64 platform (i.e. a 64-bits build).
The build went well, but using this make.exe for my usual build hanged. Debugging it, I saw that the hang happened in a $(shell ...) function call, never returning and stuck in reap_children().

I figured out that the "pid == shell_function_pid" comparison that needs to succeed for setting the shell_function_completed flag and exiting reap_children() could actually never succeed:
- "pid" is obtained from process_wait_for_any() and is actually a pointer, cast from sub_process* to HANDLE to pid_t
- "shell_function_pid" got its value from process_init_fd() via windows32_openpipe(), but here the cast chain is sub_process* to HANDLE to int!
For that specific compiler/platform combination, pointers and pid_t are 64-bits values, while ints are 32-bits values

Using pid_t when declaring shell_function_pid fixed the problem. Patch attached.

I've looked for other potential problems in the code, but all the other int/pid_t mismatches seem to happen for platforms where it shouldn't be a problem (EMX, Amiga).

Nearly forgot to say: everything else seems to work like a charm after that! Thanks!

Christian Boos <cboos>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #32711:  0001-Use-correct-pid_t-type-for-shell_function_pid.patch added by cboos (1KiB - application/octet-stream - fix for this issue, on top of 4.1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by eliz (Posted a comment)
  • -unavailable- added by cboos (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 27 Dec 2014 08:58:06 AM UTCelizStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.2
      Triage StatusNone=>Verified
    Thu 25 Dec 2014 05:55:11 PM UTCcboosAttached File-=>Added 0001-Use-correct-pid_t-type-for-shell_function_pid.patch, #32711

    Back to the top


    Powered by Savane 3.1-cleanup1