Opened 16 years ago
Closed 16 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 by , 16 years ago
comment:2 by , 16 years ago
Without a HANDLER-CASE:
(defun f ()
(let ((stream (make-string-input-stream "f" 0)))
(read-line stream)
(lambda ()
(return-from f))))
comment:3 by , 16 years ago
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.
comment:4 by , 16 years ago
| 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 by , 16 years ago
r12620 patches the system to use the interpreted form if a stack inconsistency is detected.
comment:6 by , 16 years ago
| 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.
comment:7 by , 16 years ago
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 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Simplified test case (which only produces one stack inconsistency message):
(defun get-uid () (let ((stream (make-string-input-stream "foo" 0))) (read-line stream) (handler-case 42)))