Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 06:35 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default "tupdesc reference is not owned by resource owner Portal" issuein 8.2 and -HEAD

The following testcase(extracted from a much much larger production code
sample) results in

WARNING: TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still
referenced
CONTEXT: PL/pgSQL function "foo" line 4 at block variables initialization
ERROR: tupdesc reference 0xb3573b88 is not owned by resource owner Portal
CONTEXT: PL/pgSQL function "foo" while casting return value to
function's return type

on 8.2 and -HEAD.

8.1 seems to work fine.

Stefan


CREATE OR REPLACE FUNCTION public.foo() RETURNS INTEGER AS $$
DECLARE
v_var INTEGER;
BEGIN
BEGIN
v_var := (bar()).error_code;
EXCEPTION WHEN others THEN
RETURN 0;
END;
RETURN 0;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION public.bar(OUT error_code INTEGER, OUT new_id
INTEGER) RETURNS RECORD AS $$
BEGIN
error_code := 1;
new_id := 1;
RETURN;
END;
$$ LANGUAGE plpgsql;

SELECT * FROM public.foo();

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 06:36 AM
Tom Lane
 
Posts: n/a
Default Re: "tupdesc reference is not owned by resource owner Portal" issue in 8.2 and -HEAD

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> The following testcase(extracted from a much much larger production code
> sample) results in


> WARNING: TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still
> referenced
> CONTEXT: PL/pgSQL function "foo" line 4 at block variables initialization
> ERROR: tupdesc reference 0xb3573b88 is not owned by resource owner Portal
> CONTEXT: PL/pgSQL function "foo" while casting return value to
> function's return type


Hmm. What's happening is that the record-function call creates a
reference-counted TupleDesc, and tracking of the TupleDesc is
assigned to the subtransaction resource owner because we're inside
an EXCEPTION-block subtransaction. But the pointer is held by the
function's eval_context which lives throughout the function call,
and so the free happens long after exiting the subtransaction, and
the resource owner code quite properly complains about this.

In this particular case the worst consequence would be a short-term
memory leak, but I think there are probably variants with worse
problems, because anything done by a RegisterExprContextCallback()
callback is equally at risk.

I think the proper fix is probably to establish a new eval_context
when we enter an EXCEPTION block, and destroy it again on the way out.
Slightly annoying, but probably small next to the other overhead of
a subtransaction. Comments?

BTW, both of the CONTEXT lines are misleading. The WARNING happens
during exit from the begin-block, not entry to it; and the ERROR
happens after we've finished fooling with the result value. I'm
tempted to add a few more assignments to err_text to make this nicer.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 06:36 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default Re: "tupdesc reference is not owned by resource owner Portal"

Tom Lane wrote:
> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
>> The following testcase(extracted from a much much larger production code
>> sample) results in

>
>> WARNING: TupleDesc reference leak: TupleDesc 0xb3573b88 (2249,1) still
>> referenced
>> CONTEXT: PL/pgSQL function "foo" line 4 at block variables initialization
>> ERROR: tupdesc reference 0xb3573b88 is not owned by resource owner Portal
>> CONTEXT: PL/pgSQL function "foo" while casting return value to
>> function's return type

>
> Hmm. What's happening is that the record-function call creates a
> reference-counted TupleDesc, and tracking of the TupleDesc is
> assigned to the subtransaction resource owner because we're inside
> an EXCEPTION-block subtransaction. But the pointer is held by the
> function's eval_context which lives throughout the function call,
> and so the free happens long after exiting the subtransaction, and
> the resource owner code quite properly complains about this.
>
> In this particular case the worst consequence would be a short-term
> memory leak, but I think there are probably variants with worse
> problems, because anything done by a RegisterExprContextCallback()
> callback is equally at risk.
>
> I think the proper fix is probably to establish a new eval_context
> when we enter an EXCEPTION block, and destroy it again on the way out.
> Slightly annoying, but probably small next to the other overhead of
> a subtransaction. Comments?


we use exception blocks heavily here so anything that makes them slower
is not nice but if it fixes the issue at hand I'm all for it ...

>
> BTW, both of the CONTEXT lines are misleading. The WARNING happens
> during exit from the begin-block, not entry to it; and the ERROR
> happens after we've finished fooling with the result value. I'm
> tempted to add a few more assignments to err_text to make this nicer.


