helpThe GNU Bourne-Again SHell - Support: sr #109654, Text file busy

 
 

sr #109654: Text file busy

Submitted by:  J <now3d>
Submitted on:  Mon 11 Mar 2019 01:26:42 PM UTC  
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Fri 29 Mar 2019 11:40:18 AM UTC, comment #4: 

It seems like the issue might be the use of strerror() to return a generic string for ETXTBSY.

POSIX shows for execve() the text that should be displayed is more nuanced
https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html

[ETXTBSY]
The new process image file is a pure procedure (shared text) file that is currently open for writing by some process.

J <now3d>
Thu 21 Mar 2019 02:57:44 PM UTC, comment #3: 

I'll look at it, but I'm reluctant to circumvent system error messages here.

Chet Ramey <chet>
Project Administrator
Thu 21 Mar 2019 12:01:47 PM UTC, comment #2: 

You're completely right. It is a shame the execve() in POSIX isn't ideal. We're stuck by these archaic specifications from 1983 that it returns ETXTBSY instead of EBUSY

http://man7.org/linux/man-pages/man2/execve.2.html

Why not display a more appropriate error message?
eg
1. from man "error executable file open for writing by one or more processes."
2. Or if execve sets errno ETXTBSY, change it to EBUSY so an appropriate message is  strerror() returns a clearer message.

J <now3d>
Wed 20 Mar 2019 07:47:00 PM UTC, comment #1: 

If that's the errno that execve returns, that's the error bash is going to report.

Chet Ramey <chet>
Project Administrator
Mon 11 Mar 2019 01:26:42 PM UTC, original submission:  

When a binary is being updated over ssh, we see this.

me@ip:~/dir ./app -scan
-bash: ./app: Text file busy

I can see that is the [ETXTBSY]
Text file busy.

It would be better if Bash treated as [EBUSY]
Device or resource busy.

It's not text file.

GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

J <now3d>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by now3d (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.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-20 chet StatusNone => Invalid

    Back to the top


    Powered by Savane 3.5