Bug 363497 - Crash if i run valgrind on any working program -> valgrind: the 'impossible' happened: LibVEX called failure_exit()
Summary: Crash if i run valgrind on any working program -> valgrind: the 'impossible' ...
Status: RESOLVED DUPLICATE of bug 356393
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.11.0
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 09:58 UTC by gabriel.montauro
Modified: 2016-05-30 14:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
OpenSSL wiki example c source (4.05 KB, text/plain)
2016-05-30 13:48 UTC, Tyler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gabriel.montauro 2016-05-25 09:58:54 UTC
I'm a student trying to find memory leaks in a C99 soft I'm working on.
using the simplest input for valgrind:  valgrind ./mySoft 
crashes everytime.
mySoft is a picture Database manager and works quite fine when I don't use valgrind.

Reproducible: Always

Steps to Reproduce:
1.run valgrind on executable

Actual Results:  
==29542== Memcheck, a memory error detector
==29542== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==29542== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==29542== Command: ./pictDBM
==29542== 

vex: the `impossible' happened:
   isZeroU
vex storage: T total 691854880 bytes allocated
vex storage: P total 640 bytes allocated

valgrind: the 'impossible' happened:
   LibVEX called failure_exit().

host stacktrace:
==29542==    at 0x38083F48: show_sched_status_wrk (m_libcassert.c:343)
==29542==    by 0x38084064: report_and_quit (m_libcassert.c:415)
==29542==    by 0x380842A1: panic (m_libcassert.c:491)
==29542==    by 0x380842A1: vgPlain_core_panic_at (m_libcassert.c:496)
==29542==    by 0x380842CA: vgPlain_core_panic (m_libcassert.c:501)
==29542==    by 0x3809F682: failure_exit (m_translate.c:740)
==29542==    by 0x38147F88: vpanic (main_util.c:231)
==29542==    by 0x381550CD: isZeroU.isra.16.part.17 (ir_opt.c:1226)
==29542==    by 0x381591F2: isZeroU (ir_opt.c:1525)
==29542==    by 0x381591F2: fold_Expr (ir_opt.c:2308)
==29542==    by 0x38159E26: subst_and_fold_Stmt (ir_opt.c:2585)
==29542==    by 0x38159E26: cprop_BB (ir_opt.c:2794)
==29542==    by 0x3815BCE8: cheap_transformations (ir_opt.c:6414)
==29542==    by 0x3815CD36: do_iropt_BB (ir_opt.c:6608)
==29542==    by 0x38145D6C: LibVEX_Translate (main_main.c:916)
==29542==    by 0x380A1C0B: vgPlain_translate (m_translate.c:1765)
==29542==    by 0x380D296B: handle_chain_me (scheduler.c:1076)
==29542==    by 0x380D45CF: vgPlain_scheduler (scheduler.c:1420)
==29542==    by 0x380E3946: thread_wrapper (syswrap-linux.c:102)
==29542==    by 0x380E3946: run_a_thread_NORETURN (syswrap-linux.c:155)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 29542)
==29542==    at 0x5A314E0: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x5A106FF: EC_POINT_mul (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x11B760FF: ???
==29542==    by 0x11B7305F: ???
==29542==    by 0x747AD66F647832FF: ???
==29542==    by 0x11B72D0F: ???
==29542==    by 0x5A18E47: EC_KEY_check_key (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x5A19260: EC_KEY_set_public_key_affine_coordinates (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x5AD2882: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x5ACE37F: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x5ACDA33: ??? (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x59A170C: FIPS_mode_set (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x599DF89: OPENSSL_init_library (in /lib/x86_64-linux-gnu/libcrypto.so.1.0.0)
==29542==    by 0x40104E9: call_init.part.0 (dl-init.c:72)
==29542==    by 0x40105FA: call_init (dl-init.c:30)
==29542==    by 0x40105FA: _dl_init (dl-init.c:120)
==29542==    by 0x4000CF9: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.


Expected Results:  
Valgrind should have performed a memcheck of my program but it crashes instead
my program should actually outputs something like (but it is irrelevant): 

ERROR: Not enough arguments
pictDBM [COMMAND] [ARGUMENTS]
  help: displays this help.
  list <dbfilename>: list pictDB content.
  create <dbfilename>: create a new pictDB.
  	options are:
  		-max_files <MAX_FILES>: maximum number of files.
  					default value is 10
  					maximum value is 100000
  		-thumb_res <X_RES> <Y_RES>: resolution for thumbnail images.
  					default value is 64x64
  					maximum value is 128x128
  		-small_res <X_RES> <Y_RES>: resolution for small images.
  					default value is 256x256
  					maximum value is 512x512
  read   <dbfilename> <pictID> [original|orig|thumbnail|thumb|small]:
  	read an image from the pictDB and save it to a file.
  	default resolution is "original".
  insert <dbfilename> <pictID> <filename>: insert a new image in the pictDB.
  delete <dbfilename> <pictID>: delete picture pictID from pictDB.

I was using Ubuntu 14 and nothing was wrong there but now,
I just switched to Ubuntu 16.04 (Xenial Xerus) on my laptop:
 Intel® Core™ i7-6600U CPU @ 2.60GHz × 4, 64 bits
Comment 1 Tyler 2016-05-30 13:48:54 UTC
Created attachment 99271 [details]
OpenSSL wiki example c source

Depends on openssl-dev. Compile command. gcc wiki_cbc.c -lcrypto
Comment 2 Tyler 2016-05-30 13:55:07 UTC
Having the same issues on Ubuntu 16.04 while trying to check a program with openssl cbc encryption. Both through the evp.h and aes.h interfaces. I attached an example from the openssl wiki on using the evp encryption. It reproduces this crash.
Comment 3 Mark Wielaard 2016-05-30 14:33:50 UTC

*** This bug has been marked as a duplicate of bug 356393 ***