yeah wondered about that too when I tried to produce a simple testcase -
the errors did't seem to make much sense in the context of what
triggered them. Improving that would be a very godd thing to do.


Stefan

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 06:38 AM
Tom Lane
 
Posts: n/a
Default Re: "tupdesc reference is not owned by resource owner Portal"

Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> Tom Lane wrote:
>> I think the proper fix is probably to establish a new eval_context
>> when we enter an EXCEPTION block, and destroy it again on the way out.
>> Slightly annoying, but probably small next to the other overhead of
>> a subtransaction. Comments?


> we use exception blocks heavily here so anything that makes them slower
> is not nice but if it fixes the issue at hand I'm all for it ...


This turned out a bit uglier than I thought --- the real problem is that
plpgsql's "simple eval econtext" management is much too stupid to
survive in a subtransaction world. There was a comment in the code
worrying about this, but I guess we never investigated closely.

The attached patch (against 8.2) appears to fix the reported problem,
but it could use some more testing before I push it into the stable
branches. Can you try it in the production situation that exposed the
problem? Aside from not failing, do you see any performance loss?

regards, tom lane


Index: pl_exec.c
================================================== =================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v
retrieving revision 1.180
diff -c -r1.180 pl_exec.c
*** pl_exec.c 4 Oct 2006 00:30:13 -0000 1.180
--- pl_exec.c 24 Jan 2007 21:46:33 -0000
***************
*** 37,51 ****

static const char *const raise_skip_msg = "RAISE";

-
/*
! * All plpgsql function executions within a single transaction share
! * the same executor EState for evaluating "simple" expressions. Each
! * function call creates its own "eval_econtext" ExprContext within this
! * estate. We destroy the estate at transaction shutdown to ensure there
! * is no permanent leakage of memory (especially for xact abort case).
! */
! static EState *simple_eval_estate = NULL;

/************************************************** **********
* Local function forward declarations
--- 37,69 ----

static const char *const raise_skip_msg = "RAISE";

/*
! * All plpgsql function executions within a single transaction share the same
! * executor EState for evaluating "simple" expressions. Each function call
! * creates its own "eval_econtext" ExprContext within this estate for
! * per-evaluation workspace. eval_econtext is freed at normal function exit,
! * and the EState is freed at transaction end (in case of error, we assume
! * that the abort mechanisms clean it all up). In order to be sure
! * ExprContext callbacks are handled properly, each subtransaction has to have
! * its own such EState; hence we need a stack. We use a simple counter to
! * distinguish different instantiations of the EState, so that we can tell
! * whether we have a current copy of a prepared expression.
! *
! * This arrangement is a bit tedious to maintain, but it's worth the trouble
! * so that we don't have to re-prepare simple expressions on each trip through
! * a function. (We assume the case to optimize is many repetitions of a
! * function within a transaction.)
! */
! typedef struct SimpleEstateStackEntry
! {
! EState *xact_eval_estate; /* EState for current xact level */
! long int xact_estate_simple_id; /* ID for xact_eval_estate */
! SubTransactionId xact_subxid; /* ID for current subxact */
! struct SimpleEstateStackEntry *next; /* next stack entry up */
! } SimpleEstateStackEntry;
!
! static SimpleEstateStackEntry *simple_estate_stack = NULL;
! static long int simple_estate_id_counter = 0;

/************************************************** **********
* Local function forward declarations
***************
*** 154,159 ****
--- 172,178 ----
static void exec_init_tuple_store(PLpgSQL_execstate *estate);
static bool compatible_tupdesc(TupleDesc td1, TupleDesc td2);
static void exec_set_found(PLpgSQL_execstate *estate, bool state);
+ static void plpgsql_create_econtext(PLpgSQL_execstate *estate);
static void free_var(PLpgSQL_var *var);


***************
*** 892,897 ****
--- 911,919 ----
*/
MemoryContext oldcontext = CurrentMemoryContext;
ResourceOwner oldowner = CurrentResourceOwner;
+ ExprContext *old_eval_econtext = estate->eval_econtext;
+ EState *old_eval_estate = estate->eval_estate;
+ long int old_eval_estate_simple_id = estate->eval_estate_simple_id;

