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

 
 

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

Submitter:  Christian Boos <cboos>
Submitted:  Thu 25 Dec 2014 05:55:11 PM UTC
   
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Component Version:  4.1
Operating System:  MS Windows Fixed Release:  4.2
Triage Status:  Verified
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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

Thanks, I pushed your patch.

Eli Zaretskii <eliz>
Group 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>

 

Attached Files

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

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-27 eliz StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.2
        Triage StatusNone Verified
    2014-12-25 cboos Attached File- Added 0001-Use-correct-pid_t-type-for-shell_function_pid.patch, #32711

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code