Bug 1850086

Summary: Regression on some x86_64 -m32 -mfpmath=387 code
Product: Red Hat Enterprise Linux 8 Reporter: Mark Wielaard <mjw>
Component: valgrindAssignee: Mark Wielaard <mjw>
valgrind sub component: system-version QA Contact: Alexandra Petlanová Hájková <ahajkova>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ahajkova, fweimer, jakub, ohudlick
Version: 8.3Keywords: Patch, Regression
Target Milestone: rc   
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: valgrind-3.16.0-2.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1850545 (view as bug list) Environment:
Last Closed: 2020-11-04 03:36:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1850545    

Description Mark Wielaard 2020-06-23 14:10:28 UTC
There is a regression in valgrind 3.16.0 with some code compiled with -m32 -mfpmath=387 (32bit using 387 floating point).

Upstream already has a fix and has released 3.16.1 with it:
https://bugs.kde.org/show_bug.cgi?id=422715

The fix is fairly small and self contained.
But replicating the issue is not trivial.

Comment 3 Mark Wielaard 2020-06-30 12:20:39 UTC
One way to reproduce this issue is through the GNU Scientific Library testsuite (and older version at least):

wget https://ftpmirror.gnu.org/gsl/gsl-1.6.tar.gz
tar zxf gsl-1.6.tar.gz
cd gsl-1.6
autoreconf -f -i -Wnone
./configure CC="gcc -m32" CFLAGS="-g -O3 -mfpmath=387"
make && make check -k
./libtool valgrind -q ./complex/test

PUTI(136:8xI8)[t0,0] = 0x0:I8

vex: the `impossible' happened:
   stmt_is_guardable: unhandled stmt
vex storage: T total 174900420 bytes allocated
vex storage: P total 496 bytes allocated

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

host stacktrace:
==19430==    at 0x5805199D: show_sched_status_wrk (m_libcassert.c:406)
==19430==    by 0x58051AF9: report_and_quit (m_libcassert.c:477)
==19430==    by 0x58051CD5: panic (m_libcassert.c:553)
==19430==    by 0x58051CD5: vgPlain_core_panic_at (m_libcassert.c:558)
==19430==    by 0x58051D06: vgPlain_core_panic (m_libcassert.c:563)
==19430==    by 0x580695F3: failure_exit (m_translate.c:761)
==19430==    by 0x58175A8C: vpanic (main_util.c:253)
==19430==    by 0x581944A9: stmt_is_guardable (guest_generic_bb_to_IR.c:474)
==19430==    by 0x581944A9: block_is_guardable (guest_generic_bb_to_IR.c:488)
==19430==    by 0x581944A9: bb_to_IR (guest_generic_bb_to_IR.c:1597)
==19430==    by 0x58171B53: LibVEX_FrontEnd (main_main.c:583)
==19430==    by 0x581724EB: LibVEX_Translate (main_main.c:1235)
==19430==    by 0x5806C444: vgPlain_translate (m_translate.c:1828)
==19430==    by 0x580B5DBB: handle_tt_miss (scheduler.c:1138)
==19430==    by 0x580B5DBB: vgPlain_scheduler (scheduler.c:1500)
==19430==    by 0x5811B736: thread_wrapper (syswrap-linux.c:101)
==19430==    by 0x5811B736: run_a_thread_NORETURN (syswrap-linux.c:154)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 19430)
==19430==    at 0x804B408: gsl_complex_arctanh_real (math.c:973)
==19430==    by 0x804B56C: gsl_complex_arctanh (math.c:960)
==19430==    by 0x8048CC5: main (test.c:119)
client stack range: [0xFEC67000 0xFEC6AFFF] client SP: 0xFEC69C90
valgrind stack range: [0x82EB8000 0x82FB7FFF] top usage: 5828 of 1048576

Comment 4 Alexandra Petlanová Hájková 2020-07-01 13:45:28 UTC
I reproduced the bug for valgrind-3.16.0-1.el8 and verified it passes for valgrind-3.16.0-2.el8.

Comment 8 errata-xmlrpc 2020-11-04 03:36:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (valgrind bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4755