Summary: | xconsole: On 64-bit linux systems, xconsole can fail with SegFault when using result from ptsname (man page for ptsname is incorrect or misleading) | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Ferris McCormick <fmccor> | ||||
Component: | App/other | Assignee: | Xorg Project Team <xorg-team> | ||||
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | normal | ||||||
Priority: | high | CC: | dberkholz, jeremyhu, joshuabaergen | ||||
Version: | 7.0.0 | ||||||
Hardware: | x86 (IA32) | ||||||
OS: | Linux (All) | ||||||
Whiteboard: | 2011BRB_Reviewed | ||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Ferris McCormick
2006-03-22 00:33:20 UTC
man ptsname suggests: #define _XOPEN_SOURCE #include <stdlib.h> char *ptsname(int fd); is this somehow deficient? (In reply to comment #1) > man ptsname suggests: > #define _XOPEN_SOURCE > #include <stdlib.h> > > char *ptsname(int fd); > > is this somehow deficient? Not at all. I don't see how I could have looked at the man page for so long and read over that without comprehension. That looks like the proper fix, of course. Red faced, Ferris Created attachment 8518 [details] [review] 1.0.2-fix-segfault.patch This fixes it for me. Except that always defining _XOPEN_SOURCE will break it on other platforms. Welcome to the hell that is brought to us by standards that seek to make portability easier. (In reply to comment #4) > Except that always defining _XOPEN_SOURCE will break it on other platforms. > Welcome to the hell that is brought to us by standards that seek to make > portability easier. > So is Ferris' solution the better one, then? No, #defining _XOPEN_SOURCE for Linux only is preferable, so that you get the prototype provided by the platform. A number of the other X modules already have code in configure.ac to add _XOPEN_SOURCE on Linux only. s/Linux/GNU userland/g Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future. Is this still an issue? I don't seen anything as having changed in X11, but maybe glibc is less stupid now. Please submit an improved patch or I suggest we will probably close this as "NOTOURBUG" autoconf provides a macro to set the _*_SOURCE flags now: AC_USE_SYSTEM_EXTENSIONS If this is still needed for xconsole, that would be the preferred fix. AC_USE_SYSTEM_EXTENSIONS was added in xconsole 1.0.7 - let us know if that doesn't fix this issue. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.