Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when exporting (Windows) #15876

Closed
c-h-r-i-s-t-i-a-n opened this issue Dec 14, 2023 · 20 comments · Fixed by #15885
Closed

Crash when exporting (Windows) #15876

c-h-r-i-s-t-i-a-n opened this issue Dec 14, 2023 · 20 comments · Fixed by #15885
Assignees
Labels
bug: pending someone needs to start working on that priority: high core features are broken and not usable at all, software crashes

Comments

@c-h-r-i-s-t-i-a-n
Copy link

Describe the bug

darktable crashes when exporting an image with settings maxheight 1080, use-hq-reampling yes.

Steps to reproduce

  1. Lighttable export tab
  2. Set maxheigt 1080 ( 0 x 1080 )
  3. Set high-quality-resampling = yes
  4. Hit "export"

Expected behavior

no crash should occur

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

4.5.0+1435~g6d4cfccf32-dirty

What OS are you using?

Windows

What is the version of your OS?

Windows 10 64 bit

Describe your system?

The installer was build using MSYS.

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

@c-h-r-i-s-t-i-a-n
Copy link
Author

I'm getting no crash with size setting 0 x 800.

@TurboGit
Copy link
Member

Probably a memory issue. The HQ export needs lot of memory.

@c-h-r-i-s-t-i-a-n
Copy link
Author

Last lines in darktable.log :

33,8936 clip_and_zoom_roi          [export]         demosaic               (   0/   0) 4935x3296 scale=1,0000 --> (   0/   0) 4935x3297 scale=1,0000 
33,9410 [lighttable] expose took 0,0000 sec
33,9591 [lighttable] expose took 0,0000 sec

Magick: caught exception 0xC0000005 "Access violation"...

@gi-man
Copy link
Contributor

gi-man commented Dec 14, 2023

I cannot reproduce. I built darktable 4.5.0+1448~g857a694abb on Win11. I tested with OpenCL and CPU only.

I noticed that your build says dirty. (4.5.0+1435~g6d4cfccf32-dirty)

Can you reproduce using the nightly or bills weekly?

@jenshannoschwalm
Copy link
Collaborator

It could be there is still a module doing memory requirement calculations wrong. Please share an xmp with raw to be checked.

@c-h-r-i-s-t-i-a-n
Copy link
Author

RAF here.
Crash with 0 x 1080, no crash with 0 x 2048.

DSCF8814.zip

@c-h-r-i-s-t-i-a-n
Copy link
Author

Additional info: I have build with setting USE_GMIC = NO.

@gi-man
Copy link
Contributor

gi-man commented Dec 15, 2023

Using the same build darktable 4.5.0+1448~g857a694abb on Win11.

I'm able to reproduce using the RAF file + xmp and CPU path. https://pastebin.com/L7S22mwe

I modified the xmp to rule out other modules and tested with OpenCL and I can reproduce too. Output using verbose has some more information. The issue is in the pixel interpolator scaling. I tried change from lanczos3 to bicubic or bilinear, but no effect.

https://pastebin.com/wwmdnCqK

    14.7323 clip_and_zoom_roi          [export]         demosaic               (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 
    14.7324 resample_plain                                                     (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 bicubic
    14.7817 [lighttable] expose took 0.0000 sec
Magick: caught exception 0xC0000005 "Access violation"...

@jenshannoschwalm jenshannoschwalm added priority: high core features are broken and not usable at all, software crashes bug: pending someone needs to start working on that labels Dec 15, 2023
@jenshannoschwalm jenshannoschwalm self-assigned this Dec 15, 2023
@gi-man
Copy link
Contributor

gi-man commented Dec 15, 2023

Hanno, I tried to reproduce on Fedora 39 KDE (4.5.0~git1459.9491da2c). I cant.

edit:
I just tried the 1 and 1080 on Fedora, and I get the same failed to export.

39.2818 [dev_process_export] pixel pipeline processing took 0.152 secs (0.750 CPU)
Empty JPEG image (DNL not supported)

@gi-man
Copy link
Contributor

gi-man commented Dec 15, 2023

Doing bisect on Windows takes a long time to build. But I had some old install files saved. I get the issue with:

  • darktable-4.5.0+531~gbf80424ca6
  • darktable-4.4.2 from darktable.org
  • darktable-4.3.0+467~gaf54ffe9a

I noticed that for the issue to happen, high quality resampling must be set to Yes and the output has to be 0 and 1080. If I use:

  • 1 and 1080 - It fails to export but no crash
  • 2 and 1080 - exports fine
  • 0 and 1079/1081 -exports fine.
  • 1080 and 0 - exports fine.

@TurboGit
Copy link
Member

Is that with up scaling enabled too?

@gi-man
Copy link
Contributor

gi-man commented Dec 15, 2023

Upscale is set to no.

@jenshannoschwalm
Copy link
Collaborator

Without upscaling we shouldn't have a larger output- than input region.

@gi-man
Copy link
Contributor

gi-man commented Dec 16, 2023

I had some free time today to further explore this. I'm mostly interested in learning more about this works. So far this is what I discover:

  • the issue only happens on .raf file, so X-trans sensor. The demosiac method does not matter
  • If I crop the image from full to something smaller, it exports correctly
  • There is an error in the demosiac that happens in Windows and Linux when using the openCL. On linux the CPU path is then sucessful.
    64.1896 pixelpipe process CL       [export]         demosaic               (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 IOP_CS_RAW -> IOP_CS_RGB
    64.2221 clip_and_zoom_roi_cl       [export]         demosaic               (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 
    64.2221 [opencl copy_image] could not copy image on device 0: CL_INVALID_VALUE
    64.2221 interpolation_resample_cl                                          (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 Error: CL_INVALID_VALUE
    64.2421 [opencl_demosaic] vng problem 'CL_INVALID_VALUE'
    64.2421 Error: process_CL          [export]         demosaic               (   0/   0) 4935x3296 scale=1.0000 --> (   0/   0) 4935x3297 scale=1.0000 device=0 (nvidiacudanvidiageforcertx3060), CL_INVALID_VALUE

The part I dont understand is why do the scaling down affect this module? It's my understanding that the downscale scale happens at the end of the pipe when the resampling is selected.

@jenshannoschwalm
Copy link
Collaborator

@gi-man thanks for your testing. Indeed with high quality resampling being ON we will downscale at the very end of the pipe. But for some reason 1) roi_in & roi_out differ in demosaic and there is some scaling and 2) there seems to be something wrong with clip_and_zoom_roi_cl as it should normally not fail - this could be due to several reasons.

@jenshannoschwalm
Copy link
Collaborator

I think i got it, basically finalscale is "overexpanding". Could you test #15885 ?

@c-h-r-i-s-t-i-a-n
Copy link
Author

Can I ignore this virus warning (MS Defender) ?

defender

@victoryforce
Copy link
Collaborator

I saw a similar warning yesterday. These are executable files that CMake creates to test the presence of certain features on the platform. Therefore, they cannot contain a virus in any way. This is a false positive.

@jenshannoschwalm
Copy link
Collaborator

Never used windows - don't know what that means and those warnings look just silly ...

@c-h-r-i-s-t-i-a-n
Copy link
Author

Ok, I have added darktable to the whitelist.
So, with the patched build the export was successfull, no crash, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending someone needs to start working on that priority: high core features are broken and not usable at all, software crashes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants