From: Michael King Date: 2009-03-05T22:58:37+09:00 Subject: [ruby-core:22682] Re: MBARI8 patch fixes bugs caused by incorrect volatile variable declarations --000e0cd3107ed949cf04645f9542 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I knew I was forgetting something on the original mail: I am seeing the segfault with stack clearing set to both default level and 0x0. I am not seeing the segfault with MRI The segfault is in our test suite which does some app setup and config, which is way I am working on whittling it down to something smaller and eliminate dependencies on our custom code. Our app does use a third party C library that we do not have source for, but I'm not sure if its loaded at the point of the error. uname -a Linux mking-3.dev.xxxx.com 2.6.15-51-server #1 SMP Thu Dec 6 21:37:18 UTC 2007 i686 GNU/Linux gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=pentium4 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5) ruby --version ruby 1.8.6 (2009-3-1 MBARI 8B/0x0 on patchlevel 287) [i686-linux] configure options --enable-readline \ --enable-zlib \ --enable-mbari-api \ --with-wipe-sites=0x0 \ CFLAGS="-O0 -g" On Wed, Mar 4, 2009 at 5:01 PM, Brent Roman wrote: > > Michael, > > Could you send me the output of > $ uname -a > $ gcc -v > and the configure cmd used to build with CFLAGS, etc. > ? > > Ruby's conservative GC reads unintialized memory. That can't be helped. > When I was heavy into valgrind, I created a suppression file to > help it recognize and suppress reporting these errors. > > http://www.faqs.org/docs/Linux-HOWTO/Valgrind-HOWTO.html > > Use --gen-suppressions=yes to automatically create suppression > records, then tweak them by hand to make them less specific. > > The only valgrind reports here that concern me a bit are the invalid reads. > I'd have to look into these a bit deeper to be sure. > > By the way, is it the ruby test suite or your app's that segfaults in > drb.rb? > (or both?) If only in your app, is it using any non-standard 'C' > extensions? > > I'm assuming you've already verified that the segfaults don't also occur > with unpatched Ruby. > One more thing to try is to set STACK_WIPES_SITES to 0x0000. > > - brent > > > Michael King-2 wrote: > > > > I am having an issue with the MBARI patches. In our app the test suite > has > > a > > segfault at line 1413 in drb.rb. I am compiling Ruby on Ubuntu 6.06, > > 32bit, > > GCC 4.0.3. The segfault shows up when compiling at O2 and O0(zero). At > the > > moment I am trying to whittle down the test to give you something > > reproducible. > > > > I the meantime, I ran valgrind and the results showed an improvement over > > MRI. I have attached the results of that valgrind run, the errors were of > > 4 > > basic types and were in linked libraries or gc.c: > > Conditional jump or move depends on uninitialised value(s) > > Use of uninitialised value of size 4 > > Invalid read of size > > Address 0x#{address} is #{X} bytes inside a block of size #{X+2} alloc'd > > > > - Michael > > > > > > -- > View this message in context: > http://www.nabble.com/MBARI8-patch-fixes-bugs-caused-by-incorrect-volatile-variable-declarations-tp22259357p22341606.html > Sent from the ruby-core mailing list archive at Nabble.com. > > > --000e0cd3107ed949cf04645f9542 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I knew I was forgetting something on the original mail:

I am seeing = the segfault with stack clearing set to both default level and 0x0.
I am= not seeing the segfault with MRI
The segfault is in our test suite whic= h does some app setup and config, which is way I am working on whittling it= down to something smaller and eliminate dependencies on our custom code. <= br> Our app does use a third party C library that we do not have source for, bu= t I'm not sure if its loaded at the point of the error.

uname -= a
Linux mking-3.dev.xxxx.com= 2.6.15-51-server #1 SMP Thu Dec 6 21:37:18 UTC 2007 i686 GNU/Linux

gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured= with: ../src/configure -v --enable-languages=3Dc,c++,java,f95,objc,ada,tre= elang --prefix=3D/usr --enable-shared --with-system-zlib --libexecdir=3D/us= r/lib --without-included-gettext --enable-threads=3Dposix --enable-nls --pr= ogram-suffix=3D-4.0 --enable-__cxa_atexit --enable-clocale=3Dgnu --enable-l= ibstdcxx-debug --enable-java-awt=3Dgtk-default --enable-gtk-cairo --with-ja= va-home=3D/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disab= le-werror --with-tune=3Dpentium4 --enable-checking=3Drelease i486-linux-gnu=
Thread model: posix
gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

rub= y --version
ruby 1.8.6 (2009-3-1 MBARI 8B/0x0 on patchlevel 287) [i686-l= inux]

configure options
--enable-readline \
--enable-zlib \ --enable-mbari-api \
--with-wipe-sites=3D0x0 \
CFLAGS=3D"-O0 -g&= quot;

On Wed, Mar 4, 2009 at 5:01 PM, Bre= nt Roman <brent@mba= ri.org> wrote:

Michael,

Could you send me the output of
$ uname -a
$ gcc -v
and the configure cmd used to build with CFLAGS, etc.
?

Ruby's conservative GC reads unintialized memory. =A0That can't be = helped.
When I was heavy into valgrind, I created a suppression file to
help it recognize and suppress reporting these errors.

http://www.faqs.org/docs/Linux-HOWTO/Valgrind-HOWTO.html
Use --gen-suppressions=3Dyes to automatically create suppression
records, then tweak them by hand to make them less specific.

The only valgrind reports here that concern me a bit are the invalid reads.=
I'd have to look into these a bit deeper to be sure.

By the way, is it the ruby test suite or your app's that segfaults in drb.rb?
(or both?) =A0If only in your app, is it using any non-standard 'C'=
extensions?

I'm assuming you've already verified that the segfaults don't a= lso occur
with unpatched Ruby.
One more thing to try is to set STACK_WIPES_SITES to 0x0000.

- brent


Michael King-2 wrote:
>
> I am having an issue with the MBARI patches. In our app the test suite= has
> a
> segfault at line 1413 in drb.rb. I am compiling Ruby on Ubuntu 6.06, > 32bit,
> GCC 4.0.3. The segfault shows up when compiling at O2 and O0(zero). At= the
> moment I am trying to whittle down the test to give you something
> reproducible.
>
> I the meantime, I ran valgrind and the results showed an improvement o= ver
> MRI. I have attached the results of that valgrind run, the errors were= of
> 4
> basic types and were in linked libraries or gc.c:
> Conditional jump or move depends on uninitialised value(s)
> Use of uninitialised value of size 4
> Invalid read of size
> Address 0x#{address} is #{X} bytes inside a block of size #{X+2} alloc= 'd
>
> - Michael
>
>

--
View this message in context: http://www.nabble.com/MBARI8-patch-fixes-bu= gs-caused-by-incorrect-volatile-variable-declarations-tp22259357p22341606.h= tml
Sent from the ruby-core mailing li= st archive at Nabble.com.



--000e0cd3107ed949cf04645f9542--