nibasya / MozjpegGUI

HomePage
14 stars 2 forks source link

Crashes #4

Closed brt1ituk closed 4 months ago

brt1ituk commented 6 months ago

I am trying to use the new version but every time I press convert, it crashes. Version 1.3 was working without any issue

nibasya commented 6 months ago

Can you provide me more details such as:

  1. Type of the image which you tried to convert (ex. gif, jpeg, bmp, png, etc.)
  2. Number of the images which you tried to convert
  3. Any error messages on crash
  4. Size of the input image
  5. OS version (ex. Windows11 64bit)
brt1ituk commented 6 months ago

Sure thing,

Trying to convert jpeg 397 images No error messages, it just close The input size is variable, I'd say an average of 17 megabytes Windows 11 64bit

I have done the exact same conversion with the version 1.3 without a problem.

On 22 April 2024 06:22:14 BST, nibasya @.***> wrote:

Can you provide me more details such as:

  1. Type of the image which you tried to convert (ex. gif, jpeg, bmp, png, etc.)
  2. Number of the images which you tried to convert
  3. Any error messages on crash
  4. Size of the input image
  5. OS version (ex. Windows11 64bit)

-- Reply to this email directly or view it on GitHub: https://github.com/nibasya/MozjpegGUI/issues/4#issuecomment-2068512401 You are receiving this because you authored the thread.

Message ID: @.***>

nibasya commented 6 months ago

The number and type of the inputs seems to be OK; I'm doing it with about 7,000 jpegs which had about 24MB in average. As far I have coded, the modified GUI parts checks every errors and show a message. Something might be happening outside of my hand; but I'll try to check. Please inform me anything, if you noticed anything new.

davidbejarcaceres commented 6 months ago

I´m having the same problem, it crashes when trying to convert a png.

No error dialog. No error.log in the directory, so I don´t know what´s exactly the error, or the log to share with you. If there is any guide how to capture the logs, build from source to debug the error, please let me know.

Settings:

Windows 11 64x MozJpeg 1.4 - 64bits image

This is the image I want to convert (png 720x1080): base_output SDXL_juggernautXL_juggernautX.safetensors_00024_NO_METADATA.zip

nibasya commented 6 months ago

Thank you for detailed information and sample file! But, I failed to reproduce the issue. My environment: Windows11 64bit prof. 23H2 image Both Japanese and English (US) environment succeded to convert. As the input and software is same, it might be due to other Microsoft libraries. I'll check software dependency tree.

davidbejarcaceres commented 6 months ago

Just for curiosity I tried with the 32bit version, and it worked!

Something is wrong with the 64bit, but I have not idea if my Laptop is missing something, all Windows updates are installed.

Since I´m not using it to convert thousands of images, I guess I don´t need 64bits >2GB RAM advantages, at least for now.

nibasya commented 6 months ago

That's a good news. Can you help me a little bit more? I have released MozJpegGui 1.5 which have logging functionality. It will be enabled by adding 1 line (shown in bold and italic) like this in MozJpegGui.ini

[Common] Output debug log=1 Default setting=0 [0]

The result will be like this, and I can figure out the position of the crash by checking where the logging has ended. MozJpegGUI.log It will help me if you upload the log, but don't forget to hide some paths!

brt1ituk commented 5 months ago

Hi, sorry for the delay. Here's the log file. MozJpegGUI.log

davidbejarcaceres commented 5 months ago

Here is my log file for the x64 1.5 version.

MozJpegGUI.log

nibasya commented 5 months ago

Thanks for the info, its helping me a lot. Can you try this one? Maybe it will solve the issue, and even if not, it will store additional information in the log.

MozJpegGUI_1.6_x64.zip

I've added following functionalities:

  1. It will log number of CPUs and number of files in conversion list.
  2. It will use 2 for default CPU number if the software failes to get it.
  3. It will try to capture all exceptions which is raised between log text: "Initializing progress dialog" and "Initializing GDI+", and at least show a message box indicating an error.
davidbejarcaceres commented 5 months ago

Still crashing.

MozJpegGUI.log

nibasya commented 5 months ago

Oh... and also is crashing somewhere I didn't expected. Can you have another try with this one? This one has no bug fix, but will output more and more debug texts. Sorry, version no. is unchanged. MozJpegGUI_1.6_x64.zip

davidbejarcaceres commented 5 months ago

Same crash. If you find a way to catch the error trace stack would be better to print it to the log.

MozJpegGUI.log

nibasya commented 5 months ago

I've already tried to catch the error to output errors, but the software is crashing without any notification such as throwing exception, and seems to have no way to catch the error which is causing the crash at this moment. So what I did was, add many logging texts as possible after outputting "Initializing progress dialog". Following is the example on my side; logging almost 1-output-per-1-source code.

example: MozJpegGUI.log

By comparing this and yours, it shows that the software crashed between "Initializing progress dialog" and "Creating semaphoreWithCounter". This is very narrowing the place of the bug; stack memory being destroied; or bug in Microsoft's code for CSemaphore. As the software is failing to catch an error, I'm expecting for the stack issue. I'll look further.

nibasya commented 5 months ago

Found a root cause, but hhaving a trouble for the fix. Please wait a littlebit more.

nibasya commented 5 months ago

Sorry for taking time. I believe this release fixes the issue. https://github.com/nibasya/MozjpegGUI/releases/download/Release_1.7/MozJpegGUI_1_7_x64_global.zip

davidbejarcaceres commented 5 months ago

This release fixed the crash. Thank you!

nibasya commented 4 months ago

As this issue seems to be solved, closing this ticket.