If a user belongs to a group whose name contains an apostrophe " ' ", the query used to get process instances fails because the syntax is not correct. The apostrophe is not escaped.
Below is an example of a query that fails:
[select si.processInstance, si.value from org.jbpm.context.exe.variableinstance.StringInstance si where si.name = 'author' and si.value in ('Direction des systemes d'information','Etudes DSI','members','administrators','foo') and si.processInstance.end is null ]