#49 fix: segmentation fault on second image generation (progress callback issue)

Uzavrená
otvorené 3 mesiacov pred užívateľom agent001 · 0 komentárov

Issue Description

The application crashes with a segmentation fault when a second image generation is started. This appears to be caused by an issue with the progress callback mechanism.

Problem Analysis

The segmentation fault likely occurs due to:

  1. Progress callback referring to invalid memory after first generation completes
  2. Callback not being properly cleaned up between generations
  3. Thread safety issues with the callback during concurrent generation requests
  4. dangling pointers in the callback context

Expected Behavior

  • Multiple image generation requests should work sequentially without crashing
  • Progress callbacks should be properly managed across multiple generations
  • Memory should be correctly cleaned up after each generation completes

Implementation Plan

  1. Investigate progress callback implementation in stable_diffusion_wrapper.cpp
  2. Check callback lifecycle management during generation start/stop
  3. Verify thread safety of callback mechanisms
  4. Fix memory management issues with callback context
  5. Test with multiple sequential generations to verify fix

Files to Examine

  • src/stable_diffusion_wrapper.cpp - Progress callback implementation
  • src/model_manager.cpp - Generation lifecycle management
  • include/stable_diffusion_wrapper.h - Callback definitions

Testing Strategy

  • Test multiple sequential image generation requests
  • Verify progress reporting works correctly for each generation
  • Check memory usage patterns during multiple generations
  • Ensure no memory leaks or dangling pointers remain
## Issue Description The application crashes with a segmentation fault when a second image generation is started. This appears to be caused by an issue with the progress callback mechanism. ## Problem Analysis The segmentation fault likely occurs due to: 1. Progress callback referring to invalid memory after first generation completes 2. Callback not being properly cleaned up between generations 3. Thread safety issues with the callback during concurrent generation requests 4. dangling pointers in the callback context ## Expected Behavior - Multiple image generation requests should work sequentially without crashing - Progress callbacks should be properly managed across multiple generations - Memory should be correctly cleaned up after each generation completes ## Implementation Plan 1. **Investigate progress callback implementation** in stable_diffusion_wrapper.cpp 2. **Check callback lifecycle management** during generation start/stop 3. **Verify thread safety** of callback mechanisms 4. **Fix memory management** issues with callback context 5. **Test with multiple sequential generations** to verify fix ## Files to Examine - `src/stable_diffusion_wrapper.cpp` - Progress callback implementation - `src/model_manager.cpp` - Generation lifecycle management - `include/stable_diffusion_wrapper.h` - Callback definitions ## Testing Strategy - Test multiple sequential image generation requests - Verify progress reporting works correctly for each generation - Check memory usage patterns during multiple generations - Ensure no memory leaks or dangling pointers remain
Prihláste sa pre zapojenie do konverzácie.
Žiadne štítky
bug
ui
Žiadny míľnik
Žiadny priradený
1 účastníkov
Načítavanie...
Zrušiť
Uložiť
Zatiaľ neexistuje žiadny obsah.