[Bug 2069660] Re: octave-dicom: shared usage of dicomdict across plugins results in crash on program exit
Launchpad Bug Tracker
2069660 at bugs.launchpad.net
Tue Jul 2 15:15:21 UTC 2024
This bug was fixed in the package octave-dicom - 0.6.0-3ubuntu1
---------------
octave-dicom (0.6.0-3ubuntu1) oracular; urgency=medium
* Fix a use-after-free issue related to duplicated symbols in plugins
that reference dicomdict functionality (dicomdict, dicominfo, dicomwrite,
dicomlookup, dicomdisp, dicomanon) (LP: #2069660)
-- Dan Bungert <daniel.bungert at canonical.com> Fri, 28 Jun 2024
17:04:25 -0600
** Changed in: octave-dicom (Ubuntu)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-13 in Ubuntu.
https://bugs.launchpad.net/bugs/2069660
Title:
octave-dicom: shared usage of dicomdict across plugins results in
crash on program exit
Status in gcc-13 package in Ubuntu:
Invalid
Status in octave-dicom package in Ubuntu:
Fix Released
Bug description:
dicomdict is both functionality provided as a .oct file but also code
that is shared among other .oct files (dicominfo.oct dicomwrite.oct
dicomlookup.oct dicomdisp.oct dicomanon.oct)
programs which use any two of these, including the built-in test suite
for octave-dicom, may experience a crash-on-exit.
This is due to the following lines from octave-dicom src/Makefile.in:
```
need_dict = dicominfo.oct dicomwrite.oct dicomlookup.oct dicomdisp.oct dicomanon.oct
...
$(need_dict): %.oct: %.cpp dicomdict.o
$(MKOCTFILE) $(GDCM_CPPFLAGS) $(GDCM_LIBS) $^
```
The result of this is that dicomdict.o symbols are present in multiple
plugins, and the resulting program cleanup from this situation can go
poorly, with errors such as "double free or corruption (!prev)" and
other errors that you would expect to see with a corrupted heap.
If dlopen() order could be dictated so that the need_dict libs first
had dicomdict.oct loaded first, paired with the "need_dict" plugins no
longer being built with dicomdict.o, then octave programs using
octave-dicom would be ok. It's not currently clear to me how that
dlopen() order would be dictated.
original description follows
---
octave-dicom is currently FTBFS on all non-riscv64 arches, due to test
failures. A double-free is happening, which causes a crash and fails
the test suite.
Backporting this source to Ubuntu Mantic with modest packaging changes
(reduce required dh-octave version) will pass the test suite.
https://launchpadlibrarian.net/735078455/buildlog_ubuntu-oracular-
amd64.octave-dicom_0.6.0-3build1_BUILDING.txt.gz
5 tests, 5 passed, 0 known failure, 0 skipped
double free or corruption (!prev)
fatal: caught signal Aborted -- stopping myself...
Aborted (core dumped)
make: *** [debian/rules:5: binary] Error 134
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-13/+bug/2069660/+subscriptions
More information about the foundations-bugs
mailing list