Contact angle hysteresis of a sessile drop on a substrate consists of continuous invasion of liquid phase with the advancing angle (theta(a)) and contact line pinning of liquid phase retreat until the receding angle (theta(r)) is reached. Receding pinning is generally attributed to localized defects that are more wettable than the rest of the surface. However, the defect model cannot explain advancing pinning of liquid phase invasion driven by a deflating bubble and continuous retreat of liquid phase driven by the inflating bubble. A simple thermodynamic model based on adhesion hysteresis is proposed to explain anomalous contact angle hysteresis of a captive bubble quantitatively. The adhesion model involves two solid-liquid interfacial tensions (gamma(sl) > gamma(sl)'). Young's equation with gamma(sl) gives the advancing angle theta(a) while that with gamma(sl)' due to surface rearrangement yields the receding angle theta(r). Our analytical analysis indicates that contact line pinning represents frustration in surface free energy, and the equilibrium shape corresponds to a nondifferential minimum instead of a local minimum. On the basis of our thermodynamic model, Surface Evolver simulations are performed to reproduce both advancing and receding behavior associated with a captive bubble on the acrylic glass.