0
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32test\system\t_prot.cpp
|
|
15 |
// Overview:
|
|
16 |
// Tests that the kernel panics the user rather than dying in
|
|
17 |
// various situations
|
|
18 |
// API Information:
|
|
19 |
// N/A
|
|
20 |
// Details:
|
|
21 |
// - Verify that printing a long string does not panic.
|
|
22 |
// - Verify that a stack overflow in a thread causes a panic.
|
|
23 |
// - Create the thread which panics a dead thread, verify that
|
|
24 |
// it isn't panicked for doing this.
|
|
25 |
// - Create the thread which panics a bad handle, verify that
|
|
26 |
// it isn't panicked for doing this.
|
|
27 |
// - Verify that an RSession send from an uninitialised handle
|
|
28 |
// causes a panic.
|
|
29 |
// - Verify that the thread causing an exception, for a variety
|
|
30 |
// of reasons, is panicked.
|
|
31 |
// - Verify thread writing to kernel data is panicked.
|
|
32 |
// - Verify that RAM disk access either causes a panic or is
|
|
33 |
// denied, based on the platform security settings.
|
|
34 |
// - Verify that an RThread::RequestComplete() with an invalid
|
|
35 |
// address causes a panic. Verify results are as expected.
|
|
36 |
// Platforms/Drives/Compatibility:
|
|
37 |
// All.
|
|
38 |
// Assumptions/Requirement/Pre-requisites:
|
|
39 |
// Failures and causes:
|
|
40 |
// Base Port information:
|
|
41 |
//
|
|
42 |
//
|
|
43 |
|
|
44 |
#include <e32test.h>
|
|
45 |
#include "u32std.h"
|
|
46 |
#include <e32panic.h>
|
|
47 |
#include "../mmu/mmudetect.h"
|
|
48 |
|
|
49 |
void DoUndefinedInstruction();
|
|
50 |
|
|
51 |
const TInt KHeapSize=0x200;
|
|
52 |
|
|
53 |
_LIT(KLitKernExec,"KERN-EXEC");
|
|
54 |
|
|
55 |
class RSessionTest : public RSessionBase
|
|
56 |
{
|
|
57 |
public:
|
|
58 |
void DoSend();
|
|
59 |
};
|
|
60 |
|
|
61 |
|
|
62 |
void RSessionTest::DoSend()
|
|
63 |
{
|
|
64 |
Send(34,TIpcArgs(78));
|
|
65 |
//Send(34,(TAny*)78);
|
|
66 |
};
|
|
67 |
|
|
68 |
LOCAL_D RTest test(_L("T_PROT"));
|
|
69 |
LOCAL_D RTest t(_L("T_PROT thread"));
|
|
70 |
|
|
71 |
enum TAction
|
|
72 |
{
|
|
73 |
EDataAbort=0,
|
|
74 |
EPrefetchAbort=1,
|
|
75 |
EUndefinedInstruction=2,
|
|
76 |
};
|
|
77 |
|
|
78 |
typedef void (*PFV)(void);
|
|
79 |
|
|
80 |
#ifndef __MARM__
|
|
81 |
void DoUndefinedInstruction()
|
|
82 |
{
|
|
83 |
#ifdef __GCC32__
|
|
84 |
asm("int 6");
|
|
85 |
#else
|
|
86 |
_asm int 6;
|
|
87 |
#endif
|
|
88 |
}
|
|
89 |
#endif
|
|
90 |
|
|
91 |
LOCAL_C TInt ExceptionThread(TAny* anAction)
|
|
92 |
{
|
|
93 |
TAction action=(TAction)((TInt) anAction);
|
|
94 |
switch (action)
|
|
95 |
{
|
|
96 |
case EDataAbort:
|
|
97 |
*(TInt*)0=0;
|
|
98 |
break;
|
|
99 |
case EPrefetchAbort:
|
|
100 |
{
|
|
101 |
// PFV f=(PFV)NULL;
|
|
102 |
PFV f=(PFV)0x80000; // don't use NULL since it is readable on Snowdrop
|
|
103 |
(*f)();
|
|
104 |
break;
|
|
105 |
}
|
|
106 |
case EUndefinedInstruction:
|
|
107 |
DoUndefinedInstruction();
|
|
108 |
break;
|
|
109 |
};
|
|
110 |
return 0;
|
|
111 |
}
|
|
112 |
|
|
113 |
LOCAL_C void RunTestThread(TAction anAction)
|
|
114 |
{
|
|
115 |
RThread t;
|
|
116 |
TInt r=t.Create(_L("TestThread"),ExceptionThread,KDefaultStackSize,KHeapSize,KHeapSize,(TAny*)anAction);
|
|
117 |
test(r==KErrNone);
|
|
118 |
TRequestStatus s;
|
|
119 |
t.Logon(s);
|
|
120 |
test(s==KRequestPending);
|
|
121 |
t.Resume();
|
|
122 |
User::WaitForRequest(s);
|
|
123 |
test(t.ExitType()==EExitPanic);
|
|
124 |
test(t.ExitCategory()==_L("KERN-EXEC"));
|
|
125 |
test(t.ExitReason()==ECausedException);
|
|
126 |
CLOSE_AND_WAIT(t);
|
|
127 |
}
|
|
128 |
|
|
129 |
LOCAL_C TInt UnintThread(TAny* )
|
|
130 |
{
|
|
131 |
|
|
132 |
RSessionTest rsb;
|
|
133 |
rsb.DoSend();
|
|
134 |
FOREVER
|
|
135 |
;
|
|
136 |
}
|
|
137 |
|
|
138 |
void testSession()
|
|
139 |
//
|
|
140 |
// Test 1
|
|
141 |
//
|
|
142 |
{
|
|
143 |
|
|
144 |
RThread thread;
|
|
145 |
TRequestStatus stat;
|
|
146 |
|
|
147 |
test.Next(_L("Create UnintThread"));
|
|
148 |
TInt r=thread.Create(_L("UnintThread"),UnintThread,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
149 |
test(r==KErrNone);
|
|
150 |
|
|
151 |
thread.Logon(stat);
|
|
152 |
test(thread.ExitType()==EExitPending);
|
|
153 |
test.Next(_L("Resume UnintThread"));
|
|
154 |
thread.Resume();
|
|
155 |
User::WaitForRequest(stat);
|
|
156 |
test.Next(_L("Check UnintThread panicked"));
|
|
157 |
test(thread.ExitCategory()==_L("KERN-EXEC"));
|
|
158 |
// test(thread.ExitReason()==EBadHandle);
|
|
159 |
test(thread.ExitType()==EExitPanic);
|
|
160 |
CLOSE_AND_WAIT(thread);
|
|
161 |
}
|
|
162 |
|
|
163 |
TInt dummy(TAny*)
|
|
164 |
{
|
|
165 |
return(KErrNone);
|
|
166 |
}
|
|
167 |
|
|
168 |
// Dennis - modified this to panic a dead thread rather than a bad handle
|
|
169 |
TInt pdThread(TAny*)
|
|
170 |
{
|
|
171 |
RThread thread;
|
|
172 |
TRequestStatus stat;
|
|
173 |
TInt r=thread.Create(_L("dummy"),dummy,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
174 |
test(r==KErrNone);
|
|
175 |
thread.Logon(stat);
|
|
176 |
test(thread.ExitType()==EExitPending);
|
|
177 |
thread.Resume();
|
|
178 |
User::WaitForRequest(stat);
|
|
179 |
test(thread.ExitType()==EExitKill);
|
|
180 |
test(stat.Int()==KErrNone);
|
|
181 |
thread.Panic(_L("MYPANIC"),0x666); // this shouldn't panic pdThread
|
|
182 |
test(thread.ExitType()==EExitKill);
|
|
183 |
test(thread.ExitReason()==KErrNone);
|
|
184 |
CLOSE_AND_WAIT(thread);
|
|
185 |
return(KErrNone);
|
|
186 |
}
|
|
187 |
|
|
188 |
void testPanicDeadThread()
|
|
189 |
//
|
|
190 |
// Dennis - modified this to panic a dead thread rather than a bad handle
|
|
191 |
// Create the thread which panics a dead thread /*bad handle*/
|
|
192 |
// Check that it isn't panicked for doing this
|
|
193 |
//
|
|
194 |
{
|
|
195 |
RThread thread;
|
|
196 |
TRequestStatus stat;
|
|
197 |
test.Next(_L("Create PanicDeadThread"));
|
|
198 |
TInt r=thread.Create(_L("PanicDeadThread"),pdThread,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
199 |
test(r==KErrNone);
|
|
200 |
thread.Logon(stat);
|
|
201 |
test(thread.ExitType()==EExitPending);
|
|
202 |
test.Next(_L("Resume PanicDeadThread"));
|
|
203 |
thread.Resume();
|
|
204 |
User::WaitForRequest(stat);
|
|
205 |
test.Next(_L("Check PanicDeadThread did not panic"));
|
|
206 |
test(thread.ExitReason()==KErrNone);
|
|
207 |
test(thread.ExitType()==EExitKill);
|
|
208 |
test(thread.ExitCategory()==_L("Kill"));
|
|
209 |
CLOSE_AND_WAIT(thread);
|
|
210 |
}
|
|
211 |
|
|
212 |
TInt doDeadThreadStuff(TAny*)
|
|
213 |
{
|
|
214 |
RThread thread;
|
|
215 |
TRequestStatus stat;
|
|
216 |
TInt r=thread.Create(_L("dummy2"),dummy,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
217 |
test(r==KErrNone);
|
|
218 |
thread.Logon(stat);
|
|
219 |
test(thread.ExitType()==EExitPending);
|
|
220 |
thread.Resume();
|
|
221 |
User::WaitForRequest(stat);
|
|
222 |
|
|
223 |
thread.SetPriority(EPriorityNormal);
|
|
224 |
|
|
225 |
CLOSE_AND_WAIT(thread);
|
|
226 |
return(KErrNone);
|
|
227 |
}
|
|
228 |
|
|
229 |
void testDeadThread()
|
|
230 |
//
|
|
231 |
// Create the thread which panics a bad handle
|
|
232 |
// Check that it isn't panicked for doing this
|
|
233 |
//
|
|
234 |
{
|
|
235 |
RThread thread;
|
|
236 |
TRequestStatus stat;
|
|
237 |
test.Next(_L("Create doDeadThreadStuff"));
|
|
238 |
TInt r=thread.Create(_L("doDeadThreadStuff"),doDeadThreadStuff,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
239 |
test(r==KErrNone);
|
|
240 |
thread.Logon(stat);
|
|
241 |
test(thread.ExitType()==EExitPending);
|
|
242 |
test.Next(_L("Resume doDeadThreadStuff"));
|
|
243 |
thread.Resume();
|
|
244 |
User::WaitForRequest(stat);
|
|
245 |
test.Next(_L("Check doDeadThreadStuff did not panic"));
|
|
246 |
test(thread.ExitReason()==KErrNone);
|
|
247 |
test(thread.ExitType()==EExitKill);
|
|
248 |
test(thread.ExitCategory()==_L("Kill"));
|
|
249 |
CLOSE_AND_WAIT(thread);
|
|
250 |
}
|
|
251 |
|
|
252 |
TInt MinimalThread(TAny*)
|
|
253 |
//
|
|
254 |
// Minimal thread, used in test 5
|
|
255 |
//
|
|
256 |
{
|
|
257 |
return(KErrNone);
|
|
258 |
}
|
|
259 |
|
|
260 |
LOCAL_C TInt ExceptThread(TAny* )
|
|
261 |
{
|
|
262 |
|
|
263 |
TUint* nullPtr=0;
|
|
264 |
*nullPtr=0xdead; // BANG!!
|
|
265 |
return KErrNone;
|
|
266 |
}
|
|
267 |
|
|
268 |
|
|
269 |
void testExcept()
|
|
270 |
//
|
|
271 |
// Test thread causing exception is panicked
|
|
272 |
//
|
|
273 |
{
|
|
274 |
|
|
275 |
RThread thread;
|
|
276 |
TRequestStatus stat;
|
|
277 |
|
|
278 |
test.Next(_L("Create ExceptThread"));
|
|
279 |
TInt r=thread.Create(_L("ExceptThread"),ExceptThread,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
280 |
test(r==KErrNone);
|
|
281 |
|
|
282 |
thread.Logon(stat);
|
|
283 |
test(thread.ExitType()==EExitPending);
|
|
284 |
test.Next(_L("Resume ExceptThread"));
|
|
285 |
thread.Resume();
|
|
286 |
User::WaitForRequest(stat);
|
|
287 |
test.Next(_L("Check ExceptThread panicked"));
|
|
288 |
test(thread.ExitCategory()==_L("KERN-EXEC"));
|
|
289 |
test(thread.ExitReason()==ECausedException);
|
|
290 |
test(thread.ExitType()==EExitPanic);
|
|
291 |
CLOSE_AND_WAIT(thread);
|
|
292 |
}
|
|
293 |
|
|
294 |
LOCAL_C TInt StackThread(TAny* )
|
|
295 |
{
|
|
296 |
|
|
297 |
TFileName heresAnotherOne;
|
|
298 |
StackThread((TAny*)heresAnotherOne.Ptr()); // go recursive
|
|
299 |
return KErrNone;
|
|
300 |
}
|
|
301 |
|
|
302 |
void testStackOverflow()
|
|
303 |
//
|
|
304 |
// Thread overflowing its stack is panicked
|
|
305 |
//
|
|
306 |
{
|
|
307 |
|
|
308 |
RThread thread;
|
|
309 |
TRequestStatus stat;
|
|
310 |
|
|
311 |
test.Next(_L("Create StackThread"));
|
|
312 |
TInt r=thread.Create(_L("StackThread"),StackThread,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
313 |
test(r==KErrNone);
|
|
314 |
|
|
315 |
thread.Logon(stat);
|
|
316 |
test(thread.ExitType()==EExitPending);
|
|
317 |
test.Next(_L("Resume StackThread"));
|
|
318 |
thread.Resume();
|
|
319 |
User::WaitForRequest(stat);
|
|
320 |
test.Next(_L("Check StackThread panicked"));
|
|
321 |
test(thread.ExitCategory()==_L("KERN-EXEC"));
|
|
322 |
test(thread.ExitReason()==ECausedException);
|
|
323 |
test(thread.ExitType()==EExitPanic);
|
|
324 |
CLOSE_AND_WAIT(thread);
|
|
325 |
}
|
|
326 |
|
|
327 |
LOCAL_C TInt KernWriter(TAny* )
|
|
328 |
{
|
|
329 |
|
|
330 |
TUint* kernPtr=(TUint*)KernData();
|
|
331 |
*kernPtr=0xdead; // BANG!!
|
|
332 |
return KErrNone;
|
|
333 |
}
|
|
334 |
|
|
335 |
LOCAL_C TInt RamDiskWriter(TAny* )
|
|
336 |
{
|
|
337 |
|
|
338 |
TFindChunk fChunk(_L("*TheRamDriveChunk*"));
|
|
339 |
TFullName n;
|
|
340 |
TInt r=fChunk.Next(n);
|
|
341 |
RChunk ch;
|
|
342 |
r=ch.Open(fChunk);
|
|
343 |
if(r!=KErrNone)
|
|
344 |
return r;
|
|
345 |
TUint8* rdPtr=ch.Base();
|
|
346 |
*rdPtr=0xaa; // BANG!!
|
|
347 |
return KErrNone;
|
|
348 |
}
|
|
349 |
|
|
350 |
|
|
351 |
void testKernelWriter()
|
|
352 |
//
|
|
353 |
// Thread writing to kernel data is panicked
|
|
354 |
//
|
|
355 |
{
|
|
356 |
|
|
357 |
RThread thread;
|
|
358 |
TRequestStatus stat;
|
|
359 |
|
|
360 |
test.Next(_L("Create KernWriter"));
|
|
361 |
TInt r=thread.Create(_L("KernWriter"),KernWriter,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
362 |
test(r==KErrNone);
|
|
363 |
|
|
364 |
thread.Logon(stat);
|
|
365 |
test(thread.ExitType()==EExitPending);
|
|
366 |
test.Next(_L("Resume KernWriter"));
|
|
367 |
thread.Resume();
|
|
368 |
User::WaitForRequest(stat);
|
|
369 |
test.Next(_L("Check KernWriter panicked"));
|
|
370 |
test(thread.ExitCategory()==_L("KERN-EXEC"));
|
|
371 |
test(thread.ExitReason()==ECausedException);
|
|
372 |
test(thread.ExitType()==EExitPanic);
|
|
373 |
CLOSE_AND_WAIT(thread);
|
|
374 |
}
|
|
375 |
|
|
376 |
void testRamDiskAccess()
|
|
377 |
{
|
|
378 |
|
|
379 |
RThread thread;
|
|
380 |
TRequestStatus stat;
|
|
381 |
|
|
382 |
test.Next(_L("Create RamDiskWriter"));
|
|
383 |
TInt r=thread.Create(_L("RamDiskWriter"),RamDiskWriter,KDefaultStackSize,KHeapSize,KHeapSize,0);
|
|
384 |
test(r==KErrNone);
|
|
385 |
|
|
386 |
thread.Logon(stat);
|
|
387 |
test(thread.ExitType()==EExitPending);
|
|
388 |
test.Next(_L("Resume RamDiskWriter"));
|
|
389 |
thread.Resume();
|
|
390 |
User::WaitForRequest(stat);
|
|
391 |
if((!PlatSec::ConfigSetting(PlatSec::EPlatSecProcessIsolation))||(!PlatSec::ConfigSetting(PlatSec::EPlatSecEnforcement)))
|
|
392 |
{
|
|
393 |
test.Next(_L("Check RamDiskWriter panicked"));
|
|
394 |
test(thread.ExitCategory()==_L("KERN-EXEC"));
|
|
395 |
test(thread.ExitReason()==ECausedException);
|
|
396 |
test(thread.ExitType()==EExitPanic);
|
|
397 |
}
|
|
398 |
else
|
|
399 |
{
|
|
400 |
test.Next(_L("Check RamDiskWriter was refused access"));
|
|
401 |
test(thread.ExitReason()==KErrPermissionDenied);
|
|
402 |
test(thread.ExitType()==EExitKill);
|
|
403 |
}
|
|
404 |
CLOSE_AND_WAIT(thread);
|
|
405 |
}
|
|
406 |
|
|
407 |
RThread MainThread;
|
|
408 |
|
|
409 |
TInt RequestCompleteThread(TAny* aPtr)
|
|
410 |
{
|
|
411 |
TRequestStatus** pS=(TRequestStatus**)aPtr;
|
|
412 |
MainThread.RequestComplete(*pS,123);
|
|
413 |
return 0;
|
|
414 |
}
|
|
415 |
|
|
416 |
_LIT(KReqCompThreadName,"ReqCompThread");
|
|
417 |
void StartRequestCompleteThread(RThread& aThread, TRequestStatus** aStatus)
|
|
418 |
{
|
|
419 |
TInt r=aThread.Create(KReqCompThreadName,RequestCompleteThread,0x1000,0x1000,0x10000,aStatus);
|
|
420 |
test (r==KErrNone);
|
|
421 |
aThread.SetPriority(EPriorityMore);
|
|
422 |
TRequestStatus s;
|
|
423 |
aThread.Logon(s);
|
|
424 |
aThread.Resume();
|
|
425 |
User::WaitForRequest(s);
|
|
426 |
}
|
|
427 |
|
|
428 |
GLDEF_C TInt E32Main()
|
|
429 |
//
|
|
430 |
// Main
|
|
431 |
//
|
|
432 |
{
|
|
433 |
|
|
434 |
// don't want just in time debugging as we trap panics
|
|
435 |
TBool justInTime=User::JustInTime();
|
|
436 |
User::SetJustInTime(EFalse);
|
|
437 |
|
|
438 |
test.Title();
|
|
439 |
test.Start(_L("Test protection & panicking"));
|
|
440 |
|
|
441 |
#if defined(__EPOC32__)
|
|
442 |
// this next test doesn't work under WINS because the string needs to be converted
|
|
443 |
// from UNICODE to ascii for printing to STDOUT, and that requires the string to be
|
|
444 |
// zero-terminated which panics because the string is too long.
|
|
445 |
test.Next(_L("Printing long string doesn't get me shot"));
|
|
446 |
test.Printf(_L("012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"));
|
|
447 |
test.Printf(_L("\n"));
|
|
448 |
#endif
|
|
449 |
|
|
450 |
if (HaveVirtMem())
|
|
451 |
{
|
|
452 |
test.Next(_L("Stack overflow shoots the thread not the kernel"));
|
|
453 |
testStackOverflow();
|
|
454 |
}
|
|
455 |
|
|
456 |
test.Next(_L("Panicking a closed thread doesn't panic the panicker!!"));
|
|
457 |
testPanicDeadThread();
|
|
458 |
|
|
459 |
test.Next(_L("Dead thread tests"));
|
|
460 |
testDeadThread();
|
|
461 |
|
|
462 |
test.Next(_L("RSession send from uninitialised handle"));
|
|
463 |
testSession();
|
|
464 |
|
|
465 |
test.Next(_L("Thread causing exception is killed"));
|
|
466 |
if (HaveVirtMem())
|
|
467 |
{
|
|
468 |
testExcept();
|
|
469 |
RunTestThread(EDataAbort);
|
|
470 |
RunTestThread(EPrefetchAbort);
|
|
471 |
}
|
|
472 |
#ifndef __WINS__
|
|
473 |
RunTestThread(EUndefinedInstruction);
|
|
474 |
#endif
|
|
475 |
|
|
476 |
#if defined(__EPOC32__)
|
|
477 |
if (HaveDirectKernProt())
|
|
478 |
{
|
|
479 |
test.Next(_L("Thread writing to kernel data is killed"));
|
|
480 |
testKernelWriter();
|
|
481 |
}
|
|
482 |
|
|
483 |
if (HaveProcessProt())
|
|
484 |
{
|
|
485 |
test.Next(_L("Check access to RamDisk is denied"));
|
|
486 |
testRamDiskAccess();
|
|
487 |
}
|
|
488 |
|
|
489 |
if (HaveMMU())
|
|
490 |
{
|
|
491 |
test.Next(_L("RequestComplete() with bad address"));
|
|
492 |
TInt rqc=RThread().RequestCount();
|
|
493 |
test(MainThread.Duplicate(RThread())==KErrNone);
|
|
494 |
RThread t;
|
|
495 |
TRequestStatus s=KRequestPending;
|
|
496 |
TRequestStatus* pS=&s;
|
|
497 |
StartRequestCompleteThread(t,&pS);
|
|
498 |
test(t.ExitType()==EExitKill);
|
|
499 |
test(t.ExitReason()==KErrNone);
|
|
500 |
CLOSE_AND_WAIT(t);
|
|
501 |
test(s==123);
|
|
502 |
test(pS==NULL);
|
|
503 |
test(RThread().RequestCount()==rqc+1);
|
|
504 |
TRequestStatus** bad=(TRequestStatus**)0x80000000; // kernel space
|
|
505 |
StartRequestCompleteThread(t,bad);
|
|
506 |
test(t.ExitType()==EExitPanic);
|
|
507 |
test(t.ExitReason()==ECausedException);
|
|
508 |
test(t.ExitCategory()==KLitKernExec);
|
|
509 |
CLOSE_AND_WAIT(t);
|
|
510 |
test(RThread().RequestCount()==rqc+1);
|
|
511 |
pS=(TRequestStatus*)0x80000000;
|
|
512 |
StartRequestCompleteThread(t,&pS);
|
|
513 |
// Request status poked user side, so we expect a KERN-EXEC 3...
|
|
514 |
test(t.ExitType()==EExitPanic);
|
|
515 |
test(t.ExitReason()==ECausedException);
|
|
516 |
test(t.ExitCategory()==KLitKernExec);
|
|
517 |
CLOSE_AND_WAIT(t);
|
|
518 |
test(pS==NULL);
|
|
519 |
test(RThread().RequestCount()==rqc+1);
|
|
520 |
pS=(TRequestStatus*)(((TUint8*)&s)+0x80000); // aligned, within chunk max size but invalid
|
|
521 |
StartRequestCompleteThread(t,&pS);
|
|
522 |
// Request status poked user side, so we expect a KERN-EXEC 3...
|
|
523 |
test(t.ExitType()==EExitPanic);
|
|
524 |
test(t.ExitReason()==ECausedException);
|
|
525 |
test(t.ExitCategory()==KLitKernExec);
|
|
526 |
CLOSE_AND_WAIT(t);
|
|
527 |
test(pS==NULL);
|
|
528 |
test(RThread().RequestCount()==rqc+1);
|
|
529 |
}
|
|
530 |
#endif
|
|
531 |
|
|
532 |
test.End();
|
|
533 |
|
|
534 |
User::SetJustInTime(justInTime);
|
|
535 |
return(KErrNone);
|
|
536 |
}
|
|
537 |
|