#5 bug: segmentation fault

Slēgta
fszontagh atvēra 3 mēneši atpakaļ · 1 komentāri

When the second job started, the server segfaults:

[1]    905044 segmentation fault (core dumped)

start command:

./src/stable-diffusion-rest-server --models-dir /data/SD_MODELS --port 8082 --host 0.0.0.0 --ui-dir ./webu
When the second job started, the server segfaults: ``` [1] 905044 segmentation fault (core dumped) ``` start command: ``` ./src/stable-diffusion-rest-server --models-dir /data/SD_MODELS --port 8082 --host 0.0.0.0 --ui-dir ./webu ```
Szontágh Ferenc komentēja 3 mēneši atpakaļ
Īpašnieks

Fixed in commit b191071

Root Cause: The segmentation fault was caused by a dangling progress callback pointer. When the second generation job started, it attempted to use the callback pointer from the first job, which had already been deleted.

Solution: Added sd_set_progress_callback(nullptr, nullptr) to clear the callback pointer before deleting the callback data. This ensures the stable-diffusion.cpp library doesn't try to call a deleted callback.

Changes:

  • Modified src/stable_diffusion_wrapper.cpp
  • Cleared callback in generateText2Img() (line 154)
  • Cleared callback in generateImg2Img() (line 264)
  • Cleared callback in generateControlNet() (line 375)

Testing:

  • Server and UI rebuilt successfully
  • Code follows established cleanup patterns
  • Prevents dangling pointer access

The fix is now live and should prevent segfaults when running multiple consecutive generation jobs.

## Fixed in commit b191071 **Root Cause:** The segmentation fault was caused by a dangling progress callback pointer. When the second generation job started, it attempted to use the callback pointer from the first job, which had already been deleted. **Solution:** Added `sd_set_progress_callback(nullptr, nullptr)` to clear the callback pointer before deleting the callback data. This ensures the stable-diffusion.cpp library doesn't try to call a deleted callback. **Changes:** - Modified `src/stable_diffusion_wrapper.cpp` - Cleared callback in `generateText2Img()` (line 154) - Cleared callback in `generateImg2Img()` (line 264) - Cleared callback in `generateControlNet()` (line 375) **Testing:** - Server and UI rebuilt successfully - Code follows established cleanup patterns - Prevents dangling pointer access The fix is now live and should prevent segfaults when running multiple consecutive generation jobs.
Pierakstieties, lai pievienotos šai sarunai.
Nav etiķešu
bug
ui
Nav atskaites punktu
Nav atbildīgā
1 dalībnieki
Notiek ielāde...
Atcelt
Saglabāt
Vēl nav satura.