openresty / openresty/luajit2

ppc32be soft-float ipairs crash pairs failed

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.4k
Forks
252
Avg merge
7d 11h
Merged PRs (30d)
3

Description

luajit2-2.1-20201027
ppc32be soft-float

1、ipairs crash
https://github.com/openresty/luajit2/commit/2763a421d6219c8cb2bbd39246de619dc796bab6#diff-799b9b8bc55491b513dd21c26721f966261ef4c121b862327e716241ea8a4d94

|.ffunc ipairs_aux
....
lwz TMP3, 4(TMP1) -----modified to--------> lwz TMP3, WORD_HI(TMP1) maybe lwz TMP3, WORD_LO(TMP1)

because of it , for _, v in ipairs(record) do will crash.

2、pairs failed

for k, v in pairs(record) do No matter record is what, k is always nil.

|.macro .ffunc_1, name
| cmplwi NARGS8:RC, 8 ----------why RC is always 8??
@siddhesh

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two loop cases on ppc32 soft-float using the luajit2-2.1-20201027 context. Read the linked commit diff, then inspect the ipairs_aux path and the .ffunc_1 macro around the reported lwz and cmplwi NARGS8:RC, 8 lines. Done means ipairs(record) no longer crashes and pairs(record) yields keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.