What am I doing wrong?

215 views
Skip to first unread message

Brian Raven

unread,
Jun 11, 2012, 9:53:32 AM6/11/12
to Relacy Race Detector
I wanted to check out some algorithms using the race detector, so I
downloaded version 2.4. I thought I would start with the examples, but
without luck so far. I haven't seen any messages in this group
discussing similar problems, so I am guessing that I am doing
something wrong, but I can see what. Any help would be appreciated.

First, I have a 32 bit Linux box running Red Hat el3, and g++ version
3.4.4. Any attempt at compilation, using the command 'g++ -g -o X
X.cpp, where X is any of the examples, produces the following output:


In file included from /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../
include/c++/3.4.4/backward/strstream:51,
from ../../relacy/pch.hpp:39,
from stdafx.h:9,
from smr.cpp:1:
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/
backward/backward_warning.h:32:2: warning: #warning This file includes
at least one deprecated or antiquated header. Please consider using
one of the 32 headers found in section 17.4.1.2 of the C++ standard.
Examples include substituting the <X> header for the <X.h> header for C
++ includes, or <iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.
In file included from ../../relacy/context.hpp:18,
from ../../relacy/relacy.hpp:18,
from ../../relacy/relacy_std.hpp:17,
from smr.cpp:3:
../../relacy/context_base.hpp: In constructor
`rl::context::context(rl::thread_id_t, rl::test_params&)':
../../relacy/context_base.hpp:230: error: `__sync_fetch_and_add'
undeclared (first use this function)
../../relacy/context_base.hpp:230: error: (Each undeclared identifier
is reported only once for each function it appears in.)

Second, I have a 64 bit Linux box running Red Hat el5 and g++ version
4.1.2. It compiles, allbeit with the same 'deprecated' warning, but
when I run the executable it core dumps. gdb gives the stack trace
as...


Core was generated by `./smr'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
at ../../relacy/platform.hpp:182
182 void (*volatile ufnc)(void*) = ctx->fnc;
(gdb) where
#0 0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
at ../../relacy/platform.hpp:182
#1 0x00000037ef241820 in ?? () from /lib64/libc.so.6
#2 0x0000000000000000 in ?? ()

As I said, any help would be appreciated.

--
Brian Raven

Dmitriy V'jukov

unread,
Jun 11, 2012, 10:44:42 AM6/11/12
to rel...@googlegroups.com
Hi,

I think gcc3.4 is a bit too old (7 years)...



Second, I have a 64 bit Linux box running Red Hat el5 and g++ version
4.1.2. It compiles, allbeit with the same 'deprecated' warning, but
when I run the executable it core dumps. gdb gives the stack trace
as...

Please post command line that you use for compilation.


Core was generated by `./smr'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
at ../../relacy/platform.hpp:182
182         void (*volatile ufnc)(void*) = ctx->fnc;
(gdb) where
#0  0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
at ../../relacy/platform.hpp:182
#1  0x00000037ef241820 in ?? () from /lib64/libc.so.6
#2  0x0000000000000000 in ?? ()

As I said, any help would be appreciated.



This p=0xffffffffcaad94b0  is definitely broken. Pointers are 48 bit on Intel64... It's either sign extended or negated or something like this... Do I make pointers from int's?..

That "deprecated" warnings is OK :) Why they deprecate such a nice thing?... Well, perhaps, I need to remove it.

Brian Raven

unread,
Jun 11, 2012, 11:39:23 AM6/11/12
to Relacy Race Detector
On Jun 11, 3:44 pm, "Dmitriy V'jukov" <dvyu...@gmail.com> wrote:
Yes it is a bit old, but your web site does say, under supported
platforms, "GCC 3.4 and above, Linux, 32-bit".

