Opened 15 years ago
Closed 15 years ago
#89 closed defect (fixed)
compiler stack inconsistency
Reported by: | Mark Evenson | Owned by: | ehuelsmann |
---|---|---|---|
Priority: | critical | Milestone: | 0.21 |
Component: | compiler | Version: | 0.20 |
Keywords: | Cc: | ||
Parent Tickets: |
Description
In checking out the latest ASDF, I was able to factor out the following case of the compiler generating stack inconsistency:
(defun get-uid (stream uid-string) (with-input-from-string (stream uid-string) (read-line stream) (handler-case (parse-integer (read-line stream)) (error () (error "Unable to find out user ID")))))
Loading the generated code causes a java.lang.VerifyError? to be thrown.
Attachments (3)
Change History (11)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Without a HANDLER-CASE:
(defun f () (let ((stream (make-string-input-stream "f" 0))) (read-line stream) (lambda () (return-from f))))
comment:3 Changed 15 years ago by
Attaching a patch which fixes the last two test cases, but not the original.
I suspect that this error was introduced in r12170, which means that P2-TAGBODY-NODE needs the same sort of fix.
Changed 15 years ago by
Attachment: | abcl-ticket-89.patch added |
---|
Fix stack inconsistency in P2-BLOCK-NODE
comment:4 Changed 15 years ago by
Milestone: | → 0.20 |
---|
That patch doesn't do as much as I had hoped, as the analysis of the problem here is still rather incomplete.
Erik has suggested that due to the heavy use of specials in P2, it is rather hard to follow any sufficiently complicated example as the information as to which code sections corresponds to which handler quickly get lost.
comment:5 Changed 15 years ago by
r12620 patches the system to use the interpreted form if a stack inconsistency is detected.
comment:6 Changed 15 years ago by
Milestone: | 0.20 → 0.21 |
---|---|
Priority: | major → critical |
Alessio tested this on 0.18.1 and there's no regression here, so, while I do find this a critical prio issue (and raising to that level); I don't see a blocker - not a regression.
Increasing milestone to 0.21.
Changed 15 years ago by
Attachment: | abcl-compiler-analysis-proposal.svg added |
---|
proposed visualization
comment:7 Changed 15 years ago by
Attached a sketch of the idea that came to my mind biking to work today.
Essentially, I don't think we have a graph that is very interesting. What we have is a linear list of instructions for which there are various line segments associated with each excution path. Each such path has an expected stack height that would best be represented as a "height" as displacement from the axis of the linear list of instructions.
comment:8 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Changed 15 years ago by
The graph that I used to find the problem and fix it
Simplified test case (which only produces one stack inconsistency message):