After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 400242 - libxslt ignores ENOMEM and crashes on SIGSEGV
libxslt ignores ENOMEM and crashes on SIGSEGV
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.19
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-24 15:31 UTC by Pavol Rusnak
Modified: 2010-11-25 03:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (125.79 KB, application/x-compressed-tar)
2007-01-24 15:32 UTC, Pavol Rusnak
Details

Description Pavol Rusnak 2007-01-24 15:31:00 UTC
When I run xsltproc and system runs out of memory, a segmentation fault is thrown somewhere in libxslt. (Reporter says that it can even hang the machine, however I was not able to reproduce hang). Small test case to show this behavior is included (attached file). Run ./testcase after unpacking. If you can not get segfault, try changing ULIMIT_M and ULIMIT_V variables at the start of the script. GDB backtrace and strace are also present in the archive (files debug.backtrace and debug.strace).
Comment 1 Pavol Rusnak 2007-01-24 15:32:00 UTC
Created attachment 81080 [details]
testcase
Comment 2 William M. Brack 2007-01-24 19:48:26 UTC
Note that the library does not "ignore" ENOMEM, but rather provides the caller with a NULL pointer.  The crashes are caused when code doesn't check for this return value.  The distinction is important, because the underlying philosophy is that the library attempts to continue after various errors are detected, in order to assist the user in locating additional errors.  Still, anytime the library produces a SIGSEGV, that should certainly be fixed.

I'm not certain whether your "testcase" was intentionally prepared with some missing files, which cause a large number of warnings and errors.  I fixed two spots within libxslt and one within libxml2 which were certainly causing crashes with reduced memory.  Please try the current SVN versions of both libraries and see whether your original problem is now OK.  I'll leave this bug report open for now in case any further problems are found.

Also, please note that libxslt-1.1.20 is now current (but still contains the errors which I just fixed).
Comment 3 Pavol Rusnak 2007-01-25 11:20:33 UTC
(In reply to comment #2)
> I'm not certain whether your "testcase" was intentionally prepared with some
> missing files, which cause a large number of warnings and errors.

No, I took directories "customization" and "docbook" from /opt/kde3/share/apps/ksgmltools2 and cleaned them to reduce size. File gdm.xml is from /opt/gnome/share/gnome/help/gdm/C. It was working without any warnings or errors on my box.

> I fixed two spots within libxslt and one within libxml2 which were certainly
> causing crashes with reduced memory.  Please try the current SVN versions of
> both libraries and see whether your original problem is now OK.

Thanks, SVN versions are not producing SIGSEGVs anymore.