Only the first error in a method is reported; later errors in the same method are hidden

Đang mở
#428 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
compilers, testing

Hướng nghiên cứu

Start with the verifier path that checks method calls and reports State Refinement Errors; the payload does not name source files or tests, so locate that entry point and its existing tests for multiple errors. Reproduce the two calls in one method and compare with the two-method control. Done means both errors are reported while the control still reports both.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement error messages

Impact: real bugs are hidden (false negatives): after the first error in a method, later errors in the same method are not reported, so fixing one bug and re-running is the only way to see the next.

Description

Errors in different methods are all reported, but within one method verification stops at the first error. In one of our benchmark exercises (E_A2_07_PortPairBinder, modelled on a real port-binding bug), two ServerSockets created already bound are bound again in the same method (bulk.bind(...) and health.bind(...)); only the first is reported.

Minimal reproducer (two files)

import liquidjava.specification.ExternalRefinementsFor;
import liquidjava.specification.StateRefinement;
import liquidjava.specification.StateSet;

@ExternalRefinementsFor("java.io.BufferedReader")
@StateSet({"open", "marked", "closed"})
interface BufferedReaderRefinements {
    @StateRefinement(to = "open(this)")
    void BufferedReader(java.io.Reader in);

    @StateRefinement(from = "open(this)")
    @StateRefinement(from = "marked(this)")
    String readLine();

    @StateRefinement(from = "open(this)", to = "marked(this)")
    @StateRefinement(from = "marked(this)")
    void mark(int readAheadLimit);

    @StateRefinement(from = "marked(this)", to = "open(this)")
    void reset();

    @StateRefinement(from = "!closed(this)", to = "closed(this)")
    void close();
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;

public class Repro {
    static void twoBugs(Reader a, Reader b) throws IOException {
        BufferedReader first = new BufferedReader(a);
        first.close();
        first.readLine();   // error 1: reported
        BufferedReader second = new BufferedReader(b);
        second.reset();     // error 2: never marked, not reported
    }
}

Expected: two State Refinement Errors, at first.readLine() and at second.reset().

Actual: only the first:

State Refinement Error: found closed(first²¹) but expected open(first²¹) || marked(first²¹)
 9 |         first.readLine();   // error 1: reported

Control: with the two calls in two methods, both are reported.

Suggestion: after reporting a refused call, continue as if the call had succeeded (assume its to state, or the precondition), so later calls are checked against a sensible state rather than cascading errors from the first.

Ngôn ngữ chính
Java
Star
73
Fork
38
Merge trung bình
12 giờ 32 phút
Pull request đã merge (30 ngày)
45

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của liquid-java/liquidjava

Tất cả issue của liquid-java/liquidjava

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.