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 412787 - snprintf is leaking into trio-enabled builds on DEC OSF/1 again
snprintf is leaking into trio-enabled builds on DEC OSF/1 again
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other All
: Normal blocker
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-27 21:14 UTC by Nix
Modified: 2007-08-23 19:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use trio.h in namespaces.c, which calls snprintf(); replace vsnprintf() in xsltutils.c only if the platform lacks it (986 bytes, patch)
2007-02-27 21:16 UTC, Nix
none Details | Review

Description Nix 2007-02-27 21:14:02 UTC
Please describe the problem:
The symptoms are that builds on platforms lacking snprintf() end up incorporating references to snprintf() into libxslt, leading to libxslt refusing to load.

Trivial patch forthcoming (if I can figure out how to attach it...)

Steps to reproduce:
1. Build libxslt on a platform lacking snprintf().
2. make check or try to use libxslt in any way at all.


Actual results:
Undefined symbol.

Expected results:


Does this happen every time?


Other information:
Comment 1 Nix 2007-02-27 21:16:37 UTC
Created attachment 83491 [details] [review]
Use trio.h in namespaces.c, which calls snprintf(); replace vsnprintf() in xsltutils.c only if the platform lacks it

2007-02-27  Nix  <nix@esperi.org.uk>

	* libxslt/namespaces.c: Include trio.h and replace snprintf()
	if needed.
	* libxslt/xsltutils.c: Only replace vnsprintf() if needed.
Comment 2 William M. Brack 2007-03-01 07:03:55 UTC
I agree that namespaces.c should have an "#ifdef XSLT_NEEDS_TRIO" clause.  However, reading the source of trio.h it looks to me as if the other parts of your proposed patch to namespaces.c (#if !defined(HAVE_SNPRINTF), etc.) are already present in trio.h.  It also looks as if the "#define vsnprintf" in xsltutils.c should be deleted rather than adding a "#if !defined(vsnprintf)", for the same reason.  Would you agree?
Comment 3 Nix 2007-03-01 21:06:48 UTC
Yes, *iff* something-or-other is done to #define TRIO_REPLACE_STDIO in configure.in when snprintf/vsnprintf/some-other-function are missing (as without that none of the #defines in trio.h will kick in). But doing that is a little trickier: you'd have to be sure that configure.in tested for all the various stdio things that trio.h's #ifdefs check, or it'll end up replacing *them* as well.

That was a little more than I wanted to do in this quick hack, but doing it is probably a good idea :)
Comment 4 William M. Brack 2007-03-02 10:46:54 UTC
Good point - I hadn't noticed that.  OK, I've enhanced the configuration checking code (xsltconfig.h.in only - configure.in was already ok), and also modified xsltutils.c and namespaces.c as we agreed.  The modified code is in SVN.  I don't have any really good way to test it, so I'd appreciate it if you could try it and see if it seems ok.

Thanks for the report.
Comment 5 Nix 2007-03-02 19:00:29 UTC
I'll test it on the old DEC Alpha in question next week. (It's `protected' by a firewall that's so paranoid that it blocks svn and svn+ssh, and so buggy that it breaks svn's http transport, too, so I'll have to tar it up and carry it there by hand...)
Comment 6 Daniel Veillard 2007-08-23 12:40:21 UTC
No comment back but based on comment #4 I assume it's fixed in HEAD,
or maybe the last OSF/1 box died due to its old age >;-> (and it's
definitely not environment friendly to run those anymore!)

Daniel
Comment 7 Nix 2007-08-23 19:14:04 UTC
Oops, my apologies, I thought I'd followed up. Yes, it's fixed and works fine (and libxml is about ten thousand times faster than the monstrous Oracle Java libraries on this platform, and that's not an exaggeration: they're so slow that Oracle support are actually recommending that people use libxml and libxslt when performance is at all important. I think your code has, what's the phrase, pwned theirs :) )