BeginInternalSubTransaction(NULL);
/* Want to run statements inside function's memory context */
***************
*** 899,904 ****
--- 921,935 ----

PG_TRY();
{
+ /*
+ * We need to run the block's statements with a new eval_econtext
+ * that belongs to the current subtransaction; if we try to use
+ * the outer econtext then ExprContext shutdown callbacks will be
+ * called at the wrong times.
+ */
+ plpgsql_create_econtext(estate);
+
+ /* Run the block's statements */
rc = exec_stmts(estate, block->body);

/* Commit the inner transaction, return to outer xact context */
***************
*** 906,911 ****
--- 937,947 ----
MemoryContextSwitchTo(oldcontext);
CurrentResourceOwner = oldowner;

+ /* Revert to outer eval_econtext */
+ estate->eval_econtext = old_eval_econtext;
+ estate->eval_estate = old_eval_estate;
+ estate->eval_estate_simple_id = old_eval_estate_simple_id;
+
/*
* AtEOSubXact_SPI() should not have popped any SPI context, but
* just in case it did, make sure we remain connected.
***************
*** 927,932 ****
--- 963,973 ----
MemoryContextSwitchTo(oldcontext);
CurrentResourceOwner = oldowner;

+ /* Revert to outer eval_econtext */
+ estate->eval_econtext = old_eval_econtext;
+ estate->eval_estate = old_eval_estate;
+ estate->eval_estate_simple_id = old_eval_estate_simple_id;
+
/*
* If AtEOSubXact_SPI() popped any SPI context of the subxact, it
* will have left us in a disconnected state. We need this hack
***************
*** 2139,2162 ****
estate->err_text = NULL;

/*
! * Create an EState for evaluation of simple expressions, if there's not
! * one already in the current transaction. The EState is made a child of
! * TopTransactionContext so it will have the right lifespan.
*/
! if (simple_eval_estate == NULL)
! {
! MemoryContext oldcontext;
!
! oldcontext = MemoryContextSwitchTo(TopTransactionContext);
! simple_eval_estate = CreateExecutorState();
! MemoryContextSwitchTo(oldcontext);
! }
!
! /*
! * Create an expression context for simple expressions. This must be a
! * child of simple_eval_estate.
! */
! estate->eval_econtext = CreateExprContext(simple_eval_estate);

/*
* Let the plugin see this function before we initialize any local
--- 2180,2188 ----
estate->err_text = NULL;

/*
! * Create an EState and ExprContext for evaluation of simple expressions.
*/
! plpgsql_create_econtext(estate);

/*
* Let the plugin see this function before we initialize any local
***************
*** 3917,3923 ****
{
Datum retval;
ExprContext *econtext = estate->eval_econtext;
- TransactionId curxid = GetTopTransactionId();
ParamListInfo paramLI;
int i;
Snapshot saveActiveSnapshot;
--- 3943,3948 ----
***************
*** 3929,3941 ****

/*
* Prepare the expression for execution, if it's not been done already in
! * the current transaction.
*/
! if (expr->expr_simple_xid != curxid)
{
expr->expr_simple_state = ExecPrepareExpr(expr->expr_simple_expr,
! simple_eval_estate);
! expr->expr_simple_xid = curxid;
}

/*
--- 3954,3966 ----

/*
* Prepare the expression for execution, if it's not been done already in
! * the current eval_estate.
*/
! if (expr->expr_simple_id != estate->eval_estate_simple_id)
{
expr->expr_simple_state = ExecPrepareExpr(expr->expr_simple_expr,
! estate->eval_estate);
! expr->expr_simple_id = estate->eval_estate_simple_id;
}

/*
***************
*** 4600,4606 ****
*/
expr->expr_simple_expr = tle->expr;
expr->expr_simple_state = NULL;
! expr->expr_simple_xid = InvalidTransactionId;
/* Also stash away the expression result type */
expr->expr_simple_type = exprType((Node *) tle->expr);
}
--- 4625,4631 ----
*/
expr->expr_simple_expr = tle->expr;
expr->expr_simple_state = NULL;
! expr->expr_simple_id = -1;
/* Also stash away the expression result type */
expr->expr_simple_type = exprType((Node *) tle->expr);
}
***************
*** 4641,4654 ****
}

