public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/10884] New: division by zero in value.c:1892
@ 2009-11-02  8:41 andre dot poenitz at nokia dot com
  2009-11-02  9:08 ` [Bug gdb/10884] " andre dot poenitz at nokia dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: andre dot poenitz at nokia dot com @ 2009-11-02  8:41 UTC (permalink / raw)
  To: gdb-prs

I keep getting a division by zero with the following backtrace:


Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0xb7ab68d0 (LWP 3375)]
0x08130839 in value_primitive_field (arg1=0xa812a18, offset=0, fieldno=4, 
    arg_type=0x90007c0) at value.c:1892
1892          if ((bitpos % container_bitsize) + v->bitsize <= container_bitsize


#0  0x08130839 in value_primitive_field (arg1=0xa812a18, offset=0, fieldno=4, 
    arg_type=0x90007c0) at value.c:1892
        bitpos = 128
        container_bitsize = 0
        v = (struct value *) 0xaa554b0
        type = (struct type *) 0x9000844
#1  0x081ddf41 in value_struct_element_index (value=0xa812a18, type_index=4)
    at varobj.c:2747
        result = (struct value *) 0x0
        e = {reason = 0, error = GDB_NO_ERROR, message = 0x0}
        type = (struct type *) 0x90007c0
        __PRETTY_FUNCTION__ = "value_struct_element_index"
#2  0x081de6c0 in cplus_describe_child (parent=<value optimized out>, index=-1, 
    cname=0x0, cvalue=0xbfd5eae4, ctype=0x0, cfull_expression=0x0) at varobj.c:3222
        type_index = 4
        acc = <value optimized out>andre.poenitz@nokia.com
        join = 0x82fea65 "."
        value = (struct value *) 0xa812a18
        type = (struct type *) 0x90007c0
        was_ptr = 0
        parent_expression = 0x0
        __PRETTY_FUNCTION__ = "cplus_describe_child"
#3  0x081de7d0 in cplus_value_of_child (parent=0xaa553c0, index=4) at varobj.c:3344
        value = (struct value *) 0x0
#4  0x081e1b50 in varobj_list_children (var=0xaa553c0, from=0xbfd5eb58, 
    to=0xbfd5eb54) at varobj.c:2429
        existing = <value optimized out>
        name = 0xaa55600 "sharable"
        i = 4
        children_changed = 2300
#5  0x080f2dab in mi_cmd_var_list_children (command=0xab318d8 "var-list-children", 
    argv=0xab3bc38, argc=2) at ./mi/mi-cmd-var.c:423
        var = (struct varobj *) 0xaa553c0
        children = <value optimized out>
        child = <value optimized out>
        print_values = <value optimized out>
        ix = <value optimized out>
        from = -1
        to = -1
        display_hint = <value optimized out>
#6  0x080f6523 in captured_mi_execute_command (uiout=0x8b6ab40, data=0x9f55918)
    at ./mi/mi-main.c:1388
        cleanup = (struct cleanup *) 0x0
#7  0x081713ca in catch_exception (uiout=0x8b6ab40, 
    func=0x80f63e0 <captured_mi_execute_command>, func_args=0x9f55918, mask=6)
    at exceptions.c:462
        exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0}
#8  0x080f608b in mi_execute_command (
    cmd=0xab31b78 "116-var-list-children --all-values \"local.list.@.d.*.public\"", 
    from_tty=1) at ./mi/mi-main.c:1288
        result = {reason = 80, error = 179510136, sage = 0xbfd5ec38
"X&#65533;&#65533;\004i\027\bx\033&#65533;\n"}
        previous_ptid = {pid = 3377, lwp = 3377, tid = 0}
        command = (struct mi_parse *) 0x9f55918
#9  0x080f5006 in mi_execute_command_wrapper (
    cmd=0xab31b78 "116-var-list-children --all-values \"local.list.@.d.*.public\"")
    at ./mi/mi-interp.c:251
No locals.
#10 0x08176904 in handle_file_event (data={ptr = 0x0, integer = 0})
    at event-loop.c:812
        file_ptr = (file_handler *) 0x8bd5c00
        mask = <value optimized out>
        error_mask_returned = 0
#11 0x081760cb in process_event () at event-loop.c:394
        event_ptr = <value optimized out>
        proc = (event_handler_func *) 0x8176880 <handle_file_event>
        data = {ptr = 0x0, integer = 0}
#12 0x08176fe4 in gdb_do_one_event (data=0x0) at event-loop.c:459
        current = 3
        event_source_head = 0
#13 0x0817119b in catch_errors (func=0x8176d90 <gdb_do_one_event>, func_args=0x0, 
    errstring=0x82dc69d "", mask=6) at exceptions.c:510
        val = 0
        exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0}
#14 0x0817683c in start_event_loop () at event-loop.c:483
        gdb_result = 128
#15 0x0808e97b in captured_command_loop (data=0x0) at ./main.c:226
No locals.
#16 0x0817119b in catch_errors (func=0x808e970 <captured_command_loop>, 
    func_args=0x0, errstring=0x82dc69d "", mask=6) at exceptions.c:510
        val = 0
        exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0}
#17 0x0808f5ec in captured_main (data=0xbfd5ee24) at ./main.c:902
        argc = 4
        ...
#18 0x0817119b in catch_errors (func=0x808eaf0 <captured_main>, 
    func_args=0xbfd5ee24, errstring=0x82dc69d "", mask=6) at exceptions.c:510
        val = 0
        exception = {reason = 0, error = GDB_NO_ERROR, message = 0x0}
#19 0x0808e8b1 in gdb_main (args=0xbfd5ee24) at ./main.c:911
No locals.
#20 0x0808e875 in main (argc=Cannot access memory at address 0x1
) at gdb.c:33
        args = {argc = 4, argv = 0xbfd5eed4, use_windows = 0, 
  interpreter_p = 0x82cc8c8 "console"}



(gdb) p container_bitsize
$1 = 0

-- 
           Summary: division by zero in value.c:1892
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: andre dot poenitz at nokia dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
@ 2009-11-02  9:08 ` andre dot poenitz at nokia dot com
  2009-11-02 11:21 ` jan dot kratochvil at redhat dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andre dot poenitz at nokia dot com @ 2009-11-02  9:08 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From andre dot poenitz at nokia dot com  2009-11-02 09:08 -------

The struct being examined at the time of the crash is

struct myns::QListData::Data {
    myns::QBasicAtomicInt ref;
    int alloc;
    int begin;
    int end;
    uint sharable : 1;
    void *array[1];
}


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
  2009-11-02  9:08 ` [Bug gdb/10884] " andre dot poenitz at nokia dot com
