Quantcast

Re: Valgrind crash on armv7l

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind crash on armv7l

Frank_wtal
Happy new year!


Am 08.12.2016 14:34 schrieb John Reiser:
> [...]
> Most of the time?  Then run valgrind under gdb, get the traceback
> at the time of the SIGSEGV, and file a bug report against valgrind.
>     $ gdb valgrind
>     (gdb) run --tool=memcheck /path/to/the/smallest/program/which/fails
>     SIGSEGV
>     (gdb) bt
>
>
 
It took some weeks until I found time to set things up, but now I have a backtrace with the actual valgrind version (please ignore the python errors, they exist only because of some mis-configuration of gdb build for the target) - see below.
For me, this looks like there is an issue very early related to detection of the hardware architecture - any idea?
 
best regards,
Frank
 
 
 
---------------------------------------------------------------------------
 

# gdb valgrind
Python Exception <type 'exceptions.ImportError'> No module named gdb:
gdb: warning:
Could not load the Python gdb module from `/usr/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-buildroot-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from valgrind...(no debugging symbols found)...done.
(gdb) run --tool=memcheck /usr/bin/FanCtrl
Starting program: /usr/bin/valgrind --tool=memcheck /usr/bin/FanCtrl
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
process 401 is executing new program: /usr/lib/valgrind/memcheck-arm-linux
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Program received signal SIGILL, Illegal instruction.
0x38051308 in vgPlain_machine_get_hwcaps () at m_machine.c:1608
1608    m_machine.c: No such file or directory.
(gdb) bt
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
#0  0x38051308 in vgPlain_machine_get_hwcaps () at m_machine.c:1608
#1  0x380527d0 in valgrind_main (envp=0xbeff6ca4, argv=0xbeff6c94, argc=3) at m_main.c:1830
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#2  _start_in_C_linux (pArgc=0xbeff6c90) at m_main.c:3407
#3  0x00000000 in ?? ()
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
 
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind crash on armv7l

Philippe Waroquiers
On Wed, 2017-01-04 at 13:43 +0100, [hidden email] wrote:

> Happy new year!
>
>
> Am 08.12.2016 14:34 schrieb John Reiser:
> > [...]
> > Most of the time?  Then run valgrind under gdb, get the traceback
> > at the time of the SIGSEGV, and file a bug report against valgrind.
> >     $ gdb valgrind
> >     (gdb) run --tool=memcheck /path/to/the/smallest/program/which/fails
> >     SIGSEGV
> >     (gdb) bt
> >
> >
>  
> It took some weeks until I found time to set things up, but now I have a backtrace with the actual valgrind version (please ignore the python errors, they exist only because of some mis-configuration of gdb build for the target) - see below.
> For me, this looks like there is an issue very early related to detection of the hardware architecture - any idea?
According to the above, your problem is a SIGSEGV.
But the trace below is a SIGILL.
I think that this last signal is used during hw detection.
You should continue execution till you encounter the 'problematic'
SIGSEGV.
Note also that during execution, some 'normal' SIGSEGV are raised.
On amd64, the bt looks like the below (in generated code).

Program received signal SIGSEGV, Segmentation fault.
0x0000000803646dae in ?? ()
(gdb) bt
#0  0x0000000803646dae in ?? ()
#1  0x0000000802ea5f30 in ?? ()
#2  0x0000000802008390 in ?? ()
#3  0x0000000000405eaa in ?? ()
#4  0x0000000802008390 in ?? ()
#5  0x0000000000001c00 in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb)

Also, have you upgraded to 3.12, as suggested by John ?


Do you have the same problem with the none tool ?

Also, try with --read-inline-info=no

Philippe

>  
> best regards,
> Frank
>  
>  
>  
> ---------------------------------------------------------------------------
>  
>
> # gdb valgrind
> Python Exception <type 'exceptions.ImportError'> No module named gdb:
> gdb: warning:
> Could not load the Python gdb module from `/usr/share/gdb/python'.
> Limited Python support is available from the _gdb module.
> Suggest passing --data-directory=/path/to/gdb/data-directory.
> GNU gdb (GDB) 7.10.1
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "arm-buildroot-linux-gnueabihf".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from valgrind...(no debugging symbols found)...done.
> (gdb) run --tool=memcheck /usr/bin/FanCtrl
> Starting program: /usr/bin/valgrind --tool=memcheck /usr/bin/FanCtrl
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> process 401 is executing new program: /usr/lib/valgrind/memcheck-arm-linux
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Program received signal SIGILL, Illegal instruction.
> 0x38051308 in vgPlain_machine_get_hwcaps () at m_machine.c:1608
> 1608    m_machine.c: No such file or directory.
> (gdb) bt
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
> #0  0x38051308 in vgPlain_machine_get_hwcaps () at m_machine.c:1608
> #1  0x380527d0 in valgrind_main (envp=0xbeff6ca4, argv=0xbeff6c94, argc=3) at m_main.c:1830
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> #2  _start_in_C_linux (pArgc=0xbeff6c90) at m_main.c:3407
> #3  0x00000000 in ?? ()
> Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
>  
>  
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Valgrind-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind crash on armv7l

