klayout icon indicating copy to clipboard operation
klayout copied to clipboard

[macOS] User Properties Dialog Crashes

Open Kazzz-S opened this issue 9 months ago • 5 comments

1. The Latest Version (0.29.1)

The User Properties dialog crashes when I click the [User Properties] button. This problem reproduces with the latest four binaries listed below. 0291DMGs 02901-crash-logs.zip

I used this feature before. I recently started using it again after a long hiatus and noticed this problem.

This problem is macOS-specific. This feature works as expected in the Linux and Windows environments, as shown in the images below. OK-Linux-Mint21 3 OK-Windows10

To be continued...

Kazzz-S avatar May 09 '24 23:05 Kazzz-S

Cont.

2. Previous Versions (< 0.29.1)

I tested previous versions with HW*.dmg going back in history. Then, I found versions up to 0.28.8 are problematic.

<0.29.1> --> 0.28.17 --> 0.28.15 --> 0.28.14 --> 0.28.13 --> 0.28.12 --> 0.28.11 --> 0.28.10 --> 0.28.9 --> 0.28.8

previous-crash-logs.zip

To be continued...

Kazzz-S avatar May 10 '24 00:05 Kazzz-S

Cont.

3. Further Previous Versions (< 0.28.8)

I tested with 0.28.7, 0.27.13, and 0.26.12 and found they are OK, as shown in the sample images below. 02807HW-a 02807HW-b OK-samples.zip

I suspect some problem may have intruded between 0.28.7 and 0.28.8.

Best regards, Kazzz-S

Kazzz-S avatar May 10 '24 00:05 Kazzz-S

Thanks for the analysis. I will look into that.

Matthias

klayoutmatthias avatar May 10 '24 15:05 klayoutmatthias

Cont.

4. With Qt6

  • It works with Qt6!
  • These two DMGs have not been officially published.

02901-ST-Qt6

02910-HWports-Qt6

Kazzz-S avatar May 11 '24 07:05 Kazzz-S

Cont.

5. Qt-wise Status

Qts

Qts.xlsx

Thanks, Kazzz-S

Kazzz-S avatar May 11 '24 07:05 Kazzz-S

on M1 lastest master: homebrew qt 5.15.13 coredump homebrew qt 6.7 works

stefanottili avatar May 12 '24 04:05 stefanottili

Dear @Kazzz-S and @stefanottili

Thanks for the many datapoints and your experiments!

Maybe I found the root cause: on some platforms / compilers, a default-initialized iterator appears no to have the same value. I think it is more related to the compiler, although I have not seen the issue myself on neither gcc nor clang on Linux and Windows. Searching does not reveal a consistent picture: some say, a default-initialized constructor is a "singular" value, others say it is uninitialized. So it is better to give it a proper value.

My patch is here: https://github.com/KLayout/klayout/pull/1708

Maybe you can try whether this fixes the problem.

Thanks and best regards,

Matthias

klayoutmatthias avatar May 12 '24 14:05 klayoutmatthias

P.S: I hope you did not spend too much effort in your research. Basically all I needed was the hint about 0.28.7 vs. 0.28.8 :(

klayoutmatthias avatar May 12 '24 14:05 klayoutmatthias

git checkout origin/bugfix/issue-1706 fixes the coredump on M1 Sonoma.

The fact that it went unreported for so many versions just might indicate that nobody is using this feature ...

stefanottili avatar May 12 '24 16:05 stefanottili

Hello @klayoutmatthias,

Thank you for trying to fix this problem. Using the patch #1708, I rebuilt:

  1. Four binaries with Qt5.x mentioned in this table.
  2. Two binaries with Qt6.x mentioned in this comment.
  3. One binary with Qt5.12.8 on Linux Mint 20.3.

I confirmed that all 7 test cases are OK.

Thank you again, and best regards, Kazzz-S

Kazzz-S avatar May 13 '24 09:05 Kazzz-S

Hello @stefanottili,

Thank you for testing on M1 Sonoma. I use this feature mainly in Linux environments, so I overlooked this problem till recently.

Best regards, Kazzz-S

Kazzz-S avatar May 13 '24 09:05 Kazzz-S