When I didn't have any blockchain files it would crash on unmapping somewhere in cleanMaps, but with blockchain data it dies on:
while(i!=e) totalSize += (i++)->size;
in initHashtables.
ovrlrdq@thedarkcitadel:/tmp/blockparser$ ./parser stats
info: starting command "simpleStats"
Segmentation fault (core dumped)
ovrlrdq@thedarkcitadel:/tmp/blockparser$ gdb parser core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /tmp/blockparser/parser...done.
[New LWP 20039]
warning: Can't read pathname for load map: Input/output error.
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fffb238a000
Core was generated by `./parser stats'.
Program terminated with signal 11, Segmentation fault.
#0 0x000000000044f2d3 in google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_hash_map > >::SelectKey, google::dense_hash_map > >::SetKey, Hash256Equal, google::libc_allocator_with_realloc > >::dense_hashtable(google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_hash_map > >::SelectKey, google::dense_hash_map > >::SetKey, Hash256Equal, google::libc_allocator_with_realloc > > const&, unsigned long) ()
(gdb) bt
#0 0x000000000044f2d3 in google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_hash_map > >::SelectKey, google::dense_hash_map > >::SetKey, Hash256Equal, google::libc_allocator_with_realloc > >::dense_hashtable(google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_hash_map > >::SelectKey, google::dense_hash_map > >::SetKey, Hash256Equal, google::libc_allocator_with_realloc > > const&, unsigned long) ()
#1 0x000000000044b8fc in initHashtables() ()
#2 0x0000000000404c4c in main ()
Valgrind output:
info: starting command "simpleStats"
==22223== Invalid write of size 8
==22223== at 0x44EA23: google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_ha
sh_maphar const*> > >::SelectKey, google::dense_hash_map:pair > >::SetKey, Hash256Equal, google::libc_allocator_with_reallocd char const*> > >::dense_hashtable(google::dense_hashtable, unsigned char const*, Hash256Hasher, google
::dense_hash_mapunsigned char const*> > >::SelectKey, google::dense_hash_mapalloc > >::SetKey, Hash256Equal, google::libc_allocator_with_realloct, unsigned char const*> > > const&, unsigned long) (in /tmp/blockparser/parser)
==22223== by 0x44B76D: initHashtables() (in /tmp/blockparser/parser)
==22223== by 0x404C4B: main (in /tmp/blockparser/parser)
==22223== Address 0x10 is not stack'd, malloc'd or (recently) free'd
==22223==
==22223==
==22223== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==22223== Access not within mapped region at address 0x10
==22223== at 0x44EA23: google::dense_hashtable, unsigned char const*, Hash256Hasher, google::dense_ha
sh_maphar const*> > >::SelectKey, google::dense_hash_map:pair > >::SetKey, Hash256Equal, google::libc_allocator_with_reallocd char const*> > >::dense_hashtable(google::dense_hashtable, unsigned char const*, Hash256Hasher, google
::dense_hash_mapunsigned char const*> > >::SelectKey, google::dense_hash_mapalloc > >::SetKey, Hash256Equal, google::libc_allocator_with_realloct, unsigned char const*> > > const&, unsigned long) (in /tmp/blockparser/parser)
==22223== by 0x44B76D: initHashtables() (in /tmp/blockparser/parser)
==22223== by 0x404C4B: main (in /tmp/blockparser/parser)