diff options
| -rw-r--r-- | bugs | 158 |
1 files changed, 157 insertions, 1 deletions
| @@ -1,4 +1,4 @@ | |||
| 1 | 1 | --[[ | |
| 2 | ** lua.stx / llex.c | 2 | ** lua.stx / llex.c |
| 3 | Tue Dec 2 10:45:48 EDT 1997 | 3 | Tue Dec 2 10:45:48 EDT 1997 |
| 4 | >> BUG: "lastline" was not reset on function entry, so debug information | 4 | >> BUG: "lastline" was not reset on function entry, so debug information |
| @@ -334,3 +334,159 @@ Thu Mar 20 11:40:12 EST 2003 | |||
| 334 | >> zio mixes a 255 as first char in a buffer with EOZ | 334 | >> zio mixes a 255 as first char in a buffer with EOZ |
| 335 | (by lhf; since 5.0a) | 335 | (by lhf; since 5.0a) |
| 336 | 336 | ||
| 337 | |||
| 338 | |||
| 339 | --]] | ||
| 340 | ----------------------------------------------------------------- | ||
| 341 | -- Lua 5.0 (final) | ||
| 342 | |||
| 343 | Bug{ | ||
| 344 | what = [[lua_closethread exists only in the manual]], | ||
| 345 | report = [[by Nguyen Binh, 28/04/2003]], | ||
| 346 | patch = [[no patch; the manual is wrong]], | ||
| 347 | } | ||
| 348 | |||
| 349 | |||
| 350 | Bug{ | ||
| 351 | what = [[attempt to resume a running coroutine crashes Lua]], | ||
| 352 | example = [[ | ||
| 353 | function co_func (current_co) | ||
| 354 | coroutine.resume(co) | ||
| 355 | end | ||
| 356 | co = coroutine.create(co_func) | ||
| 357 | coroutine.resume(co) | ||
| 358 | coroutine.resume(co) --> seg. fault | ||
| 359 | ]], | ||
| 360 | report = [[by Alex Bilyk, 09/05/2003]], | ||
| 361 | patch = [[???]], | ||
| 362 | } | ||
| 363 | |||
| 364 | |||
| 365 | Bug{ | ||
| 366 | what = [[file:close cannot be called without a file. (results in seg fault)]], | ||
| 367 | example = [[ | ||
| 368 | > io.stdin.close() -- correct call shold be io.stdin:close() | ||
| 369 | ]], | ||
| 370 | report = [[by Tuomo Valkonen, 27/05/2003]], | ||
| 371 | patch = [[ | ||
| 372 | * liolib.c: | ||
| 373 | 161c161 | ||
| 374 | < if (lua_isnone(L, 1)) { | ||
| 375 | --- | ||
| 376 | > if (lua_isnone(L, 1) && lua_type(L, lua_upvalueindex(1)) == LUA_TTABLE) { | ||
| 377 | ]], --}} | ||
| 378 | } | ||
| 379 | |||
| 380 | |||
| 381 | Bug{ | ||
| 382 | what = [[C functions also may have stacks larger than current top]], | ||
| 383 | example = [[ | ||
| 384 | Must recompile lua with a change in lua.c and with lua_assert defined: | ||
| 385 | * lua.c: | ||
| 386 | 381a382 | ||
| 387 | > lua_checkstack(l, 1000); | ||
| 388 | ]], | ||
| 389 | report = [[Alex Bilyk, 09/06/2003]], | ||
| 390 | patch = [[ | ||
| 391 | * lgc.c: | ||
| 392 | 247c247 | ||
| 393 | < if (!(ci->state & CI_C) && lim < ci->top) | ||
| 394 | --- | ||
| 395 | > if (lim < ci->top) | ||
| 396 | ]], | ||
| 397 | } | ||
| 398 | |||
| 399 | Bug{ | ||
| 400 | what = [[`pc' address is invalidated when a coroutine is suspended]], | ||
| 401 | example = [[ | ||
| 402 | function g(x) | ||
| 403 | coroutine.yield(x) | ||
| 404 | end | ||
| 405 | |||
| 406 | function f (i) | ||
| 407 | debug.sethook(print, "l") | ||
| 408 | for j=1,1000 do | ||
| 409 | g(i+j) | ||
| 410 | end | ||
| 411 | end | ||
| 412 | |||
| 413 | co = coroutine.wrap(f) | ||
| 414 | co(10) | ||
| 415 | pcall(co) | ||
| 416 | pcall(co) | ||
| 417 | ]], | ||
| 418 | report = [[Nick Trout, 07/07/2003]], | ||
| 419 | patch = [[ | ||
| 420 | * lvm.c: | ||
| 421 | 402d401 | ||
| 422 | < L->ci->u.l.pc = &pc; | ||
| 423 | 405a405 | ||
| 424 | > L->ci->u.l.pc = &pc; | ||
| 425 | 676,678c676 | ||
| 426 | < lua_assert(ci->u.l.pc == &pc && | ||
| 427 | < ttisfunction(ci->base - 1) && | ||
| 428 | < (ci->state & CI_SAVEDPC)); | ||
| 429 | --- | ||
| 430 | > lua_assert(ttisfunction(ci->base - 1) && (ci->state & CI_SAVEDPC)); | ||
| 431 | ]] | ||
| 432 | } | ||
| 433 | |||
| 434 | |||
| 435 | Bug{ | ||
| 436 | what = [[userdata to be collected still counts into new GC threshold, | ||
| 437 | increasing memory consumption]], | ||
| 438 | report = [[Roberto, 25/07/2003]], | ||
| 439 | example = [[ | ||
| 440 | a = newproxy(true) | ||
| 441 | getmetatable(a).__gc = function () end | ||
| 442 | for i=1,10000000 do | ||
| 443 | newproxy(a) | ||
| 444 | if math.mod(i, 10000) == 0 then print(gcinfo()) end | ||
| 445 | end | ||
| 446 | ]], | ||
| 447 | patch = [[ | ||
| 448 | *lgc.h: | ||
| 449 | 18c18 | ||
| 450 | < void luaC_separateudata (lua_State *L); | ||
| 451 | --- | ||
| 452 | > size_t luaC_separateudata (lua_State *L); | ||
| 453 | |||
| 454 | *lgc.c: | ||
| 455 | 113c113,114 | ||
| 456 | < void luaC_separateudata (lua_State *L) { | ||
| 457 | --- | ||
| 458 | > size_t luaC_separateudata (lua_State *L) { | ||
| 459 | > size_t deadmem = 0; | ||
| 460 | 127a129 | ||
| 461 | > deadmem += sizeudata(gcotou(curr)->uv.len); | ||
| 462 | 136a139 | ||
| 463 | > return deadmem; | ||
| 464 | 390c393 | ||
| 465 | < static void checkSizes (lua_State *L) { | ||
| 466 | --- | ||
| 467 | > static void checkSizes (lua_State *L, size_t deadmem) { | ||
| 468 | 400c403 | ||
| 469 | < G(L)->GCthreshold = 2*G(L)->nblocks; /* new threshold */ | ||
| 470 | --- | ||
| 471 | > G(L)->GCthreshold = 2*G(L)->nblocks - deadmem; /* new threshold */ | ||
| 472 | 454c457,458 | ||
| 473 | < static void mark (lua_State *L) { | ||
| 474 | --- | ||
| 475 | > static size_t mark (lua_State *L) { | ||
| 476 | > size_t deadmem; | ||
| 477 | 467c471 | ||
| 478 | < luaC_separateudata(L); /* separate userdata to be preserved */ | ||
| 479 | --- | ||
| 480 | > deadmem = luaC_separateudata(L); /* separate userdata to be preserved */ | ||
| 481 | 475a480 | ||
| 482 | > return deadmem; | ||
| 483 | 480c485 | ||
| 484 | < mark(L); | ||
| 485 | --- | ||
| 486 | > size_t deadmem = mark(L); | ||
| 487 | 482c487 | ||
| 488 | < checkSizes(L); | ||
| 489 | --- | ||
| 490 | > checkSizes(L, deadmem); | ||
| 491 | ]] | ||
| 492 | |||
