paulfloyd / freebsd_valgrind

Git repo used to Upstream the FreeBSD Port of Valgrind
GNU General Public License v2.0
15 stars 4 forks source link

drd/tests/tc05_simple_race fails with assert [i386] #58

Closed paulfloyd closed 4 years ago

paulfloyd commented 4 years ago

Screenshot_20200423_215707

Looks like many such failures.

paulfloyd commented 4 years ago

Just before the assert the value of 'stackmax' is obtained from a call to 'VG(thread_get_stack_max)(vg_created)'

This just returns

return VG_(threads)[tid].client_stack_highest_byte;

'client_stack_highest_byte' gets set from

Both of these rely on 'VG_(am_find_nsegment)(address)'

What address do they use, for 'guess_and_register_stack' its an argument to the function. Doesn't look like this is called for FreeBSD. That takes us back to 'valgrind_main'. That uses 'the_iifii.initial_client_SP'

I had to bodge 'clstack_end' in 'setup_client_stack()' / initimg-freebsd.c. This gets called with 'iicii.clstack_end'. Which is set from

the_iicii.clstackend = VG(am_startup)( the_iicii.sp_at_startup );

Not sure whether my bodge hasn't been applied for valgrind_main and it should apply, or if it has been applied but it shouldn't.

paulfloyd commented 4 years ago

Fixed. VG_(sys_new_thr) wasn't setting stack params.