[bug #68353] file_stat fails on a file in a tmpfs file system on an i386 architecture

Rafael Laboissière <[email protected]> Sat, 16 May 2026 12:00:10 -0400 (EDT)
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

URL:
  <https://savannah.gnu.org/bugs/?68353>

                 Summary: file_stat fails on a file in a tmpfs file system on
an i386 architecture
                   Group: GNU Octave
               Submitter: rlaboiss
               Submitted: Sat 16 May 2026 04:00:03 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: 11.1.0
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 16 May 2026 04:00:03 PM UTC By: Rafael Laboissière <rlaboiss>
This problem occurred while building the Debian package octave-dicom on a i386
autobuilder:


[src/isdicom.cpp]
>>>>> /build/reproducible-path/octave-dicom-0.7.2/src/isdicom.cpp
***** test
 fpath = tempname ();
 wdata = uint8 (10*rand (10,10));
 dicomwrite(wdata, fpath);
 assert (isdicom (fpath), true);
Warning: In ./Source/DataStructureAndEncodingDefinition/gdcmMediaStorage.cxx,
line 534, function bool gdcm::MediaStorage::SetFromModality(const
gdcm::DataSet&)
Unknown/Unhandle MediaStorage, but Pixel Data element found


Warning: In ./Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx, line 2641,
function static gdcm::PhotometricInterpretation
gdcm::ImageHelper::GetPhotometricInterpretationValue(const gdcm::File&)
No PhotometricInterpretation found, default to MONOCHROME2


*** stack smashing detected ***: terminated
fatal: caught signal Aborted -- stopping myself...


(See the full
[https://buildd.debian.org/status/fetch.php?pkg=octave-dicom&arch=i386&ver=0.7.2-2&stamp=1776247248&raw=0
build log].)

I created a concise example that isolates the problem, and I attached it to
this bug report. It is possible to reliably reproduce it on a i386 system:


$ dpkg --print-architecture
i386
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,inode64)
$ unzip file-stat-tmpfs-i386.zip 
Archive:  file-stat-tmpfs-i386.zip
   creating: file-stat-tmpfs-i386/
  inflating: file-stat-tmpfs-i386/expose-issue.m  
  inflating: file-stat-tmpfs-i386/file_exists.cpp  
  inflating: file-stat-tmpfs-i386/Makefile  
$ cd file-stat-tmpfs-i386/
$ make
mkoctfile file_exists.cpp
octave-cli --eval 'source("expose-issue.m")'
Octave version: 11.1.0
/tmp/oct-2JWjok
*** stack smashing detected ***: terminated
fatal: caught signal Aborted -- stopping myself...
make: *** [Makefile:3: run] Aborted


The issue arises when octave::sys::file_stat(filename).exists() is called and
the specified filename is created in a tmpfs file system. This does not happen
when the temporary file is created in a non-tmpfs file system, for instance:


$ TMPDIR="$HOME" make
octave-cli --eval 'source("expose-issue.m")'
Octave version: 11.1.0
/home/rafael/oct-2gnqnZ
0








    _______________________________________________________
File Attachments:

Name: file-stat-tmpfs-i386.zip       Size: 1.1KiB

<https://file.savannah.gnu.org/file/file-stat-tmpfs-i386.zip?file_id=58620>



    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68353>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCagiUigAKCRCqLAuaBUf3
TrdqAP9TLjTf7ODhUv8GXVhoxpGF974uRNMzFVDY4yc+7Srj4gD+MZCjoxjBJsYg
J2wu0BKamOkOVOgkjs6Fv3fZgvFyfgQ=
=rP5i
-----END PGP SIGNATURE-----