Requirements
------------
-YouneedarecentSolaris-likeOStocompilethisport.Solaris11or
anyillumos-baseddistributionshouldwork,Solaris10isnotsupported.
Running`uname-r`hastoprint'5.11'.
-RecentGCCtoolsarerequired,GCC3willprobablynotwork.GCCversion
4.5(orhigher)isrecommended.
-SolarisldhastobethefirstlinkerinthePATH.GNUldcannotbeused.
Thereiscurrentlynolinkercheckintheconfigurescriptbutthelinking
phasefailsifGNUldisused.RecentSolaris/illumosdistributionsareok.
-Aworkingcombinationofautotoolsisrequired:aclocal,autoheader,
automakeandautoconfhavetobefoundinthePATH.Youshouldbeableto
installpkg:/developer/build/automakeandpkg:/developer/build/autoconf
packagestofulfilthisrequirement.
-Systemheaderfilesarerequired.OnSolaris,thesecanbeinstalledwith:
#pkginstallsystem/header
-GNUmakeisalsorequired.OnSolaris,thiscanbequicklyachievedwith:
$PATH=/usr/gnu/bin:$PATH;exportPATH
-Forremotedebuggingsupport,workingGDBisrequired(seebelow).
-Forrunningregressiontests,GNUsed,grep,awk,diffarerequired.
ThiscanbequicklyachievedonSolarisbyprepending/usr/gnu/bintoPATH.
Compilation
-----------
PleasefollowthegenericinstructionsintheREADMEfile.
Theconfigurescriptdetectsacanonicalhosttodeterminewhichversionof
Valgrindshouldbebuilt.Ifthesystemcompilerbydefaultproduces32-bit
binariesthenonlya32-bitversionofValgrindwillbebuilt.Toenable
compilationofboth64-bitand32-bitversionsonsuchasystem,issuethe
configurescriptasfollows:
./configureCC='gcc-m64'CXX='g++-m64'
OracleSolarisandillumossupport
----------------------------------
OneofthemaingoalofthisportistosupportbothOracleSolarisand
illumoskernels.ThisisaveryhardtaskbecauseSolariskerneltraditionally
doesnotprovideastablesyscallinterfaceandbecauseValgrindcontains
severalpartsthatarecloselytiedtotheunderlyingkernel.Forthese
reasons,theportneedstodetectwhichsyscallinterfacesarepresent.This
detectioncannotbedoneeasilyatruntimeandiscurrentlyimplementedas
asetofconfiguretests.Thismeansthatabinaryversionofthisportcanbe
executedonlyonakernelthatiscompatiblewithakernelthatwasused
duringtheconfigureandcompilationtime.
Maincurrently-knownincompatibilities:
-Solaris11(releasedinNovember2011)removedalargesetofsyscallswhere
*atvariantofthesyscallwasalsopresent,forexample,open()versus
openat(AT_FDCWD)[1]
-syscallnumberforunlinkat()is76onSolaris11,but65onillumos[2]
-illumos(inApril2013)changedinterfaceoftheaccept()andpipe()
syscalls[3]
-posix_spawn()functionalityisbackedupbytruespawn()syscallonSolaris12
whereasillumosandSolaris11leveragevfork()
-illumosandolderSolarisuseutimesys()syscallwhereasnewerSolaris
usesutimensat()
[1]http://docs.oracle.com/cd/E26502_01/html/E28556/gkzlf.html#gkzip
[2]https://www.illumos.org/issues/521
[3]https://github.com/illumos/illumos-gate/commit/5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e
Limitations
-----------
-TheportisWork-In-Progress,manythingsmaynotworkortheycanbesubtly
broken.
-CoredumpsproducedbyValgrinddonotcontainallinformationavailable,
especiallymicrostateaccountingandprocessorbindings.
-Accessingcontentsof/proc/self/psinfoisnotthread-safe.Thatisbecause
Valgrindemulatesthisfileonbehalfoftheclientprograms.Entire
open()-read()-close()sequenceonthisfileneedstobeperformed
atomically.
-Forklimitations:vfork()istranslatedtofork(),forkall()isnot
supported.
-Valgrinddoesnottrackdefinednessofsomeeflags(OF,SF,ZF,AF,CF,PF)
individuallyforeachflag.Afterasyscallisfinished,whenacarryflag
issetanddefined,allothermentionedflagswillbealsodefinedeven
thoughtheymightbeundefinedbeforemakingthesyscall.
-Systemcall"execve"withafiledescriptorwhichpointstoahardlink
iscurrentlynotsupported.Thatisbecausefromtheopenedfiledescriptor
itselfitisnotpossibletoreversemaptheintendedpathname.
Examplesarefexecve(3C)andisaexec(3C).
-ProgramheadersPT_SUNW_SYSSTATandPT_SUNW_SYSSTAT_ZONEarenotsupported.
Thatis,programslinkedwithmapfiledirectiveRESERVE_SEGMENTandattribute
TYPEequaltoSYSSTATorSYSSTAT_ZONEwillcauseValgrindexit.Itisnot
possibleforValgrindtoarrangemappingofakernelsharedpageatthe
addressspecifiedinthemapfilefortheguestapplication.Thereiscurrently
nosuchmechanisminSolaris.Hackyworkaroundsarepossible,though.
-WhenathreadhasnostackthenallsystemcallswillresultinValgrind
crash,eventhoughsuchsystemcallsusejustparameterspassedinregisters.
Thisshouldhappenonlyinpathologicalsituationswhenathreadiscreated
withcustommmap'edstackandthisstackisthenunmap'edduringthread
execution.
Remotedebuggingsupport
------------------------
SolarisportofGDBhasamajorflawwhichpreventsremotedebuggingfrom
workingcorrectly.Fortunatelythisflawhasaneasyfix[4].Unfortunately
itisnotpresentinthecurrentGDB7.6.2.Thisboilsdowntoseveral
options:
-UseGDBshippedwithSolaris11.2whichhasthisflawfixed.
-WaituntilGDB7.7becomesavailable(therewon'tbeother7.6.xreleases).
-BuildGDB7.6.2withthefixbyyourselfusingthefollowingsteps:
#pkginstalldeveloper/gnu-binutils
$wgethttp://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.gz
$gzip-dcgdb-7.6.2.tar.gz|tarxf-
$cdgdb-7.6.2
$patch-p1-i/path/to/valgrind-solaris/solaris/gdb-sol-thread.patch
$exportLIBS="-lncurses"
$exportCC="gcc-m64"
$./configure--with-x=no--with-curses--with-libexpat-prefix=/usr/lib
$gmake&&gmakeinstall
[4]https://sourceware.org/ml/gdb-patches/2013-12/msg00573.html
TODOlist
---------
-Fixfewremainingfailingtests.
-AddmoreSolaris-specifictests(especiallyforthedoorandspawn
syscalls).
-Providebettererrorreportingforvarioussubsyscalls.
-Implementstoringofextraregisterstateinsignalframe.
-Performancecomparisonagainstotherplatforms.
-PreventSIGPIPEwhenwritingtoasocket(coregrind/m_libcfile.c).
-Implementticketlockingforfairscheduling(--fair-sched=yes).
-ImplementsupportinDRDandHelgrindtoolsforthr_join()withthread==0.
-Addsupportforaccessingthread-localvariablesviagdb(auxprogs/getoff.c).
RequiresresearchoninternallibcTLSrepresentation.
-VEXsupportsAVX,BMIandAVX2.Investigateiftheycanbeenabledon
Solaris/illumos.
-InvestigatesupportformoreflagsinAT_SUN_AUXFLAGS.
-FixValgrindcrashwhenathreadhasnostackandsyswrap-main.caccesses
allpossiblesyscallparameters.Enablehelgrind/tests/stackteardown.c
toseethisineffect.Wouldrequireawarenessofsyscallparametersemantics.
-CorrectlyprintargumentsofDW_CFA_ORCL_arg_locinshow_CF_instruction()when
itisimplementedinlibdwarf.
-HandleasituationwhenguestprogramsetsSC_CANCEL_FLGinschedctland
Valgrindneedstoinvokeasyscallonitsown.
Contacts
--------
Pleasesendbugreportsandanyquestionsabouttheportto:
IvoRaisr<ivosh@ivosh.net>
PetrPavlu<setup@dagobah.cz>