Skip to content

pkg/aflow: repro from crash generation workflow (prototype)#6851

Draft
tarasmadan wants to merge 1 commit intogoogle:masterfrom
tarasmadan:crash-repro-workflow
Draft

pkg/aflow: repro from crash generation workflow (prototype)#6851
tarasmadan wants to merge 1 commit intogoogle:masterfrom
tarasmadan:crash-repro-workflow

Conversation

@tarasmadan
Copy link
Copy Markdown
Collaborator

@tarasmadan tarasmadan commented Feb 25, 2026

Integration testing may take some time thus I think it is better to be postponed.

@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch 6 times, most recently from 80fc471 to d6aa434 Compare February 27, 2026 10:03
@tarasmadan tarasmadan marked this pull request as ready for review February 27, 2026 10:43
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch 2 times, most recently from d9b886a to 4d636df Compare February 27, 2026 11:04
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch 11 times, most recently from 9488053 to 4290adf Compare February 27, 2026 14:44
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch 2 times, most recently from 34a2c16 to 3faeb35 Compare March 3, 2026 09:26
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch from 3faeb35 to 60cf379 Compare March 3, 2026 10:30
@tarasmadan tarasmadan marked this pull request as ready for review March 3, 2026 14:10
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch 8 times, most recently from 3c70578 to aa24b85 Compare March 4, 2026 17:43
@tarasmadan tarasmadan force-pushed the crash-repro-workflow branch from aa24b85 to 46153a7 Compare March 4, 2026 18:11
@tarasmadan tarasmadan changed the title pkg/aflow/docs: repro from crash generation workflow pkg/aflow: repro from crash generation workflow Mar 4, 2026
@tarasmadan tarasmadan changed the title pkg/aflow: repro from crash generation workflow pkg/aflow: repro from crash generation workflow (prototype) Mar 4, 2026
@tarasmadan tarasmadan requested a review from dvyukov March 5, 2026 07:13
@tarasmadan
Copy link
Copy Markdown
Collaborator Author

@ramosian-glider @dvyukov ptal.
It works but is blind. #6878 is about what's next.

args.KernelCommit, hash.String(args.KernelConfig), hash.String(imageData),
args.Type, hash.String(args.VM), hash.String(args.ReproC))
args.Type, hash.String(args.VM), hash.String(args.ReproC),
hash.String([]byte(args.ReproSyz)), hash.String([]byte(args.ReproOpts)))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hash.String accept strings?

You are an expert in linux kernel fuzzing. Your goal is to write a syzkaller program to trigger
a specific bug.

First, search for the relevant syzlang definitions using the syzlang-search tool.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syzlang-search tool does not seem to exist now.

"github.com/google/syzkaller/pkg/aflow/action/crash"
"github.com/google/syzkaller/pkg/aflow/action/kernel"
"github.com/google/syzkaller/pkg/aflow/ai"
toolcrash "github.com/google/syzkaller/pkg/aflow/tool/crash"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call the package toolcrash. Renaming is rarely used, and is more of an exception. Let's say when you import 2 packages from different projects, and they happen to be named the same. But here we create both package next to each other, and they are supposed to be imported together. renaming them each time does not make sense.

Prefixing is a semi-common technique, e.g. io/ioutil, testing/iotest.

VM json.RawMessage

// We don't use them. Needed to use crash.Reproduce.
ReproOpts string
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nasty. This means we will need create these as inputs to the workflow, and permanently store in the database as inputs. And having ReproC as input to a repro workflow looks wrong.
Moreover, these are internal implementation artifacts leaking to the public interface. Later we may have more of these, or find a way to remove these, and we will need to change the public interface, what inputs we create/store for workflows.

I am not sure what's the best way to remove this from the workflow inputs... perhaps some action that produces given variables with fixed values?

  // This is needed b/c ...
  aflow.Produce("ReproC", ""),
  aflow.Produce("ReproOpts", ""),

}

// CompareAction performs the comparison. It is exported so tools can use its Run method.
type CompareAction struct {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexport the type.

Syzkaller string
}

type listFilesArgs struct {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the tool does not have args, LLM must always call it, and it must call it once, it suggests we should just give it the list in the prompt.


func listFiles(ctx *aflow.Context, state descriptionsToolState, args listFilesArgs) (listFilesResult, error) {
var files []string
dir := filepath.Join(state.Syzkaller, "sys", "linux")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have descriptions in the syzkaller dir (as implied by syz-ci and syz-agent). IIRC we only have few binaries there, and test seeds.

return nil
})
if err != nil {
return listFilesResult{}, aflow.BadCallError("failed to access sys/linux: %v", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also hard error. LLM can't fix/.work around this.

func getFile(ctx *aflow.Context, state descriptionsToolState, args getFileArgs) (getFileResult, error) {
data, err := os.ReadFile(filepath.Join(state.Syzkaller, "sys", "linux", args.File))
if err != nil {
return getFileResult{}, aflow.BadCallError("failed to access %s: %v", args.File, err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard error

return getFileResult{}, aflow.BadCallError("failed to access %s: %v", args.File, err)
}
if len(data) == 0 {
return getFileResult{}, aflow.BadCallError("failed to access %s: empty file", args.File)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can this happen? What does it mean?

@dvyukov dvyukov marked this pull request as draft March 9, 2026 13:31
@tarasmadan
Copy link
Copy Markdown
Collaborator Author

@gemini-cli take the design doc and create the new PR to discuss and integrate it. Don't modify the doc itself.

@github-actions
Copy link
Copy Markdown

🤖 Hi @tarasmadan, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

🤖 AI Assistant: Plan of Action

I have analyzed the request and propose the following plan. This plan will not be executed until it is approved by a maintainer.

Resource Estimate:

  • Estimated Tool Calls: ~4
  • Files to Modify: 1 (in a new branch)

Proposed Steps:

  • Step 1: Extract the contents of the design doc (pkg/aflow/docs/crash-to-repro.md) as currently proposed in PR pkg/aflow: repro from crash generation workflow (prototype) #6851.
  • Step 2: Create a new branch from the main/base branch specifically for the design doc.
  • Step 3: Add pkg/aflow/docs/crash-to-repro.md to this new branch without modifying its content, and commit the changes.
  • Step 4: Create a new Pull Request from the new branch to facilitate discussion and integration of the design doc.

Please review this plan. To approve, comment @gemini-cli /approve on this issue. To make changes, comment changes needed.

@tarasmadan
Copy link
Copy Markdown
Collaborator Author

@gemini-cli /approve

@github-actions
Copy link
Copy Markdown

🤖 Hi @tarasmadan, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

✅ Task Complete

I have successfully executed the approved plan.

Summary of Changes:

  • Extracted the AI-driven reproducer generation design doc (pkg/aflow/docs/crash-to-repro.md) from PR pkg/aflow: repro from crash generation workflow (prototype) #6851.
  • Created a new branch aflow-design-doc from master.
  • Committed the design doc to the new branch without modifications, as requested.
  • Created a new Pull Request for the design doc to facilitate discussion.

Pull Request:

My work on this issue is now complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants