public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/42816]  New: Crash in Ada.Containers.Vectors.Update_Element
@ 2010-01-20 21:24 gcc at coreland dot ath dot cx
  2010-01-20 21:24 ` [Bug ada/42816] " gcc at coreland dot ath dot cx
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gcc at coreland dot ath dot cx @ 2010-01-20 21:24 UTC (permalink / raw)
  To: gcc-bugs

See the attached world_test_main program.

This was taken from a working program with as much code removed as possible.

$ gnatchop blob.adb
$ gnatmake world_test_main
$ ./world_test_main
test_tasks(1)_0000000800A50500: waiting to initialize
world_task_0000000800A0B700: running
main_task_0000000800A0AA00: initializing tasks
test_tasks(1)_0000000800A50500: initialized
test_tasks(1)_0000000800A50500: logged in
test_tasks(1)_0000000800A50500: fetching messages

raised STORAGE_ERROR : s-intman.adb:139 explicit raise

Running in gdb shows:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffff9fd9e8 in ?? ()
(gdb) bt
#0  0x00007fffff9fd9e8 in ?? ()
#1  0x000000000040e3fa in world.player_sessions.update_element (container=...,
position=..., process=0x7fffff9fd9e8)
    at
/storage/volatile/gnat_build/builds/8.0/x86_64/svn-r155934/lib/gcc/x86_64-unknown-freebsd8.0/4.5.0/adainclude/a-cohama.adb:853
#2  0x000000000040f6f8 in world.world_state.player_fetch_messages
(<_object>=..., name=..., messages=...)
    at world.adb:67
#3  0x000000000040f767 in <world__world_state__player_fetch_messagesP>
(name=..., messages=...) at world.adb:49
#4  0x000000000040f9ad in world.fetch_messages (name=..., messages=...) at
world.adb:114
#5  0x000000000041176a in <world_test__test_taskTB> (<_task>=0x55bda0) at
world_test.adb:50
#6  0x0000000000419260 in system.tasking.stages.task_wrapper
(self_id=0x800a50500) at s-tassta.adb:1188
#7  0x00000008006974b1 in ?? () from /lib/libthr.so.3
#8  0x0000000000000000 in ?? ()
(gdb) up
#1  0x000000000040e3fa in world.player_sessions.update_element (container=...,
position=..., process=0x7fffff9fd9e8)
    at
/gnat/builds/8.0/x86_64/svn-r155934/lib/gcc/x86_64-unknown-freebsd8.0/4.5.0/adainclude/a-cohama.adb:853
853                 Process (K, E);
(gdb) print Process
$1 = (access procedure (a1: world.player_sessions.key_typeX; a2: <ref>
world.queue.vector)) 0x7fffff9fd9e8

This looks like it could possibly be a code generation error. The access to
Process seems to be invalid:

$ gdb world_test_main
(gdb) b world.adb:62
Breakpoint 1 at 0x40f6cf: file world.adb, line 62.
(gdb) r
Starting program:
/storage/home/m0/doc/dev/2010/01/another_gnat_bug2/test/world_test_main 
test_tasks(1)_0000000800A50500: waiting to initialize
world_task_0000000800A0B700: running
main_task_0000000800A0AA00: initializing tasks
test_tasks(1)_0000000800A50500: initialized
test_tasks(1)_0000000800A50500: logged in
test_tasks(1)_0000000800A50500: fetching messages

Breakpoint 1, world.world_state.player_fetch_messages (<_object>=..., name=...,
messages=...) at world.adb:67
67            Player_Sessions.Update_Element
(gdb) s
world.player_sessions.update_element (container=..., position=...,
process=0x7fffff9fd9e8)
    at
/storage/volatile/gnat_build/builds/8.0/x86_64/svn-r155934/lib/gcc/x86_64-unknown-freebsd8.0/4.5.0/adainclude/a-cohama.adb:827
827           if Position.Node = null then
(gdb) s
832           if Position.Container /= Container'Unrestricted_Access then
(gdb) s
world_task_0000000800A0B700845           B := B + 1;
(gdb) s
: running846             L := L + 1;
(gdb) s

849                 K : Key_Type renames Position.Node.Key;
(gdb) s
850                 E : Element_Type renames Position.Node.Element;
(gdb) s
853                 Process (K, E);
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x00007fffff9fd9e8 in ?? ()

I've tested with every build of GCC I have from 4.4.0 to SVN r155934 on both
x86 and x86_64 and the point of failure is identical each time.


-- 
           Summary: Crash in Ada.Containers.Vectors.Update_Element
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at coreland dot ath dot cx
  GCC host triplet: x86_64-unknown-freebsd8.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42816


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/42816] Crash in Ada.Containers.Vectors.Update_Element
  2010-01-20 21:24 [Bug ada/42816] New: Crash in Ada.Containers.Vectors.Update_Element gcc at coreland dot ath dot cx
@ 2010-01-20 21:24 ` gcc at coreland dot ath dot cx
  2010-01-20 22:00 ` laurent at guerby dot net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: gcc at coreland dot ath dot cx @ 2010-01-20 21:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from gcc at coreland dot ath dot cx  2010-01-20 21:24 -------
Created an attachment (id=19668)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19668&action=view)
Repro


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42816


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/42816] Crash in Ada.Containers.Vectors.Update_Element
  2010-01-20 21:24 [Bug ada/42816] New: Crash in Ada.Containers.Vectors.Update_Element gcc at coreland dot ath dot cx
  2010-01-20 21:24 ` [Bug ada/42816] " gcc at coreland dot ath dot cx
