bugattr - Bugs: bug #62370, Test failure with musl C library...


bug #62370: Test failure with musl C library due to different stringification of ENOTSUP errno

Submitter:  None
Submitted:  Wed 27 Apr 2022 09:32:29 AM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Sun 14 Jan 2024 01:36:49 AM UTC, comment #1: 

strerror return value is not standardized.  it can already change based on the locale (which already broke us once).

i see two possible options here.

1. have the error message use constant strings when running tests.  we could add a CLI option like --error-constants or something, and when that's active, change the local strerror_ea to return errno constants.

2. change the error path to use a unique exit status for this particular path that we're trying to test, and ignore the actual error output of the tool.

Mike Frysinger <vapier>
Group Member
Wed 27 Apr 2022 09:32:29 AM UTC, original submission:  

One attr test (version 2.5.1) fails with musl (I tested with version 1.2.3):

FAIL: test/attr

[9] $ mkdir d -- ok
[10] $ cd d -- ok
[12] $ touch f -- ok
[13] $ setfattr -n user -v value f -- failed
setfattr: f: Not supported                                                         != setfattr: f: Operation not supported
[16] $ setfattr -n user. -v value f -- ok
[19] $ setfattr -n user.name f -- ok

It fails because musl stringifies ENOTSUPP as "Not supported"[1]
and not as "Operation not supported" which the test expects. I'm not very knowledgable in this area, but I think POSIX doesn't mandate the exact string representation of the error numbers? Would it be possible to make the test allow both versions?

Best regards,

[1] https://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n85



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

Attach Files:

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 vapier (Posted a comment)

    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.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code