Mantis - Squeak
Viewing Issue Advanced Details
7785 VM minor always 08-12-13 18:19 08-28-13 18:04
0007785: RePlugin patch for pcre from Debian bug report #710375
Reported here: [^] [^]

squeak-vm uses the system pcre library which does not provide the
prce_info anymore:
       int pcre_fullinfo(const pcre *code, const pcre_extra *extra,
            int what, void *where);

       The pcre_fullinfo() function returns information about a
compiled pat-
       tern. It replaces the pcre_info() function, which was removed
from the
       library at version 8.30, after more than 10 years of obsolescence.

A patch has been provided by a Debian maintainer, but may need to be reimplemented in the plugin slang.

08-15-13 02:47   
RePlugin was written by Andrew C. Greenberg. It consists of a VM plugin in package RegexPlugin, some interface classes in package Regex-Base, and a test suite in package Regex-tests.

An overview is on the Swiki at [^]

The RePlugin distribution is on SqueakMap as package "Regular Expression Plugin". The most recent update is version 3.31, which is a SAR distribution containing the plugin, the image support code, the unit tests, and documention. The package is fully functional and all tests are green when running on a 32 bit VM (e.g. an interpreter VM from, or Cog if the plugin is present).

The RePlugin is now part of the VMMaker package, so the RegexPlugin package from the SqueakMap distribution is superceded by the RePlugin VMMaker-Plugins.

RePlugin also requires updates for 32/64 bit compilation. It crashes the VM when compiled in 64-bit mode.
08-15-13 02:50   
The patch provided for Debian build resolves the linker errors by disabling a primitive. However, the primitive still requires a proper fix in VMMaker to use the new pcre_fullinfo() function rather than the obsolete pcre_info().
08-18-13 15:43   
Source code for an early version of the PCRE is in platforms/Cross/plugins/RePlugin. The VM is compiled with this code, rather than using OS supplied libraries. The link error reported in the Debian bug report is probably a result of link-time confusion between the OS supplied library and the code in our platforms/Cross tree.

We should stop using a local (and obsolete) version of the PCRE, and begin linking directly to the platform supplied library when present. Unix/Linux systems are sure to provide a PCRE implementation, but I don't know the status with respect to Windows, iOS, RiscOS etc.
08-18-13 15:45   
The platforms/win32 and platforms/iOS both provide RePlugin.c files that have been generated from the Smalltalk plugin, which is now maintained in VMMaker. These generated sources should be removed from the platforms trees.
08-18-13 15:50   
Note - the original platforms source for PCRE in platforms/Cross/RePlugin contains the then-current implementations of the pcre_info() and pcre_fullinfo() functions. Documentation of the original pcre_info() function is not readily available, so use this local code as reference for how to update the RePlugin in VMMaker to use the pcre_fullinfo() function.
08-28-13 18:04   
Fixed in Cog and merged into VMMaker-eem.323. Also fixed arg count of primPCREExecfromto
and compilation warnings in rePluginFree: & rePluginMalloc:.