uwplse / herbgrind

A Valgrind tool for Herbie
GNU General Public License v3.0
90 stars 7 forks source link

not able to run spec2006 fp benchmark - 470.lbm with herbgrind #26

Closed sangeeta0201 closed 5 years ago

sangeeta0201 commented 6 years ago

Hi,

I am trying to run spec2006 fp benchmark - 470.lbm with herbgrind but its crashing. It is compiled with gcc (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04) 6.3.0 20170519

/usr/bin/gcc -c -o lbm.o -DSPEC_CPU -DNDEBUG    -O2       -DSPEC_CPU_LP64         lbm.c
/usr/bin/gcc -c -o main.o -DSPEC_CPU -DNDEBUG    -O2       -DSPEC_CPU_LP64         main.c
/usr/bin/gcc   -O2  -DSPEC_CPU_LP64        lbm.o main.o             -lm        -o lbm

Without herbgrind

./lbm 130 reference.dat 0 1 100_100_130_cf_a.of
MAIN_printInfo:
    grid size      : 100 x 100 x 130 = 1.30 * 10^6 Cells
    nTimeSteps     : 130
    result file    : reference.dat
    action         : nothing
    simulation type: channel flow
    obstacle file  : 100_100_130_cf_a.of

LBM_showGridStatistics:
    nObstacleCells:  498440 nAccelCells:       0 nFluidCells:  801560
    minRho:   1.0000 maxRho:   1.0000 mass: 1.300000e+06
    minU: 0.000000e+00 maxU: 0.000000e+00

timestep: 64
LBM_showGridStatistics:
    nObstacleCells:  498440 nAccelCells:       0 nFluidCells:  801560
    minRho:   0.9948 maxRho:   1.0459 mass: 1.302956e+06
    minU: 0.000000e+00 maxU: 3.212546e-02

timestep: 128
LBM_showGridStatistics:
    nObstacleCells:  498440 nAccelCells:       0 nFluidCells:  801560
    minRho:   0.9967 maxRho:   1.0360 mass: 1.305827e+06
    minU: 0.000000e+00 maxU: 4.946202e-02

LBM_showGridStatistics:
    nObstacleCells:  498440 nAccelCells:       0 nFluidCells:  801560
    minRho:   0.9966 maxRho:   1.0362 mass: 1.305915e+06
    minU: 0.000000e+00 maxU: 4.949656e-02

with herbgrind -

./herbgrind.sh ./lbm 130 reference.dat 0 1 100_100_130_cf_a.of
==2452== Herbgrind, a valgrind tool for Herbie
==2452== Copyright (C) 2016-2017, and GNU GPL'd, by Alex Sanchez-Stern
==2452== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==2452== Command: ./lbm 130 reference.dat 0 1 100_100_130_cf_a.of
==2452== 
MAIN_printInfo:
    grid size      : 100 x 100 x 130 = 1.30 * 10^6 Cells
    nTimeSteps     : 130
    result file    : reference.dat
    action         : nothing
    simulation type: channel flow
    obstacle file  : 100_100_130_cf_a.of

Herbgrind: runtime/value-shadowstate/exprs.c:75 (recursivelyDisownConcExpr): Assertion 'expr->ref_count > 0' failed.
Herbgrind: The ref count of 0x868B24E20 is already zero, and we're trying to decrease it!

host stacktrace:
==2452==    at 0x3806F198: show_sched_status_wrk (m_libcassert.c:343)
==2452==    by 0x3806F2B4: report_and_quit (m_libcassert.c:415)
==2452==    by 0x3806F441: vgPlain_assert_fail (m_libcassert.c:481)
==2452==    by 0x38053170: recursivelyDisownConcExpr (exprs.c:73)
==2452==    by 0x3804F11D: freeShadowValue (value-shadowstate.c:238)
==2452==    by 0x80356BF69: ???
==2452==    by 0x803078F2F: ???

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 2452)
==2452==    at 0x5213783: strchrnul (strchr.S:32)
==2452==    by 0x51CA207: vfprintf (printf-parse.h:108)
==2452==    by 0x52939EE: __printf_chk (printf_chk.c:35)
==2452==    by 0x4009D1: main (in /home/sangeeta/project/float_p/herbgrind/spec2006_github/spec2006/benchspec/CPU2006/470.lbm/run/build_base_elider-amd64-m64-gcc42-nn.0000/lbm)

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.
HazardousPeach commented 6 years ago

Hey @sangeeta0201 , thanks so much for getting in touch! Looks like I messed up the reference counting somewhere, I'll take a look.

sangeeta0201 commented 6 years ago

Hello,

This is another issue I faced while running spec benchmark -sphinx3 with O3 optimizations