/*
* plpgsql_xact_cb --- post-transaction-commit-or-abort cleanup
*
! * If a simple_eval_estate was created in the current transaction,
* it has to be cleaned up.
- *
- * XXX Do we need to do anything at subtransaction events?
- * Maybe subtransactions need to have their own simple_eval_estate?
- * It would get a lot messier, so for now let's assume we don't need that.
*/
void
plpgsql_xact_cb(XactEvent event, void *arg)
--- 4666,4720 ----
}

/*
+ * plpgsql_create_econtext --- create an eval_econtext for the current function
+ *
+ * We may need to create a new eval_estate too, if there's not one already
+ * for the current (sub) transaction. The EState will be cleaned up at
+ * (sub) transaction end.
+ */
+ static void
+ plpgsql_create_econtext(PLpgSQL_execstate *estate)
+ {
+ SubTransactionId my_subxid = GetCurrentSubTransactionId();
+ SimpleEstateStackEntry *entry = simple_estate_stack;
+
+ /* Create new EState if not one for current subxact */
+ if (entry == NULL ||
+ entry->xact_subxid != my_subxid)
+ {
+ MemoryContext oldcontext;
+
+ /* Stack entries are kept in TopTransactionContext for simplicity */
+ entry = (SimpleEstateStackEntry *)
+ MemoryContextAlloc(TopTransactionContext,
+ sizeof(SimpleEstateStackEntry));
+
+ /* But each EState should be a child of its CurTransactionContext */
+ oldcontext = MemoryContextSwitchTo(CurTransactionContext);
+ entry->xact_eval_estate = CreateExecutorState();
+ MemoryContextSwitchTo(oldcontext);
+
+ /* Assign a reasonably-unique ID to this EState */
+ entry->xact_estate_simple_id = simple_estate_id_counter++;
+ entry->xact_subxid = my_subxid;
+
+ entry->next = simple_estate_stack;
+ simple_estate_stack = entry;
+ }
+
+ /* Link plpgsql estate to it */
+ estate->eval_estate = entry->xact_eval_estate;
+ estate->eval_estate_simple_id = entry->xact_estate_simple_id;
+
+ /* And create a child econtext for the current function */
+ estate->eval_econtext = CreateExprContext(estate->eval_estate);
+ }
+
+ /*
* plpgsql_xact_cb --- post-transaction-commit-or-abort cleanup
*
! * If a simple-expression EState was created in the current transaction,
* it has to be cleaned up.
*/
void
plpgsql_xact_cb(XactEvent event, void *arg)
***************
*** 4657,4667 ****
* If we are doing a clean transaction shutdown, free the EState (so that
* any remaining resources will be released correctly). In an abort, we
* expect the regular abort recovery procedures to release everything of
! * interest.
*/
! if (event == XACT_EVENT_COMMIT && simple_eval_estate)
! FreeExecutorState(simple_eval_estate);
! simple_eval_estate = NULL;
}

static void
--- 4723,4770 ----
* If we are doing a clean transaction shutdown, free the EState (so that
* any remaining resources will be released correctly). In an abort, we
* expect the regular abort recovery procedures to release everything of
! * interest. We don't need to free the individual stack entries since
! * TopTransactionContext is about to go away anyway.
! *
! * Note: if plpgsql_subxact_cb is doing its job, there should be at most
! * one stack entry, but we may as well code this as a loop.
*/
! if (event != XACT_EVENT_ABORT)
! {
! while (simple_estate_stack != NULL)
! {
! FreeExecutorState(simple_estate_stack->xact_eval_estate);
! simple_estate_stack = simple_estate_stack->next;
! }
! }
! else
! simple_estate_stack = NULL;
! }
!
! /*
! * plpgsql_subxact_cb --- post-subtransaction-commit-or-abort cleanup
! *
! * If a simple-expression EState was created in the current subtransaction,
! * it has to be cleaned up.
! */
! void
! plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
! SubTransactionId parentSubid, void *arg)
! {
! if (event == SUBXACT_EVENT_START_SUB)
! return;
!
! if (simple_estate_stack != NULL &&
! simple_estate_stack->xact_subxid == mySubid)
! {
! SimpleEstateStackEntry *next;
!
! if (event == SUBXACT_EVENT_COMMIT_SUB)
! FreeExecutorState(simple_estate_stack->xact_eval_estate);
! next = simple_estate_stack->next;
! pfree(simple_estate_stack);
! simple_estate_stack = next;
! }
}

