Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / appcert.1
blobd8d92e1f6c34501fd8800287ccd61e6ddded6547
1 '\" te
2 .\" Copyright 2007, Sun Microsystems Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH APPCERT 1 "Jan 29, 2007"
7 .SH NAME
8 appcert \- examine application-level products for unstable use of Solaris
9 interfaces
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBappcert\fR [\fB-h\fR] [\fB-n\fR] [\fB-f\fR \fIinfile\fR] [\fB-w\fR \fIworking_dir\fR] [\fB-B\fR] [\fB-L\fR]
14      [\fB-S\fR] {\fIobj\fR | \fIdir\fR}...
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBappcert\fR utility examines an application's conformance to the Solaris
21 Application Binary Interface (\fBABI\fR). The Solaris \fBABI\fR defines the
22 runtime library interfaces in Solaris that are safe and stable for application
23 use. More specifically, \fBappcert\fR identifies any dependencies on unstable
24 runtime interfaces, as well as certain other risks that could cause the product
25 to fail to work on a subsequent release of Solaris.
26 .sp
27 .LP
28 \fBappcert\fR checks for:
29 .RS +4
30 .TP
31 .ie t \(bu
32 .el o
33 \fIPrivate symbol usage in Solaris  libraries.\fR These are private symbols,
34 that is, functions or data, that are not intended for developer consumption.
35 They are interfaces that Solaris libraries use to call one another. These
36 symbols might change their semantic behavior or even disappear altogether
37 (so-called  \fBdemoted\fR symbols), so it is a good practice to make sure your
38 application does not depend upon any of them.
39 .RE
40 .RS +4
41 .TP
42 .ie t \(bu
43 .el o
44 \fIStatic linking.\fR In particular, this refers to static linking of archives
45 \fBlibc.a\fR, and \fBlibnsl.a\fR, that is, instead of
46 dynamically linking the corresponding shared object \fB\&.so\fR's. Because the
47 semantics of private symbol calls from one Solaris library to another can
48 change from  one release to another, it is not a good practice to hardwire
49 library code into your binary objects.
50 .RE
51 .RS +4
52 .TP
53 .ie t \(bu
54 .el o
55 \fIUnbound symbols.\fR These are library symbols (that is, functions or data)
56 that the dynamic linker could not resolve when \fBappcert\fR was run. This
57 might be an environment problem (for example, \fBLD_LIBRARY_PATH\fR) or a build
58 problem (for example, not specifying \fB-l\fR\fIlib\fR and/or \fB-z\fR
59 \fBdefs\fR with compiling). They are flagged to point these problems out and in
60 case a more serious problem is indicated.
61 .RE
62 .sp
63 .LP
64 An entire product can be readily examined by \fBappcert\fR (that is, if the
65 product is a collection of many programs and supporting shared objects) by
66 referring \fBappcert\fR to the directories where the product is installed.
67 .sp
68 .LP
69 To perform its task, \fBappcert\fR constructs a profile of interface
70 dependencies for each object file within the product (whether an executable
71 object or shared object), to determine all the Solaris system interfaces that
72 are depended upon. (Notice that \fBappcert\fR uses the Solaris runtime linker
73 to make this determination.) These dependency profiles are then compared to a
74 definition of the Solaris \fBABI\fR to identify any interfaces that are Private
75 (unsafe and unstable for application-level use).
76 .sp
77 .LP
78 \fBappcert\fR generates a simple roll-up report that indicates which of the
79 product's components, if any, had liabilities and what those liabilities were.
80 The report aids developers who are examining their product's release-to-release
81 stability.
82 .sp
83 .LP
84 Notice that \fBappcert\fR produces complete interface dependency information,
85 both the Public (safe and stable) Solaris interfaces and the Private (non-ABI)
86 interfaces. This information can also be examined for each product component,
87 if you want.
88 .sp
89 .LP
90 IMPORTANT: \fBappcert\fR must run in the same environment in which the
91 application being checked runs. See NOTES.
92 .SH OPTIONS
93 .sp
94 .LP
95 The following options are supported:
96 .sp
97 .ne 2
98 .na
99 \fB\fB-B\fR\fR
101 .RS 18n
102 If \fBappcert\fR is run in batch mode, the output report will contain one line
103 per binary, beginning with \fBPASS\fR if no problems were detected for the
104 binary, \fBFAIL\fR if any problems were found, or \fBINC\fR if the binary could
105 not be completely checked. Do not interpret these labels too literally. For
106 example, \fBPASS\fR just means that none of the \fBappcert\fR warnings were
107 triggered. These strings are flush left and so can be selected via \fBgrep\fR
108 \fB^FAIL\fR \fB\&...\fR, and so forth.
112 .ne 2
114 \fB\fB-f\fR \fIinfile\fR\fR
116 .RS 18n
117 Specifies the file \fIinfile\fR that contains a list of files (one per line) to
118 check. This list is appended to the list determined from the command line
119 operands (see OPERANDS below).
123 .ne 2
125 \fB\fB-h\fR\fR
127 .RS 18n
128 Prints out the usage information.
132 .ne 2
134 \fB\fB-L\fR\fR
136 .RS 18n
137 \fBappcert\fR examines your product for the presence of shared objects. If it
138 finds some, it appends the directories they reside in to \fBLD_LIBRARY_PATH\fR.
139 Use this flag to prevent \fBappcert\fR from doing this.
143 .ne 2
145 \fB\fB-n\fR\fR
147 .RS 18n
148 When searching directories for binaries to check, this option does not follow
149 symbolic links. See \fBfind\fR(1).
153 .ne 2
155 \fB\fB-S\fR\fR
157 .RS 18n
158 Appends Solaris library directories (that is,
159 \fB/usr/openwin/lib:/usr/dt/lib\fR) to \fBLD_LIBRARY_PATH\fR.
163 .ne 2
165 \fB\fB-w\fR \fIworking_dir\fR\fR
167 .RS 18n
168 Identifies the directory in which to run the library components and create
169 temporary files (default is \fB/tmp\fR).
172 .SH OPERANDS
175 The following operands are supported:
177 .ne 2
179 \fB{\fIobj\fR | \fIdir\fR}  ...\fR
181 .RS 20n
182 A complete list of objects and/or directories that contain the objects
183 constituting the product to be checked. \fBappcert\fR recursively searches
184 directories looking for object files; non-object files are ignored.
187 .SH EXIT STATUS
190 The following exit values are returned:
192 .ne 2
194 \fB\fB0\fR\fR
196 .RS 5n
197 \fBappcert\fR ran successfully and found no potential binary stability
198 problems.
202 .ne 2
204 \fB\fB1\fR\fR
206 .RS 5n
207 \fBappcert\fR failed to run successfully.
211 .ne 2
213 \fB\fB2\fR\fR
215 .RS 5n
216 Some of the objects checked have potential binary stability problems.
220 .ne 2
222 \fB\fB3\fR\fR
224 .RS 5n
225 No binary objects were located that could be checked.
228 .SH LIMITATIONS
231 If the object file to be examined depends on libraries, those dependencies must
232 be recorded in it (by using the compiler's \fB-l\fR switch).
235 If the object file to be examined depends on other shared libraries, those
236 libraries must be accessible via \fBLD_LIBRARY_PATH\fR or \fBRUNPATH\fR when
237 \fBappcert\fR is run.
240 To check 64-bit applications, the machine must be running the 64-bit Solaris
241 kernel. See \fBisalist\fR(1). Also, the checks for static linking are currently
242 not done on 64-bit applications.
245 \fBappcert\fR cannot examine:
246 .RS +4
248 .ie t \(bu
249 .el o
250 Object files that are completely or partially statically linked.
252 .in +2
253 Completely statically linked objects are reported as unstable.
254 .in -2
256 .RS +4
258 .ie t \(bu
259 .el o
260 Executable files that do not have execute permission set.
262 .in +2
263 These are skipped. Shared objects without execute permission are not skipped.
264 .in -2
266 .RS +4
268 .ie t \(bu
269 .el o
270 Object files that are setuid root.
272 .in +2
273 Due to limitations in \fBldd\fR(1), these are skipped. Copy and/or change the
274 permissions to check them.
275 .in -2
277 .RS +4
279 .ie t \(bu
280 .el o
281 Non-\fBELF\fR file executables such as shell scripts.
283 .RS +4
285 .ie t \(bu
286 .el o
287 Non-C language interfaces to Solaris; for example, C++ and Java.
289 .in +2
290 The code itself need not be in C as long as the calls to Solaris libaries are
291 in C.
292 .in -2
294 .SH OUTPUT FILES
297 \fBappcert\fR records its findings in the following files in the working
298 directory (\fB/tmp/appcert.\fI?????\fR\fR by default):
300 .ne 2
302 \fB\fBIndex\fR\fR
304 .RS 11n
305 A mapping between checked binaries and the subdirectory in the working
306 directory in which the output specific to that binary can be found.
310 .ne 2
312 \fB\fBReport\fR\fR
314 .RS 11n
315 A copy of the rollup report that was displayed on stdout when \fBappcert\fR was
316 run.
320 .ne 2
322 \fB\fBSkipped\fR\fR
324 .RS 11n
325 A list of binaries that \fBappcert\fR was asked to check but had to skip, along
326 with a brief reason why each was skipped.
331 In addition, there is per-object information in the subdirectories under
332 \fBappcert.\fI?????\fR/objects/\fR, in the following files:
334 .ne 2
336 \fB\fBcheck.demoted_symbols\fR\fR
338 .RS 25n
339 A list of symbols suspected to be demoted Solaris symbols.
343 .ne 2
345 \fB\fBcheck.dynamic.private\fR\fR
347 .RS 25n
348 A list of private Solaris symbols to which the object makes direct bindings.
352 .ne 2
354 \fB\fBcheck.dynamic.public\fR\fR
356 .RS 25n
357 A list of public Solaris symbols to which the object makes direct bindings.
361 .ne 2
363 \fB\fBcheck.dynamic.unbound\fR\fR
365 .RS 25n
366 A list of symbols not bound by the dynamic linker when \fBldd\fR \fB-r\fR was
367 run. For convenience, \fBldd\fR output lines containing \fBfile not found\fR
368 are also included.
372 .ne 2
374 \fB\fBsummary.dynamic\fR\fR
376 .RS 25n
377 A pretty-printed summary of dynamic bindings for the objects examined,
378 including tables of Public and Private symbols used from each Solaris library.
383 Other files are temporary files used internally by \fBappcert\fR.
384 .SH OUTPUT MESSAGES
385 .SS "Private Symbol Use"
388 Private symbols are functions or data variables in a Solaris library that are
389 not intended for developer or external use. These symbols are interfaces that
390 the Solaris libraries use to call and communicate with one another. They are
391 marked in \fBpvs\fR(1) output with the symbol version name \fBSUNWprivate\fR.
394 Private symbols can change their semantic behavior or even disappear altogether
395 (\fBdemoted\fR or \fBdeprecated\fR symbols), so your application should not
396 depend upon any of them.
397 .SS "Demoted Symbols"
400 Demoted symbols are functions or data variables in a Solaris library that were
401 once private to that library and have been removed (or possibly scoped local to
402 the library) in a later Solaris release. If your application directly calls one
403 of these demoted symbols, it will fail to run (relocation error) on the release
404 in which the symbol was removed and releases thereafter.
407 In some rare cases, a demoted symbol will return in a later release, but
408 nevertheless there are still some releases on which the application will not
409 run.
412 Sun Microsystems Inc. performed most of the library scoping in the transition
413 from Solaris 2.5.1 to 2.6. This action was done to increase binary stability.
414 By making these completely internal interfaces invisible (that is, they cannot
415 be dynamically linked against), a developer cannot accidentally or
416 intentionally call these interfaces. For more information, see the \fILinker
417 and Libraries Guide\fR, in particular the chapter on versioning. This document
418 may be found online at \fBhttp://docs.sun.com\fR.
419 .SS "Unbound Symbols"
422 Unbound symbols are library symbols (that is, functions or data) referenced by
423 the application that the dynamic linker could not resolve when \fBappcert\fR
424 was run. \fBNote:\fR \fBappcert\fR does not actually run your application, so
425 some aspect of the environment that affects dynamic linking might not be set
426 properly.
429 Unbound symbols do not necessarily indicate a potential binary stability
430 problem. They only mean that when \fBappcert\fR was run, the runtime dynamic
431 linker could not resolve these symbols.
434 Unbound symbols might be due to \fBLD_LIBRARY_PATH\fR not being correctly set.
435 Make sure it is set, so that all of your binary objects can find all of the
436 libraries they depend on (either your product's own libraries, Solaris
437 libraries, or those of a third party). Then re-run \fBappcert\fR.
440 You might find it useful to write a shell script that sets up the environment
441 correctly and then runs \fBappcert\fR on the binaries you want to check.
444 Another common cause for unbound symbols is when a shared object under test has
445 not recorded its dynamic dependencies, that is, at build time the \fB-l\fR
446 switch was \fBnot\fR supplied to the compiler and \fBld\fR(1). So the shared
447 object requires that the \fBexecutables\fR that link against it have the
448 correct dependencies recorded.
451 Notice that such a shared object can either be linked in the standard way (that
452 is, specified at an executable's build time) or dynamically opened (for
453 example, an executable calls \fBdlopen\fR(3C) on the shared object sometimes
454 when running). Either case can give rise to unbound symbols when \fBappcert\fR
455 is run. The former can usually be resolved by setting \fBLD_LIBRARY_PATH\fR
456 appropriately before running \fBappcert\fR. The latter (\fBdlopen\fR) is
457 usually difficult to resolve. Under some circumstances, you might be able to
458 set \fBLD_PRELOAD\fR appropriately to preload the needed libraries, but this
459 procedure does not always work.
462 How do you know if the environment has been set up correctly so that there will
463 be no unbound symbols? It must be set up so that running \fBldd\fR \fB-r\fR on
464 the binary yields no "\fBfile not found\fR" or "\fBsymbol not found\fR" errors.
465 See \fBld.so.1\fR(1) and \fBldd\fR(1) for more information on dynamic linking.
468 In any event, \fBappcert\fR flags unbound symbols as a warning in case they
469 might indicate a more serious problem. Unbound symbols can be an indicator of
470 dependencies on demoted symbols (symbols that have been removed from a library
471 or scoped local to it). Dependencies on demoted symbols will lead to serious
472 binary stability problems.
475 However, setting up the environment properly should remove most unbound
476 symbols. In general, it is good practice to record library dependencies at
477 build time whenever possible because it helps make the binary object better
478 defined and self-contained. Also recommended is using the \fB-z\fR \fBdefs\fR
479 flag when building shared objects, to force the resolution of all symbols
480 during compilation. See \fBld\fR(1) for more information.
481 .SS "No Bindings Found"
484 \fBappcert\fR runs \fB/bin/ldd\fR \fB-r\fR on each binary object to be tested.
485 It sets the environment variable \fBLD_DEBUG\fR="\fBfiles,bindings\fR". (See
486 \fBldd\fR(1) and \fBld.so.1\fR(1) for more information). If that command fails
487 for some reason, \fBappcert\fR will have no dynamic symbol binding information
488 and will find "\fBno bindings\fR".
491 \fBappcert\fR can fail if any of the following is true:
492 .RS +4
494 .ie t \(bu
495 .el o
496 The binary object does not have read permission.
498 .RS +4
500 .ie t \(bu
501 .el o
502 The binary object is SUID or SGID and the user does not have sufficient
503 privileges.
505 .RS +4
507 .ie t \(bu
508 .el o
509 The binary object is an executable without the execute permission bit set.
511 .RS +4
513 .ie t \(bu
514 .el o
515 The binary object is completely statically linked.
517 .RS +4
519 .ie t \(bu
520 .el o
521 The binary object has no library dependency information recorded.
525 Other cases exist as well (for example, out of memory). In general, this flag
526 means that \fBappcert\fR could not completely examine the object due to
527 permissions or environment. Try to modify the permissions or environment so
528 that the dynamic bindings can be recorded.
529 .SS "Obsolete Library"
532 An obsolete library is one whose use is deprecated and that might, in some
533 future release, be removed from Solaris altogether. \fBappcert\fR flags these
534 because applications depending on them might not run in future releases of
535 Solaris. All interfaces, including Private ones, in an obsolete library are
536 frozen and will not change.
537 .SS "Use of sys_errlist/sys_nerr"
540 Direct use of the symbols \fBsys_errlist\fR or \fBsys_nerr\fR presents a risk
541 in which reference might be made past the end of the \fBsys_errlist\fR array.
542 These symbols are deprecated in 32-bit versions of Solaris and are absent
543 altogether in 64-bit versions. Use \fBstrerror\fR(3C) instead.
544 .SS "Use of Strong vs. Weak Symbols"
547 The "strong" symbols (for example, \fB_socket\fR) associated with "weak"
548 symbols (for example, \fBsocket\fR ) are reserved as private (their behavior
549 could change in the future). Your application should only directly reference
550 the weak symbol (usually the strong symbols begin with "\fB_\fR").
553 \fBNote:\fR Under certain build environments, the strong/private symbol
554 dependency gets recorded into your binary instead of the weak/public one, even
555 though the source code doesn't appear to reference the private symbol.
556 Nevertheless, steps should be taken to trace down why this is occurring and fix
557 the dependency.
558 .SH NOTES
561 \fBappcert\fR needs to run in the same environment in which the application
562 being checked runs. Otherwise it might not be able to resolve references
563 correctly to interfaces in the Solaris libraries. Take the following steps:
564 .RS +4
567 Make sure that \fBLD_LIBRARY_PATH\fR and any other aspects of the
568 environment are set to whatever settings are used when the application is run.
569 Also make sure that it contains the directories containing any non-Solaris
570 shared objects that are part of the product, so that they can be found when
571 referenced.
573 .RS +4
576 Make sure that all the binaries to be checked:
577 .RS +4
579 .ie t \(bu
580 .el o
581 Are dynamically linked \fBELF\fR objects
583 .RS +4
585 .ie t \(bu
586 .el o
587 Have execute permission set on executables (this is not necessary for shared
588 objects)
590 .RS +4
592 .ie t \(bu
593 .el o
594 Are not \fBSUID\fR root (otherwise you will have to be root to check them; make
595 non-\fBSUID\fR copies and check those if necessary).
600 You might find it useful to write a shell script that sets up the environment
601 correctly and then runs \fBappcert\fR.
604 Some potential problems that can be encountered are:
605 .RS +4
607 .ie t \(bu
608 .el o
609 \fBappcert\fR reports unbound symbols that appear to be part of Solaris
610 libraries.
612 This is probably caused when the application uses \fBdlopen\fR(3C) to access a
613 shared object that does not have its Solaris dependencies recorded.
614 \fBappcert\fR cannot resolve symbol use in such cases, since the dynamic linker
615 is never invoked on the shared object, and there is no other dependency
616 information that could be used to resolve the Solaris symbol bindings. This can
617 also occur with non-Solaris symbols.
619 To avoid this problem, make sure that when a shared object is built, its
620 dependencies on Solaris libraries are explicitly recorded by using the
621 \fB-l\fR\fIlib\fR option on the compile line (see \fBcc\fR(1) and \fBld\fR(1)).
623 .RS +4
625 .ie t \(bu
626 .el o
627 \fBappcert\fR reports that the application uses a Solaris private symbol that
628 is not referenced in the application's source code.
630 This problem is most likely due to static linking of a Solaris library that
631 references that symbol. Since \fBappcert\fR uses the dynamic linker to resolve
632 symbols, statically linked libraries appear to \fBappcert\fR to be part of the
633 application code (which, in a sense, they are). This can also sometimes happen
634 as a result of macro substitution in a Solaris header file.
636 To avoid this problem, whenever possible do not statically link Solaris library
637 archives into your application.
639 .RS +4
641 .ie t \(bu
642 .el o
643 \fBappcert\fR does not recognize a library as part of Solaris.
645 Some obsolete Solaris libraries are so old that they were obsoleted before
646 their symbols could be versioned. Consequently, \fBappcert\fR cannot recognize
647 them as being part of Solaris.
649 .SH BUGS
652 The use of the terms "\fBpublic\fR" and "\fBprivate\fR" as equivalent to
653 "\fBstable\fR" and "\fBunstable\fR" is unfortunately somewhat confusing. In
654 particular, experimental or evolving interfaces are public in the sense that
655 they are documented and their use is encouraged. But they are unstable, because
656 an application built with them might not run on subsequent releases. Thus, they
657 are classified as private for \fBappcert\fR's purposes until they are no longer
658 evolving. Conversely, obsolete interfaces will eventually disappear, and so are
659 unstable, even though they have been public and stable in the past and are
660 still treated as public by \fBappcert\fR. Fortunately, these two situations are
661 rare.
662 .SH ATTRIBUTES
665 See \fBattributes\fR(5) for descriptions of the following attributes:
670 box;
671 c | c
672 l | l .
673 ATTRIBUTE TYPE  ATTRIBUTE VALUE
675 Interface stability     Stable
678 .SH SEE ALSO
681 \fBcc\fR(1), \fBfind\fR(1), \fBisalist\fR(1), \fBld\fR(1), \fBldd\fR(1),
682 \fBld.so.1\fR(1), \fBpvs\fR(1), \fBdlopen\fR(3C), \fBstrerror\fR(3C),
683 \fBIntro\fR(4), \fBattributes\fR(5)