On Fri, Apr 19, 2013 at 10:13 AM, Qian Hong <fract...@gmail.com> wrote: > Curiosity killed the cat, what is the theory behind this patch?
Hooking is a fragile business. Somebody somewhere is probably making assumptions about how hooking works (like, how many stack frames are pushed), and inlining call_hook_proc probably violates one of those assumptions. > I tried explicitly add 'inline' to every static functions in hook.c > but complie with -O0, to see if the bug can be reproduced in this way, > but nothing happen, this make me doubt being inline is not the > culprit. call_hook_proc is probably the only function whose inlining matters for this problem (since my patch solved your problem at -O2). (inline is only a hint. FORCEINLINE is stronger.) - Dan