1)  I hope I am reporting this to the right place.  If not, my apologies.

2) I have been using lemon parsers for a year or more, but am by no means an export on the lemon source itself. I did not see this issue referenced elsewhere, my apologies if I missed it.


I *think* there is a thread-safety issue in the ParseTrace() function:

        void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
          yyTraceFILE = TraceFILE;
          yyTracePrompt = zTracePrompt;
          if( yyTraceFILE==0 ) yyTracePrompt = 0;
          else if( yyTracePrompt==0 ) yyTraceFILE = 0;
        }

It appears that `yyTraceFILE` and `yyTracePrompt` are global variables that can conceivably be written to simultaneously on two separate threads. I suspect the negative effects of this would be low (overwriting of one prompt with another, and they would likely be identical strings anyway).


It is detected by Xcode's Thread Sanitizer, and I wanted to report it in case there was a more untoward effect that I was missing. If nothing needs to be done about it, that's fine too.


Thanks!

Fletcher




--
Fletcher T. Penney
fletc...@fletcherpenney.net
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to