Bug 373176

Summary: Invalid stack trace
Product: [Developer tools] valgrind Reporter: Sujith Gunawardhane <sujithsg>
Component: generalAssignee: Julian Seward <jseward>
Status: CLOSED NOT A BUG    
Severity: major CC: tom
Priority: NOR    
Version First Reported In: 3.12.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sujith Gunawardhane 2016-12-02 08:09:31 UTC
My Application calls __strcmp_sse42 function but Valgrind shows invalid stack trace.

It seems Valgrind takes the libclntsh.so.12.1 instead of libc-2.11.3.so.


==23093== Invalid read of size 1
==23093==    at 0x8638605: slaac_int (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x863850E: slrac (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x6DACA17: unw_is_signal_frame (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x6D98225: skgdsgframe (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x6C6AF00: kgdsdsts_extra (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x6C6AD35: kgdsdsts (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81DCE5D: dbgemdGetCallStackWFlag (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81DCD33: dbgemdGetCallStack (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81DCED6: dbgemdFillCompFunNames (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81DD5C2: dbgemdFillIncCtx (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81E5D3A: dbgexPopulateIncCtx (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81E3C32: dbgexProcessError (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81AF4A9: dbgeExecuteForError (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x81AEF7E: dbgePostErrorDirect (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x83038A5: kpeDbgSignalHandler (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0x803A49F: skgesig_sigactionHandler (in /x01/app/oracle/product/12.1.0.1/client_1/lib/libclntsh.so.12.1)
==23093==    by 0xB31CBEF: ??? (in /lib64/libc-2.11.3.so)
==23093==    by 0x4C2A75F: __strcmp_sse42 (vg_replace_strmem.c:845)
==23093==    by 0x90E4DB: operator() (MMap.h:46)
==23093==    by 0x90E4DB: find (stl_tree.h:1915)
==23093==    by 0x90E4DB: find (stl_map.h:860)
==23093==    by 0x90E4DB: Get (MMap.h:214)
==23093==    by 0x90E4DB: operator[] (MTable.cpp:1200)
==23093==    by 0xA6331F: MThread_ThreadCallback (MThread.cpp:53)
==23093==    by 0xB6687B5: start_thread (in /lib64/libpthread-2.11.3.so)
==23093==    by 0xB3C3D6C: clone (in /lib64/libc-2.11.3.so)
==23093==  Address 0x70e3e is not stack'd, malloc'd or (recently) free'd
Comment 1 Tom Hughes 2016-12-02 08:55:38 UTC
Not at all - if you look at the top of the Oracle part of the trace you will see it is a signal handler.

So a signal has fired while your program was in strcmp and the signal handler Orcacle has installed has started executing and has accessed memory that it shouldn't, triggering a warning from valgrind.
Comment 2 Sujith Gunawardhane 2016-12-02 09:19:16 UTC
Thanks for the clarification