Frank_wtal
Hi Philippe,

> Also, have you upgraded to 3.12, as suggested by John ?
 
Yes,I updated to 3.12 - could not see any difference to 3.11.

> Also, try with --read-inline-info=no
All the tests I did now (and the backtraces below) are done with this option now -- does not seem to make any difference.

> Do you have the same problem with the none tool ?
You mean "--tool=none"? Looks like it isn't available...
    # valgrind   --tool=none --read-inline-info=no /usr/bin/FanCtrl
    valgrind: failed to start tool 'none' for platform 'arm-linux': No such file or directory

> According to the above, your problem is a SIGSEGV.
> But the trace below is a SIGILL.
> I think that this last signal is used during hw detection.
> You should continue execution till you encounter the 'problematic'
> SIGSEGV.

You are right - I didn't notice that.
If I continue, I hit a SIGSEGV. But this segmentation violation does not happen always at the same code position (I have different backtraces).
One backtrace (I removed the python error lines out of it for better readability):

Program received signal SIGSEGV, Segmentation fault.
resize (table=0x6150cd00) at m_hashtable.c:131
131     m_hashtable.c: No such file or directory.
(gdb) bt
#0  resize (table=0x6150cd00) at m_hashtable.c:131
#1  vgPlain_HT_add_node (table=0x6150cd00, vnode=<optimized out>)
    at m_hashtable.c:152
#2  0x38100d54 in vgPlain_allocEltDedupPA (
    elt=0x38b54a5c <vgPlain_interim_stack+1032856>, eltSzB=36, ddpa=0x61d9a480)
    at m_deduppoolalloc.c:296
#3  vgPlain_allocFixedEltDedupPA (ddpa=0x61d9a480, eltSzB=eltSzB@entry=36,
    elt=elt@entry=0x38b54a5c <vgPlain_interim_stack+1032856>)
    at m_deduppoolalloc.c:319
#4  0x3809eb6c in vgModuleLocal_addDiCfSI (di=di@entry=0x61d9e290,
    base=<optimized out>, len=4,
    cfsi_m=0x38b54a5c <vgPlain_interim_stack+1032856>,
    cfsi_m@entry=0x38b54a44 <vgPlain_interim_stack+1032832>)
    at m_debuginfo/storage.c:839
#5  0x38118368 in run_CF_instructions (
    adi=0x38b54a68 <vgPlain_interim_stack+1032868>,
    restore_ctx=0x38b572f0 <vgPlain_interim_stack+1043244>, fde_arange=0,
    ilen=6772, instrs=..., ctx=0x38b54aac <vgPlain_interim_stack+1032936>,
    record=1 '\001', di=0x61d9e290) at m_debuginfo/readdwarf.c:3616
