1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>12.README.solaris</title>
<link rel="stylesheet" type="text/css" href="vg_basic.css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Valgrind Documentation">
<link rel="up" href="dist.html" title="Valgrind Distribution Documents">
<link rel="prev" href="dist.readme-mips.html" title="11.README.mips">
<link rel="next" href="licenses.html" title="GNU Licenses">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div><table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"><tr>
<td width="22px" align="center" valign="middle"><a accesskey="p" href="dist.readme-mips.html"><img src="images/prev.png" width="18" height="21" border="0" alt="Prev"></a></td>
<td width="25px" align="center" valign="middle"><a accesskey="u" href="dist.html"><img src="images/up.png" width="21" height="18" border="0" alt="Up"></a></td>
<td width="31px" align="center" valign="middle"><a accesskey="h" href="index.html"><img src="images/home.png" width="27" height="20" border="0" alt="Up"></a></td>
<th align="center" valign="middle">Valgrind Distribution Documents</th>
<td width="22px" align="center" valign="middle"><a accesskey="n" href="licenses.html"><img src="images/next.png" width="18" height="21" border="0" alt="Next"></a></td>
</tr></table></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="dist.readme-solaris"></a>12.README.solaris</h1></div></div></div>
<div class="literallayout"><p><br>
Requirements<br>
------------<br>
-YouneedarecentSolaris-likeOStocompilethisport.Solaris11or<br>
anyillumos-baseddistributionshouldwork,Solaris10isnotsupported.<br>
Running`uname-r`hastoprint'5.11'.<br>
-RecentGCCtoolsarerequired,GCC3willprobablynotwork.GCCversion<br>
4.5(orhigher)isrecommended.<br>
-SolarisldhastobethefirstlinkerinthePATH.GNUldcannotbeused.<br>
Thereiscurrentlynolinkercheckintheconfigurescriptbutthelinking<br>
phasefailsifGNUldisused.RecentSolaris/illumosdistributionsareok.<br>
-Aworkingcombinationofautotoolsisrequired:aclocal,autoheader,<br>
automakeandautoconfhavetobefoundinthePATH.Youshouldbeableto<br>
installpkg:/developer/build/automakeandpkg:/developer/build/autoconf<br>
packagestofulfilthisrequirement.<br>
-Systemheaderfilesarerequired.OnSolaris,thesecanbeinstalledwith:<br>
#pkginstallsystem/header<br>
-GNUmakeisalsorequired.OnSolaris,thiscanbequicklyachievedwith:<br>
$PATH=/usr/gnu/bin:$PATH;exportPATH<br>
-Forremotedebuggingsupport,workingGDBisrequired(seebelow).<br>
-Forrunningregressiontests,GNUsed,grep,awk,diffarerequired.<br>
ThiscanbequicklyachievedonSolarisbyprepending/usr/gnu/bintoPATH.<br>
<br>
<br>
Compilation<br>
-----------<br>
PleasefollowthegenericinstructionsintheREADMEfile.<br>
<br>
Theconfigurescriptdetectsacanonicalhosttodeterminewhichversionof<br>
Valgrindshouldbebuilt.Ifthesystemcompilerbydefaultproduces32-bit<br>
binariesthenonlya32-bitversionofValgrindwillbebuilt.Toenable<br>
compilationofboth64-bitand32-bitversionsonsuchasystem,issuethe<br>
configurescriptasfollows:<br>
./configureCC='gcc-m64'CXX='g++-m64'<br>
<br>
<br>
OracleSolarisandillumossupport<br>
----------------------------------<br>
OneofthemaingoalofthisportistosupportbothOracleSolarisand<br>
illumoskernels.ThisisaveryhardtaskbecauseSolariskerneltraditionally<br>
doesnotprovideastablesyscallinterfaceandbecauseValgrindcontains<br>
severalpartsthatarecloselytiedtotheunderlyingkernel.Forthese<br>
reasons,theportneedstodetectwhichsyscallinterfacesarepresent.This<br>
detectioncannotbedoneeasilyatruntimeandiscurrentlyimplementedas<br>
asetofconfiguretests.Thismeansthatabinaryversionofthisportcanbe<br>
executedonlyonakernelthatiscompatiblewithakernelthatwasused<br>
duringtheconfigureandcompilationtime.<br>
<br>
Maincurrently-knownincompatibilities:<br>
-Solaris11(releasedinNovember2011)removedalargesetofsyscallswhere<br>
*atvariantofthesyscallwasalsopresent,forexample,open()versus<br>
openat(AT_FDCWD)[1]<br>
-syscallnumberforunlinkat()is76onSolaris11,but65onillumos[2]<br>
-illumos(inApril2013)changedinterfaceoftheaccept()andpipe()<br>
syscalls[3]<br>
-posix_spawn()functionalityisbackedupbytruespawn()syscallonSolaris11.4<br>
whereasillumosandSolaris11.3leveragevfork()<br>
-illumosandolderSolarisuseutimesys()syscallwhereasnewerSolaris<br>
usesutimensat()<br>
<br>
[1]http://docs.oracle.com/cd/E26502_01/html/E28556/gkzlf.html#gkzip<br>
[2]https://www.illumos.org/issues/521<br>
[3]https://github.com/illumos/illumos-gate/commit/5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e<br>
<br>
<br>
Limitations<br>
-----------<br>
-TheportisWork-In-Progress,manythingsmaynotworkortheycanbesubtly<br>
broken.<br>
-CoredumpsproducedbyValgrinddonotcontainallinformationavailable,<br>
especiallymicrostateaccountingandprocessorbindings.<br>
-Accessingcontentsof/proc/self/psinfoisnotthread-safe.Thatisbecause<br>
Valgrindemulatesthisfileonbehalfoftheclientprograms.Entire<br>
open()-read()-close()sequenceonthisfileneedstobeperformed<br>
atomically.<br>
-Forklimitations:vfork()istranslatedtofork(),forkall()isnot<br>
supported.<br>
-Valgrinddoesnottrackdefinednessofsomeeflags(OF,SF,ZF,AF,CF,PF)<br>
individuallyforeachflag.Afterasyscallisfinished,whenacarryflag<br>
issetanddefined,allothermentionedflagswillbealsodefinedeven<br>
thoughtheymightbeundefinedbeforemakingthesyscall.<br>
-Systemcall"execve"withafiledescriptorwhichpointstoahardlink<br>
iscurrentlynotsupported.Thatisbecausefromtheopenedfiledescriptor<br>
itselfitisnotpossibletoreversemaptheintendedpathname.<br>
Examplesarefexecve(3C)andisaexec(3C).<br>
-ProgramheadersPT_SUNW_SYSSTATandPT_SUNW_SYSSTAT_ZONEarenotsupported.<br>
Thatis,programslinkedwithmapfiledirectiveRESERVE_SEGMENTandattribute<br>
TYPEequaltoSYSSTATorSYSSTAT_ZONEwillcauseValgrindexit.Itisnot<br>
possibleforValgrindtoarrangemappingofakernelsharedpageatthe<br>
addressspecifiedinthemapfilefortheguestapplication.Thereiscurrently<br>
nosuchmechanisminSolaris.Hackyworkaroundsarepossible,though.<br>
-WhenathreadhasnostackthenallsystemcallswillresultinValgrind<br>
crash,eventhoughsuchsystemcallsusejustparameterspassedinregisters.<br>
Thisshouldhappenonlyinpathologicalsituationswhenathreadiscreated<br>
withcustommmap'edstackandthisstackisthenunmap'edduringthread<br>
execution.<br>
<br>
<br>
Remotedebuggingsupport<br>
------------------------<br>
SolarisportofGDBhasamajorflawwhichpreventsremotedebuggingfrom<br>
workingcorrectly.Fortunatelythisflawhasaneasyfix[4].Unfortunately<br>
itisnotpresentinthecurrentGDB7.6.2.Thisboilsdowntoseveral<br>
options:<br>
-UseGDBshippedwithSolaris11.2whichhasthisflawfixed.<br>
-WaituntilGDB7.7becomesavailable(therewon'tbeother7.6.xreleases).<br>
-BuildGDB7.6.2withthefixbyyourselfusingthefollowingsteps:<br>
#pkginstalldeveloper/gnu-binutils<br>
$wgethttp://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.gz<br>
$gzip-dcgdb-7.6.2.tar.gz|tarxf-<br>
$cdgdb-7.6.2<br>
$patch-p1-i/path/to/valgrind-solaris/solaris/gdb-sol-thread.patch<br>
$exportLIBS="-lncurses"<br>
$exportCC="gcc-m64"<br>
$./configure--with-x=no--with-curses--with-libexpat-prefix=/usr/lib<br>
$gmake&&gmakeinstall<br>
<br>
[4]https://sourceware.org/ml/gdb-patches/2013-12/msg00573.html<br>
<br>
<br>
TODOlist<br>
---------<br>
-Fixfewremainingfailingtests.<br>
-AddmoreSolaris-specifictests(especiallyforthedoorandspawn<br>
syscalls).<br>
-Providebettererrorreportingforvarioussubsyscalls.<br>
-Implementstoringofextraregisterstateinsignalframe.<br>
-Performancecomparisonagainstotherplatforms.<br>
-PreventSIGPIPEwhenwritingtoasocket(coregrind/m_libcfile.c).<br>
-Implementticketlockingforfairscheduling(--fair-sched=yes).<br>
-ImplementsupportinDRDandHelgrindtoolsforthr_join()withthread==0.<br>
-Addsupportforaccessingthread-localvariablesviagdb(auxprogs/getoff.c).<br>
RequiresresearchoninternallibcTLSrepresentation.<br>
-VEXsupportsAVX,BMIandAVX2.Investigateiftheycanbeenabledon<br>
Solaris/illumos.<br>
-InvestigatesupportformoreflagsinAT_SUN_AUXFLAGS.<br>
-FixValgrindcrashwhenathreadhasnostackandsyswrap-main.caccesses<br>
allpossiblesyscallparameters.Enablehelgrind/tests/stackteardown.c<br>
toseethisineffect.Wouldrequireawarenessofsyscallparametersemantics.<br>
-CorrectlyprintargumentsofDW_CFA_ORCL_arg_locinshow_CF_instruction()when<br>
itisimplementedinlibdwarf.<br>
-HandleasituationwhenguestprogramsetsSC_CANCEL_FLGinschedctland<br>
Valgrindneedstoinvokeasyscallonitsown.<br>
<br>
<br>
SummaryofSolaris11KernelInterfacesUsed<br>
--------------------------------------------<br>
Valgrindusesdirectlythefollowingkernelinterfaces(notexhaustivelist).<br>
Then,ofcourse,ithasveryintimateknowledgeofallsyscalls,manyioctls<br>
andsomedoorcallsbecauseithaswrappersaroundthem.<br>
-Syscalls:<br>
.clock_gettime<br>
.close<br>
.connect<br>
.execve<br>
.exit<br>
.faccessat<br>
.fcntl<br>
.forksys<br>
.fstatat<br>
.getcwd<br>
.getdents<br>
.geteuid<br>
.getgid<br>
.getgroups<br>
.getpeername<br>
.getpid<br>
.getrlimit<br>
.getsockname<br>
.getsockopt<br>
.gettimeofday<br>
.kill<br>
.lseek<br>
.lwp_create<br>
.lwp_exit<br>
.lwp_self<br>
.lwp_sigqueue<br>
.mknodat<br>
.mmap<br>
.mprotect<br>
.munmap<br>
.openat<br>
.pipe<br>
.pollsys<br>
.pread<br>
.prgpsys<br>
.pwrite<br>
.read<br>
.readlinkat<br>
.renameat<br>
.rt_sigprocmask<br>
.send<br>
.setrlimit<br>
.setsockopt<br>
.sigaction<br>
.sigreturn<br>
.sigtimedwait<br>
.so_socket<br>
.spawn<br>
.uname<br>
.unlinkat<br>
.waitsys<br>
.write<br>
-Signalframes.Valgrinddecomposesandsynthetizessignalframes.<br>
-Flagsc_sigblockflagintheschedctlstructurebyreplacing<br>
functionblock_all_signals()fromlibc.Thereplacementemulateslwp_sigmask<br>
syscall.Moredetailsincoregrind/vg_preloaded.c.<br>
-Initialstacklayoutforthemainthreadissynthetized.<br>
-procfsagentthreadandotherprocfscommandsformanipulatingtheprocess.<br>
-mmapobjsyscallisemulatedbecauseitgetsinthewayoftheaddressspace<br>
manager'scontrol.<br>
<br>
<br>
Contacts<br>
--------<br>
Pleasesendbugreportsandanyquestionsabouttheportto:<br>
IvoRaisr<ivosh@ivosh.net><br>
PetrPavlu<setup@dagobah.cz><br>
<br>
</p></div>
</div>
<div>
<br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
<tr>
<td rowspan="2" width="40%" align="left">
<a accesskey="p" href="dist.readme-mips.html"><<11.README.mips</a></td>
<td width="20%" align="center"><a accesskey="u" href="dist.html">Up</a></td>
<td rowspan="2" width="40%" align="right"><a accesskey="n" href="licenses.html">GNU Licenses>></a>
</td>
</tr>
<tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
</table>
</div>
</body>
</html>
|