Subject: CGAL users discussion list
List archive
- From: Fritz Mueller <>
- To:
- Subject: Re: [cgal-discuss] set_error_handler etc. in header-only mode
- Date: Sat, 7 Dec 2019 16:42:07 -0800
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:KzFYXxfua5SEhc8Lc+yJi9YnlGMj4u6mDksu8pMizoh2WeGdxcu+YR7h7PlgxGXEQZ/co6odzbaP6Oa5CTJLu8zJmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MRu7oR/MusQVgIZuJbg9xgXUqXZUZupawn9lK0iOlBjm/Mew+5Bj8yVUu/0/8sNLTLv3caclQ7FGFToqK2866tHluhnFVguP+2ATUn4KnRpSAgjK9w/1U5HsuSbnrOV92S2aPcrrTbAoXDmp8qlmRAP0hCoBKjU09nzchM5tg6JBuB+vpwBwzYHbb4+IOvR+cL3TctEZS2RGRctRSzVBAoagY4sPE+YMP+BVpJT9qVsUqhu+ABGhCuP1yj9Jmn/33LAx3eM8EQ7Y2AwgG8wBsG7Jp9jyOqcSS+G1zLXJzDXGdP5W1y396InUchEgpPGAR7VwcdDeyUQ2EQ7Ok1aeqZT9Mj+LyugAt3KX4ulgWO61lWIrtgF8riKyysouhYTFnoAYx17e+Sln3Io5O8e0RFN7bNOmCpdcqS6XOoRwT8g/WW9nojw6xacDuZOjfCgF1pAnxxnHZvyCaYeI4xbjWP+JITd3mX5pYby/iwuw/EWv0OH8Wc600FFFripBjNbArGwC1xvW6sSfS/t9+Fmu2SqX2gzN9u1JJVo4mKnbJpI73LI8i5oevV7eEiL0l0j6lKqWeV8l+uis5eTneLLmppqEOo96kAH+M7gum826AekjPAgORWmb+fi91b3m50H5R69KjvIunqnDrJ/aPdgbprK+AwJNzokj5AywDzO/3NsFnHkHN05KeA+cj4jyIFzOO/D5DfKng1u2ijtrxvbGPqfgAprXNHTDnq3hLv5B7BtXxwM3iNxe/JlJEaopIfTpW0a3usaLIAU+Nlma2ef7Gp1Yy44aXW+VSvuXKqLOo1qg6PguP/uJIogPt2CueLAe+/fygCphyhcmdq6z0M5PMS3qLrFdO0ycJEHUrJIBHGMN5FRsSeXrjBiaXmcWaS/tA+Qz4TY0DI/gBoDGFNj00e6xmRyjF5gTXVhoT1WFEHPmbYKBAq1eZjiTPt1k1DseWur4EtNz5VSVrAb/joFfAK/M4CRB78Dtztlp9eiVkgs9p2R5
Hi Marc — thank you for the prompt reply!
>> Looking into the sources a bit, get_static_error_handler() etc. are define
>> in header-only mode as inlines, returning references to local statics. I
>> think this means each call could conceivably use different storage for
>> those statics,
>
> No. A static variable inside a function is a unique global object. It is
> the usual way to simulate C++17 inline variables and get singletons.
Okay, good to know this is true, even for inlines -- thanks. I can do some
experiments with a small bit of test code to verify that I understand
correctly.
>> some instrumentation indicates that this is what is happening (if I log
>> the address of _error_handler within get_standard_error_hander(), I see
>> multiple distinct addresses during a run of my program.)
>
> That seems very broken. I would almost suspect that you are on windows,
> calling the function from several DLLs...
Well, OS X Catalina w/ clang 11, actually. But my use case is somewhat
complicated: compiling into a dylib which is being loaded as a module into
node.js.
Thanks for the confirmation that it *should* work. I’ll try some experiments
with some small test programs, and also dig a little deeper to see if node/v8
might in fact be loading more than one instantiation of my module.
> We need a testcase and details about your setup so we can reproduce the
> issue first, as with most bugs.
I’ll make sure to have those in hand if I end up coming back around for
another pass on this one!
thanks again,
—FritzM.
- [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
Archive powered by MHonArc 2.6.18.