@ 2010-01-20 22:00 ` laurent at guerby dot net
  2010-01-21  8:29 ` gcc at coreland dot ath dot cx
  2010-01-21  8:52 ` gcc at coreland dot ath dot cx
  3 siblings, 0 replies; 5+ messages in thread
From: laurent at guerby dot net @ 2010-01-20 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from laurent at guerby dot net  2010-01-20 21:59 -------
I tested 4.4.1 on x86_64-linux and it seems not to crash:

guerby@gcc13:~/pr42816$ PATH=/opt/cfarm/release/4.4.1/bin:$PATH
guerby@gcc13:~/pr42816$ gnatmake world_test_main.adb 
gcc -c world_test_main.adb
gcc -c world_test.adb
gcc -c log.adb
gcc -c world.adb
gnatbind -x world_test_main.ali
gnatlink world_test_main.ali
guerby@gcc13:~/pr42816$ ./world_test_main 
test_tasks(1)_000000000066C420: waiting to initialize
world_task_0000000000668D10: running
main_task_0000000000668020: initializing tasks
test_tasks(1)_000000000066C420: initialized
test_tasks(1)_000000000066C420: logged in
test_tasks(1)_000000000066C420: fetching messages
world_task_0000000000668D10: running
test_tasks(1)_000000000066C420: fetching messages
world_task_0000000000668D10: running
... (looping)

So this is freebsd specific.


-- 

laurent at guerby dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |laurent at guerby dot net
           Keywords|                            |wrong-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42816


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/42816] Crash in Ada.Containers.Vectors.Update_Element
  2010-01-20 21:24 [Bug ada/42816] New: Crash in Ada.Containers.Vectors.Update_Element gcc at coreland dot ath dot cx
  2010-01-20 21:24 ` [Bug ada/42816] " gcc at coreland dot ath dot cx
  2010-01-20 22:00 ` laurent at guerby dot net
@ 2010-01-21  8:29 ` gcc at coreland dot ath dot cx
  2010-01-21  8:52 ` gcc at coreland dot ath dot cx
  3 siblings, 0 replies; 5+ messages in thread
From: gcc at coreland dot ath dot cx @ 2010-01-21  8:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from gcc at coreland dot ath dot cx  2010-01-21 08:29 -------
Created an attachment (id=19675)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19675&action=view)
Simpler repro

As usual, here's a smaller repro that provokes the same crash.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42816


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug ada/42816] Crash in Ada.Containers.Vectors.Update_Element
  2010-01-20 21:24 [Bug ada/42816] New: Crash in Ada.Containers.Vectors.Update_Element gcc at coreland dot ath dot cx
                   ` (2 preceding siblings ...)
  2010-01-21  8:29 ` gcc at coreland dot ath dot cx
@ 2010-01-21  8:52 ` gcc at coreland dot ath dot cx
  3 siblings, 0 replies; 5+ messages in thread
From: gcc at coreland dot ath dot cx @ 2010-01-21  8:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gcc at coreland dot ath dot cx  2010-01-21 08:51 -------
Created an attachment (id=19676)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19676&action=view)
Even simpler

Some experimentation has determined that the protected object isn't even
necessary to cause the crash.


-- 

gcc at coreland dot ath dot cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #19675|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42816


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-21  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-20 21:24 [Bug ada/42816] New: Crash in Ada.Containers.Vectors.Update_Element gcc at coreland dot ath dot cx
2010-01-20 21:24 ` [Bug ada/42816] " gcc at coreland dot ath dot cx
2010-01-20 22:00 ` laurent at guerby dot net
2010-01-21  8:29 ` gcc at coreland dot ath dot cx
2010-01-21  8:52 ` gcc at coreland dot ath dot cx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).