michaelrsweet / mxml

Tiny XML library.
https://www.msweet.org/mxml
Apache License 2.0
426 stars 157 forks source link

Segfault when linking with mxml library #294

Closed duttajnu closed 1 year ago

duttajnu commented 1 year ago

In last release v3.3, initialization of global data removed from '_MXML_FINI' which is registered as destructor for GNUC,

#elif defined(__GNUC__) /* Linux and Mac OS X */
#  define _MXML_FINI __attribute((destructor)) _mxml_fini
#else

which try to delete the pthread key,

 static void
 _MXML_FINI(void)
 {
   pthread_key_delete(_mxml_key);
 }

This causes segfault on the application which exits/terminates before calling any mxml api.

The above mentioned change has been introduced with below commit: 02f3310322e9d6613d17354fa98b297411d6ccf3

michaelrsweet commented 1 year ago

Sigh...

michaelrsweet commented 1 year ago

Treating this as a dupe of #293.