Summary: | segfault during IO cleanup when glibc 2.0 compatibilty is used | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Sisyphus | Reporter: | Ivan A. Melnikov <iv> | ||||||
Component: | glibc-core | Assignee: | placeholder <placeholder> | ||||||
Status: | CLOSED FIXED | QA Contact: | qa-sisyphus | ||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | aen, glebfm, jqt4, ldv, placeholder, sin | ||||||
Version: | unstable | ||||||||
Hardware: | all | ||||||||
OS: | Linux | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 26799 | ||||||||
Attachments: |
|
Description
Ivan A. Melnikov
2019-02-08 15:59:27 MSK
Created attachment 8005 [details]
/bin/cat from Debian 2.0 mentioned in the description
Created attachment 8006 [details]
The mipsel binary it all started with (for me)
Could you forward this to upstream bugzilla, please? wrt the fix, I think you can use if (_IO_fwide_maybe_incompatible) { ... } instead of #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) if (&_IO_stdin_used == NULL) { ... } #endif (In reply to comment #3) > Could you forward this to upstream bugzilla, please? Will do, early next week. > wrt the fix, I think you can use > > if (_IO_fwide_maybe_incompatible) > { > ... > } > > instead of > > #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) > if (&_IO_stdin_used == NULL) > { > ... > } > #endif Seems nice. Also it turns out I've pushed the wrong branch (oops...), so the fix I've put in description is broken. I've updated the branch and the fix to use _IO_fwide_maybe_incompatible: http://git.altlinux.org/people/iv/packages/glibc.git?p=glibc.git;a=commitdiff;h=a290371042c61d33dfef7272c9462b3359731e06 (In reply to comment #5) > See also https://sourceware.org/bugzilla/show_bug.cgi?id=17908 The issue with executables generated by fpc looks exactly the same as in that upstream bug report. Given that a random old x86 binary also misbehaves, I wonder whether the libio compatibility scheme still works properly in glibc on x86 nowadays. I've just checked our glibc builds starting with glibc-2.5 from 4.0 against this ancient cat executable. All demonstrate the same "Invalid free()" issue inside data symbol "_nl_default_dirname". The "Invalid read of size 4" issue in _IO_wsetb first appears in glibc-2.23. I think it was introduced by commit glibc-2.22.90-33-ga601b74d31 (aka glibc-2.23~693) which is indeed problematic as it adds unconditional use of fields not available in old struct _IO_FILE. |