==31029== Herbgrind, a valgrind tool for Herbie
==31029== Copyright (C) 2016-2017, and GNU GPL'd, by Alex Sanchez-Stern
==31029== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==31029== Command: ./sphinx_livepretend_base.gcc43-64bit ctlfile . args.an4
==31029== 
INFO: spec_main_live_pretend.c(120): Processing 1 beamsets
INFO: cmd_ln.c(276): Parsing command line:                                                          
INFO: kbcore.c(95): Initializing core models:
INFO: logs3.c(99): Initializing logbase: 1.000300e+00 (add table: 1)
INFO: logs3.c(161): Log-Add table size = 29350
INFO: feat.c(642): Initializing feature stream to type: '1s_c_d_dd', CMN='current', VARNORM='no', AGC='none'
INFO: mdef.c(594): Reading model definition: model/hmm/hub4/hub4opensrc.6000.mdef
INFO: mdef.c(771): 48 CI-phone, 133500 CD-phone, 3 emitstate/phone, 144 CI-sen, 6144 Sen, 32639 Sen-Seq
INFO: dict.c(358): Reading main dictionary: model/lm/an4/an4.dict
INFO: dict.c(361): 130 words read
INFO: dict.c(366): Reading filler dictionary: model/lm/an4/filler.dict
INFO: dict.c(369): 3 words read
INFO: lm.c(739): LM read('model/lm/an4/an4.ug.lm.DMP', lw= 9.50, wip= -1188, uw= 0.70)
INFO: lm.c(553):      107 ug
INFO: lm.c(583):        1 bigrams [on disk]
INFO: lm.c(613):        2 bigram prob entries
INFO: lm.c(696):      107 word strings
INFO: wid.c(178): 6 LM words not in dictionary; ignored
INFO: cont_mgau.c(96): Reading mixture gaussian file 'model/hmm/hub4/means'
INFO: cont_mgau.c(248): 6144 mixture Gaussians, 8 components, 1 streams, veclen 39
INFO: cont_mgau.c(96): Reading mixture gaussian file 'model/hmm/hub4/variances'
INFO: cont_mgau.c(248): 6144 mixture Gaussians, 8 components, 1 streams, veclen 39
INFO: cont_mgau.c(269): Reading mixture weights file 'model/hmm/hub4/mixture_weights'

Herbgrind: instrument/floattypes.c:1264 (typeMeet): Assertion 'type2 == Vt_Unknown || type2 == Vt_NonFloat || type2 == Vt_SingleOrNonFloat' failed.
Herbgrind: Cannot meet types Vt_NonFloat and Vt_Double!

host stacktrace:
==31029==    at 0x380715B8: show_sched_status_wrk (m_libcassert.c:343)
==31029==    by 0x380716D4: report_and_quit (m_libcassert.c:415)
==31029==    by 0x38071861: vgPlain_assert_fail (m_libcassert.c:481)
==31029==    by 0x3806C2A3: typeMeet (floattypes.c:1262)
==31029==    by 0x3806C519: refineTempBlockType (floattypes.c:111)
==31029==    by 0x3806D821: inferTypes (floattypes.c:126)
==31029==    by 0x38063AFC: hg_instrument (instrument.c:63)
==31029==    by 0x3808C8CF: tool_instrument_then_gdbserver_if_needed (m_translate.c:238)
==31029==    by 0x38137C4C: LibVEX_Translate (main_main.c:934)
==31029==    by 0x3808F1A5: vgPlain_translate (m_translate.c:1765)
==31029==    by 0x380BFF5B: handle_chain_me (scheduler.c:1076)
==31029==    by 0x380C1C74: vgPlain_scheduler (scheduler.c:1414)
==31029==    by 0x380D0EC6: run_a_thread_NORETURN (syswrap-linux.c:102)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 31029)
==31029==    at 0x42AB60: vector_sum_norm (vector.c:92)
==31029==    by 0x407B68: mgau_init (cont_mgau.c:344)
==31029==    by 0x41996F: kbcore_init (kbcore.c:195)
==31029==    by 0x417CFF: kb_init (kb.c:87)
==31029==    by 0x401FB9: live_initialize_decoder (live.c:89)
==31029==    by 0x401841: main (spec_main_live_pretend.c:133)

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  
HazardousPeach commented 6 years ago

This second problem should be fixed in PR #30. I'm still having trouble reproducing your first issue because the benchmark is rather large, I'll keep looking at it.

HazardousPeach commented 6 years ago

Huh, I can't actually reproduce this; this program finishes fine on my setup. Do you have any more details that could help me reproduce this issue? How much RAM does the program use on your machine?

HazardousPeach commented 5 years ago

I'm closing this issue because it's not clear if it's been fixed or not, and there's no movement on it.