@ 2009-11-02 11:21 ` jan dot kratochvil at redhat dot com
  2009-12-02 12:22 ` andre dot poenitz at nokia dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-11-02 11:21 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan dot kratochvil at redhat
                   |                            |dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
  2009-11-02  9:08 ` [Bug gdb/10884] " andre dot poenitz at nokia dot com
  2009-11-02 11:21 ` jan dot kratochvil at redhat dot com
@ 2009-12-02 12:22 ` andre dot poenitz at nokia dot com
  2009-12-02 20:35 ` tromey at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andre dot poenitz at nokia dot com @ 2009-12-02 12:22 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From andre dot poenitz at nokia dot com  2009-12-02 12:22 -------

checking for  container_bitsize (!= 0) in the same condition fixes the problem
for me without any visible side effects.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (2 preceding siblings ...)
  2009-12-02 12:22 ` andre dot poenitz at nokia dot com
@ 2009-12-02 20:35 ` tromey at redhat dot com
  2009-12-18 12:42 ` vladimir at codesourcery dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2009-12-02 20:35 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2009-12-02 20:35 -------
*** Bug 10758 has been marked as a duplicate of this bug. ***

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (3 preceding siblings ...)
  2009-12-02 20:35 ` tromey at redhat dot com
@ 2009-12-18 12:42 ` vladimir at codesourcery dot com
  2009-12-21  9:50 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vladimir at codesourcery dot com @ 2009-12-18 12:42 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From vladimir at codesourcery dot com  2009-12-18 12:42 -------
Patch posted at http://sourceware.org/ml/gdb-patches/2009-12/msg00250.html

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (4 preceding siblings ...)
  2009-12-18 12:42 ` vladimir at codesourcery dot com