static void
Index: pl_handler.c
================================================== =================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_handler.c,v
retrieving revision 1.33
diff -c -r1.33 pl_handler.c
*** pl_handler.c 19 Oct 2006 18:32:48 -0000 1.33
--- pl_handler.c 24 Jan 2007 21:46:33 -0000
***************
*** 46,51 ****
--- 46,52 ----

plpgsql_HashTableInit();
RegisterXactCallback(plpgsql_xact_cb, NULL);
+ RegisterSubXactCallback(plpgsql_subxact_cb, NULL);

/* Set up a rendezvous point with optional instrumentation plugin */
plugin_ptr = (PLpgSQL_plugin **) find_rendezvous_variable("PLpgSQL_plugin");
Index: plpgsql.h
================================================== =================
RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/plpgsql.h,v
retrieving revision 1.81
diff -c -r1.81 plpgsql.h
*** plpgsql.h 4 Oct 2006 00:30:14 -0000 1.81
--- plpgsql.h 24 Jan 2007 21:46:34 -0000
***************
*** 180,190 ****
Oid expr_simple_type;

/*
! * if expr is simple AND in use in current xact, expr_simple_state is
! * valid. Test validity by seeing if expr_simple_xid matches current XID.
*/
ExprState *expr_simple_state;
! TransactionId expr_simple_xid;
/* params to pass to expr */
int nparams;
int params[1]; /* VARIABLE SIZE ARRAY ... must be last */
--- 180,192 ----
Oid expr_simple_type;

/*
! * if expr is simple AND prepared in current eval_estate,
! * expr_simple_state is valid. Test validity by seeing if expr_simple_id
! * matches eval_estate_simple_id.
*/
ExprState *expr_simple_state;
! long int expr_simple_id;
!
/* params to pass to expr */
int nparams;
int params[1]; /* VARIABLE SIZE ARRAY ... must be last */
***************
*** 612,618 ****
SPITupleTable *eval_tuptable;
uint32 eval_processed;
Oid eval_lastoid;
! ExprContext *eval_econtext;

/* status information for error context reporting */
PLpgSQL_function *err_func; /* current func */
--- 614,622 ----
SPITupleTable *eval_tuptable;
uint32 eval_processed;
Oid eval_lastoid;
! ExprContext *eval_econtext; /* for executing simple expressions */
! EState *eval_estate; /* EState containing eval_econtext */
! long int eval_estate_simple_id; /* ID for eval_estate */

/* status information for error context reporting */
PLpgSQL_function *err_func; /* current func */
***************
*** 738,743 ****
--- 742,749 ----
extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func,
TriggerData *trigdata);
extern void plpgsql_xact_cb(XactEvent event, void *arg);
+ extern void plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid,
+ SubTransactionId parentSubid, void *arg);

/* ----------
* Functions for the dynamic string handling in pl_funcs.c


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-12-2008, 06:38 AM
Stefan Kaltenbrunner
 
Posts: n/a
Default Re: "tupdesc reference is not owned by resource owner Portal"

Tom Lane wrote:
> Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
>> Tom Lane wrote:
>>> I think the proper fix is probably to establish a new eval_context
>>> when we enter an EXCEPTION block, and destroy it again on the way out.
>>> Slightly annoying, but probably small next to the other overhead of
>>> a subtransaction. Comments?

>
>> we use exception blocks heavily here so anything that makes them slower
>> is not nice but if it fixes the issue at hand I'm all for it ...

>
> This turned out a bit uglier than I thought --- the real problem is that
> plpgsql's "simple eval econtext" management is much too stupid to
> survive in a subtransaction world. There was a comment in the code
> worrying about this, but I guess we never investigated closely.
>
> The attached patch (against 8.2) appears to fix the reported problem,
> but it could use some more testing before I push it into the stable
> branches. Can you try it in the production situation that exposed the
> problem? Aside from not failing, do you see any performance loss?


thanks - this seems to fix the problem on the development system but it
might take a while to get some performance testing done.


Stefan

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:22 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651