Actions
Bug #2772
closed![Author: O'Neil Delpratt](https://www.gravatar.com/avatar/a0bc1766b412d8fecb16f7d304916359?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: O'Neil Delpratt](https://www.gravatar.com/avatar/a0bc1766b412d8fecb16f7d304916359?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Static variable environ resetting its value to zero and crashes Python test
Start date:
2016-06-03
Due date:
% Done:
100%
Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.0.1
Fixed in version:
1.0.2
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
Description
The static variable environ is being reset to zero in multi-threaded applications. Reproduced in a python test: testXPathSingle.
Bug issue started in https://saxonica.plan.io/boards/4/topics/6413:
The problem and solution to this problem is described here: http://stackoverflow.com/questions/4448296/static-variable-resetting-its-value-to-0-on-its-own-apparently
The variable is identified as static:
static sxnc_environment * environ;
which means each compilation unit will get its own copy of the variable. Instead it should be declare with extern in the header file:
extern static sxnc_environment * environ;
and initialise it in the implementation file
sxnc_environment * SaxonProcessor::environ = 0;
Please register to edit this issue
Actions