@ 2009-12-21  9:50 ` cvs-commit at gcc dot gnu dot org
  2009-12-21  9:53 ` vladimir at codesourcery dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2009-12-21  9:50 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-21 09:50 -------
Subject: Bug 10884

CVSROOT:	/cvs/src
Module name:	src
Changes by:	vprus@sourceware.org	2009-12-21 09:50:31

Modified files:
	gdb            : ChangeLog value.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.mi: mi-var-cmd.exp var-cmd.c 

Log message:
	PR gdb/10884
	
	* value.c (value_primitive_field): Call check_typedef
	on the type.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11157&r2=1.11158
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/value.c.diff?cvsroot=src&r1=1.96&r2=1.97
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2049&r2=1.2050
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp.diff?cvsroot=src&r1=1.45&r2=1.46
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.mi/var-cmd.c.diff?cvsroot=src&r1=1.19&r2=1.20



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (5 preceding siblings ...)
  2009-12-21  9:50 ` cvs-commit at gcc dot gnu dot org
@ 2009-12-21  9:53 ` vladimir at codesourcery dot com
  2009-12-21 13:18 ` cvs-commit at gcc dot gnu dot org
  2009-12-21 13:22 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: vladimir at codesourcery dot com @ 2009-12-21  9:53 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From vladimir at codesourcery dot com  2009-12-21 09:53 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (6 preceding siblings ...)
  2009-12-21  9:53 ` vladimir at codesourcery dot com
@ 2009-12-21 13:18 ` cvs-commit at gcc dot gnu dot org
  2009-12-21 13:22 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2009-12-21 13:18 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-21 13:18 -------
Subject: Bug 10884

CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_0-branch
Changes by:	brobecke@sourceware.org	2009-12-21 13:18:21

Modified files:
	gdb            : value.c ChangeLog 

Log message:
	PR gdb/10884
	
	* value.c (value_primitive_field): Call check_typedef
	on the type.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/value.c.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.96&r2=1.96.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.10874.2.58&r2=1.10874.2.59



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug gdb/10884] division by zero in value.c:1892
  2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
                   ` (7 preceding siblings ...)
  2009-12-21 13:18 ` cvs-commit at gcc dot gnu dot org
@ 2009-12-21 13:22 ` cvs-commit at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2009-12-21 13:22 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-12-21 13:22 -------
Subject: Bug 10884

CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_0-branch
Changes by:	brobecke@sourceware.org	2009-12-21 13:21:44

Modified files:
	gdb/testsuite/gdb.mi: var-cmd.c mi-var-cmd.exp 
	gdb/testsuite  : ChangeLog 

Log message:
	PR gdb/10884
	
	* gdb.mi/var-cmd.c (do_bitfield_tests): New
	(main): Call do_bitfield_tests.
	* gdb.mi/mi-var-cmd.exp: Run the 'bitfield' testcase.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.mi/var-cmd.c.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.19&r2=1.19.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.45&r2=1.45.2.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.1960.2.14&r2=1.1960.2.15



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10884

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2009-12-21 13:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-02  8:41 [Bug gdb/10884] New: division by zero in value.c:1892 andre dot poenitz at nokia dot com
2009-11-02  9:08 ` [Bug gdb/10884] " andre dot poenitz at nokia dot com
2009-11-02 11:21 ` jan dot kratochvil at redhat dot com
2009-12-02 12:22 ` andre dot poenitz at nokia dot com
2009-12-02 20:35 ` tromey at redhat dot com
2009-12-18 12:42 ` vladimir at codesourcery dot com
2009-12-21  9:50 ` cvs-commit at gcc dot gnu dot org
2009-12-21  9:53 ` vladimir at codesourcery dot com
2009-12-21 13:18 ` cvs-commit at gcc dot gnu dot org
2009-12-21 13:22 ` cvs-commit at gcc dot gnu dot org

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).