Skip to contentSkip to conversation

ARM port

Openvpn-devel Øyvind Repvik 3 participants 5 messages Jun 24, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines

This is the first report I've ever seen of an assertion in this >function. Try making the function non-inline and see if that changes anything.

Which compiler/version are you using?

James

I can confirm this, on the same ARM platform (Intel IXP420), and openvpn tarball downloaded yesterday (2.0):

Fri Jun 24 07:52:49 2005 TESTING ENCRYPT/DECRYPT of packet length=96 Fri Jun 24 07:52:49 2005 TESTING ENCRYPT/DECRYPT of packet length=97 Fri Jun 24 07:52:49 2005 Assertion failed at integer.h:94 Fri Jun 24 07:52:49 2005 Exiting

I've compiled openvpn using native gcc:
Reading specs from /usr/lib/gcc/armeb-linux/3.4.4/specs
Configured with: /home/repvik/slug-svn/build/tmp/work/gcc-3.4.4-r0/gcc-3.4.4/configure --build=i686-linux --host=armeb-linux --target=armeb-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --enable-clocale=generic --with-gnu-ld --enable-shared --enable-target-optspace --enable-languages=c,c++,f77 --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=armeb-linux- --with-local-prefix=/usr/local --with-gxx-include-dir=/usr/include/c++/3.4.4 --with-float=soft --disable-nls Thread model: posix
gcc version 3.4.4

Øyvind

#1 lore raw
Quoted 9 lines · On Fri, 24 Jun 2005, [ISO-8859-1] Øyvind Repvik wrote:
Quoted 8 lines

This is the first report I've ever seen of an assertion in this function.
Try making the function non-inline and see if that changes anything.

Which compiler/version are you using?

James

Quoted 7 lines

I can confirm this, on the same ARM platform (Intel IXP420), and openvpn tarball downloaded yesterday (2.0):

Fri Jun 24 07:52:49 2005 TESTING ENCRYPT/DECRYPT of packet length=96 Fri Jun 24 07:52:49 2005 TESTING ENCRYPT/DECRYPT of packet length=97 Fri Jun 24 07:52:49 2005 Assertion failed at integer.h:94 Fri Jun 24 07:52:49 2005 Exiting

I need more information on this one:

* What are the values of x, y, and mod when the assertion is hit?

* A call stack trace would be nice, i.e. which function was calling modulo_add when the assertion was hit?

* Does the assertion always hit in the test above immediately after packet length=97?

* What is the config file or command line which was used to generate the test?

* Does the assertion occur if compiler optimization is turned off? (edit Makefile and remove -O2 from gcc commands)

* Does the assertion occur if inline functions are turned off? (edit Makefile and add -fno-inline to gcc commands)

Quoted 11 lines

I've compiled openvpn using native gcc:
Reading specs from /usr/lib/gcc/armeb-linux/3.4.4/specs Configured with:
/home/repvik/slug-svn/build/tmp/work/gcc-3.4.4-r0/gcc-3.4.4/configure --build=i686-linux --host=armeb-linux --target=armeb-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --enable-clocale=generic --with-gnu-ld --enable-shared

Quoted 8 lines

--enable-target-optspace --enable-languages=c,c++,f77 --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=armeb-linux- --with-local-prefix=/usr/local --with-gxx-include-dir=/usr/include/c++/3.4.4 --with-float=soft --disable-nls
Thread model: posix
gcc version 3.4.4

James

#2 lore raw

* What are the values of x, y, and mod when the assertion is hit? 32, -1, 64

* A call stack trace would be nice, i.e. which function was calling modulo_add when the assertion was hit?

It's actually being called through the macro CIRC_LIST_PUSH (p->seq_list, SEQ_UNSEEN);

#0 packet_id_add (p=0xbffff02c, pin=0xbfffe9bc) at packet_id.c:116 #1 0x0000d628 in openvpn_decrypt (buf=0xbfffea74, work=

      {capacity = 1596, offset = 56, len = 97, data = 0x7425c ""}, 
    opt=0xbffff014, frame=0xbfffe9e0) at crypto.c:364
#2  0x0000ef54 in test_crypto (co=0xbffff014, frame=0xbfffeef4) at
crypto.c:883
#3  0x00019ec0 in test_crypto_thread (arg=0x4a488) at init.c:2635
#4  0x00019f5c in do_test_crypto (o=0xbffff180) at init.c:2667
#5  0x00028884 in main (argc=4, argv=0xbffff844) at openvpn.c:175

* Does the assertion always hit in the test above immediately after packet length=97?

Yes.

* What is the config file or command line which was used to generate the test?

#3 lore raw

* Does the assertion occur if compiler optimization is turned off? (edit Makefile and remove -O2 from gcc commands)
* Does the assertion occur if inline functions are turned off? (edit Makefile and add -fno-inline to gcc commands)

Both fix the assertion failure, as does removing the inline specifier for the particular function. Any idea what's been causing this behavior?

Oliver

__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs

#4 lore raw
In reply to ov
Quoted 2 lines · ov

* What are the values of x, y, and mod when the assertion is hit? 32, -1, 64

This is quite strange because these values are nominal -- they shouldn't have triggered the assertion.

The assertion statement says:

  ASSERT (0 <= x && x < mod && -mod <= y && y <= mod);

substitution gives:

  0 <= 32 && 32 < 64 && -64 <= -1 && -1 <= 64

which is a true statement when x, y, and mod are integers, as they are declared to be.

For example, when I do the same test on x86
with modulo_add instrumentation added, I see the same 32/-1/64 parameter set.

Fri Jun 24 23:58:21 2005 TESTING ENCRYPT/DECRYPT of packet length=97 Fri Jun 24 23:58:21 2005 modulo_add(int x=92, int y=1, int mod=100) Fri Jun 24 23:58:21 2005 modulo_add(int x=32, int y=-1, int mod=64) Fri Jun 24 23:58:21 2005 modulo_add(int x=93, int y=1, int mod=100) Fri Jun 24 23:58:21 2005 modulo_add(int x=31, int y=0, int mod=64) Fri Jun 24 23:58:21 2005 modulo_add(int x=94, int y=1, int mod=100)

Combine this with your observation that making the function inline or turning off -O2 optimization fixes the problem, and it's starting to smell like a compiler bug.

James