Bug 36288 - OpenMP-C++: segmentation fault in basic string constructors
Summary: OpenMP-C++: segmentation fault in basic string constructors
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-21 08:39 UTC by Li-Juan.Hai
Modified: 2008-05-28 07:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
C++ OpenMP program. (355 bytes, text/plain)
2008-05-21 08:41 UTC, Li-Juan.Hai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Li-Juan.Hai 2008-05-21 08:39:47 UTC
the testcase b.cc is attached to show the problem. the error just happened with -m64. 

-bash-3.00$ /import/dr3/s10/gcc-4.2/bin/g++ b.cc -m64 -fopenmp
-bash-3.00$ export LD_LIBRARY_PATH=/import/dr3/s10/gcc-4.2/lib/sparcv9
-bash-3.00$ ./a.out
Segmentation Fault (core dumped)

-bash-3.00$ dbx a.out
(dbx) run
Running: a.out
(process id 12660)
Reading libc_psr.so.1
t@1 (l@1) signal SEGV (no mapping at the fault address) in _memcpy at 0xffffffff7dc00ee0
0xffffffff7dc00ee0: _memcpy+0x0660:     stda     %f32, [%o0] 0xf0

dbx: internal error: signal SIGSEGV (no mapping at the fault address)
dbx's coredump will appear in /tmp
Abort (core dumped)

-bash-3.00$ /import/dr3/s10/gcc-4.2/bin/g++ -v
Using built-in specs.
Target: sparc-sun-solaris2.10
Configured with: /import/dr2/starlex/1/gcc-4.2-20070228/configure --prefix=/import/dr3/s10/gcc-4.2 --enable-languages=c,c++,fortran --enable-rpath --with-mpfr=/import/dr3/s10/gcc-4.2 --with-gmp=/import/dr3/s10/gcc-4.2
Thread model: posix
gcc version 4.2.0 20070228 (prerelease)
Comment 1 Li-Juan.Hai 2008-05-21 08:41:25 UTC
Created attachment 15660 [details]
C++ OpenMP program.
Comment 2 Andrew Pinski 2008-05-28 07:51:35 UTC
Hmm, I don't think this is a bug as the assignment of the string is not going to be atomic so you could get a partial assignment of a.astr happening.
Comment 3 Andrew Pinski 2008-05-28 07:53:04 UTC
Is there a reason why you think this is well defined code?
Comment 4 Li-Juan.Hai 2008-05-28 08:54:16 UTC
Subject: Re:  OpenMP-C++: segmentation fault in basic string constructors

no. thanks for your comments. i have correct the testcase. the error
is gone with gcc-4.2. thanks again.

2008/5/28 pinskia at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>:
>
>
> ------- Comment #3 from pinskia at gcc dot gnu dot org  2008-05-28 07:53 -------
> Is there a reason why you think this is well defined code?
>
>
> --
>
> pinskia at gcc dot gnu dot org changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>          Component|c++                         |middle-end
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36288
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>