TestCallTemplates crashes while intentionally trying to dereference 0x1000

VERIFIED WONTFIX

Status

()

Core
XPCOM
--
major
VERIFIED WONTFIX
16 years ago
16 years ago

People

(Reporter: timeless, Assigned: dbaron)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
Starting program: /home/timeless/mozilla/obj-xlib-i386-unknown-freebsd4.4/dist/bin/./TestCallTemplates

Program received signal SIGSEGV, Segmentation fault.
0x08049ae3 in unsigned int CallQueryInterface<nsISupports, nsITestService> (aSource=0x1000, aDestination=0xbfbff7b0)
    at ../../dist/include/xpcom/nsISupportsUtils.h:270
270                                        NS_REINTERPRET_CAST(void**, aDestination));
Current language:  auto; currently c++
(gdb) p aDestination
$1 = (nsITestService **) 0xbfbff7b0
(gdb) p *aDestination
$2 = (nsITestService *) 0x0
(gdb) l
265       {
266         NS_PRECONDITION(aSource, "null parameter");
267         NS_PRECONDITION(aDestination, "null parameter");
268
269         return aSource->QueryInterface(NS_GET_IID(DestinationType),
270                                        NS_REINTERPRET_CAST(void**, aDestination));
271       }
272
273     } // extern "C++"
274
(gdb) p aSource
$3 = (nsISupports *) 0x1000
(gdb) p *aSource
Error accessing memory address 0x1000: Bad address.
(gdb) up
#1  0x080496ad in main () at /home/timeless/mozilla/xpcom/tests/TestCallTemplates.cpp:76
76          CallQueryInterface(mySupportsPtr, &myITestService);
(gdb) p mySupportsPtr
$4 = (nsISupports *) 0x1000
(gdb) l
71          /* Test CallQueryInterface */
72
73          nsISupports *mySupportsPtr = NS_REINTERPRET_CAST(nsISupports*, 0x1000);
74
75          nsITestService *myITestService = nsnull;
76          CallQueryInterface(mySupportsPtr, &myITestService);

I must be missing something. But don't feel like I'm singling you out (I've filed bugs w/ patches for other tests today). I know I'm not innocent, as I own TestDeque and I think it always crashes too ...
Yes, you missed the comment at the top:

/*
 * This test is NOT intended to be run.  It's a test to make sure
 * a group of functions BUILD correctly.
 */

Marking WONTFIX.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 2

16 years ago
vrfy. and i guess we can't have them in a function that isn't called because we 
risk an optimizing compiler optimizing them out.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.