>
> Second, I have a 64 bit Linux box running Red Hat el5 and g++ version
>
> > 4.1.2. It compiles, allbeit with the same 'deprecated' warning, but
> > when I run the executable it core dumps. gdb gives the stack trace
> > as...
>
> Please post command line that you use for compilation.
>
> Core was generated by `./smr'.
>
> > Program terminated with signal 11, Segmentation fault.
> > #0  0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
> > at ../../relacy/platform.hpp:182
> > 182         void (*volatile ufnc)(void*) = ctx->fnc;
> > (gdb) where
> > #0  0x0000000000402e15 in fiber_start_fnc (p=0xffffffffcaad94b0)
> > at ../../relacy/platform.hpp:182
> > #1  0x00000037ef241820 in ?? () from /lib64/libc.so.6
> > #2  0x0000000000000000 in ?? ()
>
> > As I said, any help would be appreciated.
>
> This p=0xffffffffcaad94b0  is definitely broken. Pointers are 48 bit on
> Intel64... It's either sign extended or negated or something like this...
> Do I make pointers from int's?..
>
> That "deprecated" warnings is OK :) Why they deprecate such a nice
> thing?... Well, perhaps, I need to remove it.

The compile command was:

g++ -g -o smr smr.cpp

I also have version 4.7.0 of g++ in the same 64 bit linux box. The
same compile command using that version fails as follows:

In file included from /export/home/lxdevws86/brianr/opt/lib/gcc/x86_64-
unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/backward/
strstream:52:0,
from ../../relacy/pch.hpp:39,
from stdafx.h:9,
from smr.cpp:1:
/export/home/lxdevws86/brianr/opt/lib/gcc/x86_64-unknown-linux-gnu/
4.7.0/../../../../include/c++/4.7.0/backward/backward_warning.h:33:2:
warning: #warning This file includes at least one deprecated or
antiquated header which may be removed without further notice at a
future date. Please use a non-deprecated interface with equivalent
functionality instead. For a listing of replacement headers and
interfaces, consult the file backward_warning.h. To disable this
warning use -Wno-deprecated. [-Wcpp]
In file included from ../../relacy/relacy.hpp:29:0,
from ../../relacy/relacy_std.hpp:17,
from smr.cpp:3:
../../relacy/stdlib/condition_variable.hpp:42:22: error: reference
'm_' cannot be declared 'mutable' [-fpermissive]
In file included from ../../relacy/relacy.hpp:33:0,
from ../../relacy/relacy_std.hpp:17,
from smr.cpp:3:
../../relacy/stdlib/windows.hpp: In instantiation of 'static void*
rl::win32_thread_helper<thread_fn_t>::thread(void*) [with thread_fn_t
= unsigned int (*)(void*)]':
../../relacy/stdlib/windows.hpp:361:102: required from here
../../relacy/stdlib/windows.hpp:325:53: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]



--
Brian Raven

Dmitriy V'jukov

unread,
Jun 11, 2012, 12:02:23 PM6/11/12
to rel...@googlegroups.com
I am pretty sure that tested on gcc3.4 if I wrote that. It must be working at some point. It seems to be unsupported in fact now.
Try passing -fpermissive.

I will try to take a closer look next week. 

Brian Raven

unread,
Jun 11, 2012, 1:17:02 PM6/11/12
to Relacy Race Detector


On Jun 11, 5:02 pm, "Dmitriy V'jukov" <dvyu...@gmail.com> wrote:
> On Mon, Jun 11, 2012 at 11:39 AM, Brian Raven
> <brianrave...@googlemail.com>wrote:
Thanks, I appreciate your help. In the mean time I will try building a
later version of gcc on my 32 bit box.

--
Brian Raven

Brian Raven

unread,
Jun 12, 2012, 8:34:25 AM6/12/12
to Relacy Race Detector
I have built version 4.1.2 on my old 32 bit linux box (Red Hat 3).
Using that I was getting a link error.


/tmp/ccyhvZGx.o(.gnu.linkonce.t._ZN2rl7contextC2EiRNS_11test_paramsE
+0x9d): In function `rl::context::context(int, rl::test_params&)':
../../relacy/context_base.hpp:230: undefined reference to
`__sync_fetch_and_add_4'

This seemed to be cured by adding -march=i686 to the compile command.
At least I can get the example programs to compile and run. Now for
the algorithms that I want to test.

--
Brian Raven
Reply all
Reply to author
Forward
0 new messages