Deadlock on windows

88 views
Skip to first unread message

ty wang

unread,
Nov 14, 2021, 1:45:34 PM11/14/21
to MathGL
Hi,
Seems that I got a deadlock. Conditions:
1. windows platform
2. openmp enabled
3. glut enabled(not sure if that's necessary)

I installed the library by vcpkg, but this also happens when compiled by mingw.

I know little about openmp, but seems it tries to do some initialization in other threads. But in dllmain threads can't be used.
QQ截图20211114165528.png

mathgl....@gmail.com

unread,
Nov 14, 2021, 1:49:09 PM11/14/21
to mat...@googlegroups.com
Hi,

Yes, there can be deadlock. For the simple solution, just comment line 734. I'll try to fix a more general issue too.

вс, 14 нояб. 2021 г. в 21:45, ty wang <163...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathgl/4a05eaa2-7c4a-44fd-a05f-e9373b84d9ean%40googlegroups.com.


--
Kind regards,
Alexey Balakin

ty wang

unread,
Nov 15, 2021, 10:51:18 PM11/15/21
to MathGL
Hi, 

Is there any plan for update recently? I wrote a patch for vcpkg ( https://github.com/microsoft/vcpkg/pull/21411 ). If you don't mind, I can submit the patch to vcpkg as a temporary solution.

Best regards,
Tianyi

Alexey Balakin

unread,
Nov 18, 2021, 2:04:31 PM11/18/21
to mat...@googlegroups.com
Dear Tianyi,

Yes, I plan to make a release before the New Year or early. There are many changes from the last release. Now, I'm updating the documentation and try to fix minor issues.

About the patch. I do not quite understand what it is, and how I can include the patch into the MathGL sources.


16.11.2021 06:51, ty wang пишет:

ty wang

unread,
Nov 19, 2021, 2:11:35 AM11/19/21
to MathGL
Hi,
Thanks for your reply.
My patch is not directly for mathgl, it's for vcpkg. With that, for anyone who installs mathgl from vcpkg, vcpkg will fix the code for them. I wrote that because I didn't know next mathgl release will be available soon.
If you want to know what I've done to mathgl code in the patch. I just disabled openmp on windows as you said.
Also there are some other patches (*.patch) in vcpkg. It will be great if you could check them.


Alexey Balakin

unread,
Nov 19, 2021, 9:18:04 AM11/19/21
to mat...@googlegroups.com
Hi,

Thank you. I've added some of patches to the recent SVN version.

19.11.2021 10:11, ty wang пишет:

Hanle

unread,
Nov 30, 2021, 7:28:48 AM11/30/21
to MathGL
Excuse me   Whether MathGL can use the mouse to drag  any Angle to view the 3D image, do not need to Rotate the specific Angle of view

Alexey Balakin

unread,
Dec 11, 2021, 1:25:11 AM12/11/21
to MathGL
Yes, udav and mgllab handle mouse to rotate/shift the image. Just press toolbutton transform-move.png.

вторник, 30 ноября 2021 г. в 15:28:48 UTC+3, Hanle:

ty wang

unread,
Dec 22, 2021, 1:05:26 AM12/22/21
to MathGL
Hi, 

I'm trying to update the vcpkg port to v2.5. Still there seems to be some problems and I have to apply some patch to get it work.
The patches are in the following commit:
Could you look though those patches and check if they are ok?

Also please accept my apologize for my submitting the patch to vcpkg without asking for your opinion first. I was new to opensource projects and made a mistake.


fix_arma_sprintf.patch: fix sprintf name conflict with armadillo. VS implemented it's own sprintf in later version, so redirecting to _sprintf makes std::sprintf not working.
fix_attribute.patch: MGL_FUNC_INIT and MGL_FUNC_FINI not defined issue.
fix_default_graph_init.patch: mglDefaultGr is initialized in DllMain, so it causes the similar problem as the Font. I Fixed it by disabling mglDefaultGr initialize in DllMain, it will be initialized on first use. Not sure if this has any side effect since mglDefaultGr itself is also exported.
fix_mglDataList.patch: All dlls shares the MGL_EXPORT marco, but in widgets dlls they need to import the classes from mgl.dll. Other (inlined) classes only causes a redefinition(central part of the picture below), but mglDataList is not defined in widgets dlls, so msvc can't find it. This patch is a really dirty solution, but it changes least code.

QQ截图20211218165822.png

For the last redefinition problem, I also tried to separate the marcos used in widgets dlls. Maybe that is cleaner, but it needs to change lots of files. 
I'm still working on this repo so it may not work, but it basially shows the idea.

Tianyi

Alexey Balakin

unread,
Dec 22, 2021, 10:20:51 AM12/22/21
to mat...@googlegroups.com
Hi,

Thank you for fixes. I put most of them into MathGL (SVN rev.1693). Can you check if it is enough?

22.12.2021 09:05, ty wang пишет:

ty wang

unread,
Dec 23, 2021, 11:06:08 AM12/23/21
to MathGL
Hi,
SVN rev.1693 works fine, except opemmp simd is still an experimental feature on MSVC, and is not enabled by default.
Can I submit those patches to vcpkg? I need your permission to do that.
Reply all
Reply to author
Forward
0 new messages