#6  vgModuleLocal_read_callframe_info_dwarf3 (di=di@entry=0x61d9e290,
    escn_frame=..., frame_avma=frame_avma@entry=0,
    is_ehframe=is_ehframe@entry=0 '\000') at m_debuginfo/readdwarf.c:4182
#7  0x38093580 in vgModuleLocal_read_elf_debug_info (di=di@entry=0x61d9e290)
    at m_debuginfo/readelf.c:3082
#8  0x3808a320 in di_notify_ACHIEVE_ACCEPT_STATE (di=0x61d9e290)
    at m_debuginfo/debuginfo.c:749
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#9  vgPlain_di_notify_mmap (a=<optimized out>,
    allow_SkFileV=allow_SkFileV@entry=1 '\001', use_fd=use_fd@entry=-1)
    at m_debuginfo/debuginfo.c:1067
#10 0x38054bb4 in valgrind_main (envp=<optimized out>, argv=<optimized out>,
    argc=<optimized out>) at m_main.c:2224
#11 _start_in_C_linux (pArgc=<optimized out>) at m_main.c:3407
#12 0x00000000 in ?? ()


Another run causes a bt that starts with this:
(gdb) bt
#0  vgPlain_HT_gen_lookup (table=<optimized out>,
    node=0x38b54788 <vgPlain_interim_stack+1032132>,
    node@entry=0x38b54780 <vgPlain_interim_stack+1032124>,
    cmp=cmp@entry=0x38100404 <cmp_pool_elt>) at m_hashtable.c:182
#1  0x38100c24 in vgPlain_allocEltDedupPA (
    elt=0x38b54a5c <vgPlain_interim_stack+1032856>, eltSzB=36, ddpa=0x61cdb480)
    at m_deduppoolalloc.c:266
#2  vgPlain_allocFixedEltDedupPA (ddpa=0x61cdb480, eltSzB=eltSzB@entry=36,
    elt=elt@entry=0x38b54a5c <vgPlain_interim_stack+1032856>)
    at m_deduppoolalloc.c:319
#3  0x3809eb6c in vgModuleLocal_addDiCfSI (di=di@entry=0x61cdf290,
    base=<optimized out>, len=4,
    cfsi_m=0x38b54a5c <vgPlain_interim_stack+1032856>,
    cfsi_m@entry=0x38b54a44 <vgPlain_interim_stack+1032832>)
    at m_debuginfo/storage.c:839
#4  0x38118368 in run_CF_instructions (
    adi=0x38b54a68 <vgPlain_interim_stack+1032868>,
    restore_ctx=0x38b572f0 <vgPlain_interim_stack+1043244>, fde_arange=0,
    ilen=40, instrs=..., ctx=0x38b54aac <vgPlain_interim_stack+1032936>,
    record=1 '\001', di=0x61cdf290) at m_debuginfo/readdwarf.c:3616
#5  vgModuleLocal_read_callframe_info_dwarf3 (di=di@entry=0x61cdf290,
    escn_frame=..., frame_avma=frame_avma@entry=0,
    is_ehframe=is_ehframe@entry=0 '\000') at m_debuginfo/readdwarf.c:4182
---Type <return> to continue, or q <return> to quit---
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#6  0x38093580 in vgModuleLocal_read_elf_debug_info (di=di@entry=0x61cdf290)
    at m_debuginfo/readelf.c:3082
#7  0x3808a320 in di_notify_ACHIEVE_ACCEPT_STATE (di=0x61cdf290)
    at m_debuginfo/debuginfo.c:749

I have also seen a backtrace that ended in some other file, but I failed to save it.


> Note also that during execution, some 'normal' SIGSEGV are raised.
> On amd64, the bt looks like the below (in generated code).
> [...]

This does not seem to happen in my case. I do not see anything that looks similar, and if i press 'c' (continue) after the first SIGSEGV, I get:

    (gdb) c
    Continuing.

    Program terminated with signal SIGSEGV, Segmentation fault.
    The program no longer exists.


Frank

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Loading...