Home
Directory
Discuss
Mail List
Tips
|
|
|
Previous topic: |
Next topic: |
|
Status of Regex DLL |
topic started 4/22/2001; 12:58:52 PM last post 4/24/2001; 10:15:09 AM |
|
Andre Radke - Status of Regex DLL
4/22/2001; 12:58:52 PM (reads: 12685, responses:
5) |
I managed to install OS X and Frontier 7.0b46 on a Powerbook G3/400 ("Pismo") last night. After some light testing this morning, I focussed on porting the Regex DLL to Carbon for the remainder of the day.
First, I upgraded my development machine to Codewarrior 6 and recompiled the latest version of Regex for Mac OS and Windows. No problems. This version of the DLL differs from the latest released versions in two respects: I incorporated a fix for a rather arcane bug in regex.subst and made some minor optimizations in the regex.match and regex.search verb.
Then I cloned the Mac PPC sub-project and configured the clone for Carbon: I included a new header file #defining TARGET_API_MAC_CARBON. I replaced InterfaceLib, MathLib, and MSL C.PPC.Lib with CarbonLib and MSL C.Carbon.Lib. Now the Carbon sub-project compiled and linked without errors.
I copied the resulting DLL over to my test machine and tried some of the regex.examples scripts. To my surprise, most scripts worked right out of the box. I am seeing some crashes in other scripts though.
I am in debugging mode now, trying to determine whether the crashes are due to my code or a bug in Frontier's DLL interface.
I don't know how far I'll get today, but I'm pretty optimistic that I'll have a beta of the Regex DLL for Carbon on Monday. So far, things definitely have been easier than I had expected.
|
|
Brent Simmons - Re: Status of Regex DLL
4/22/2001; 1:14:29 PM (reads: 14956, responses:
0) |
I don't know how far I'll get today, but I'm pretty optimistic that I'll have a beta of the Regex DLL for Carbon on Monday.
That's great news! Let me know if there's anything I can do to help. I'm certainly willing to run in the debugger here -- it's possible that there are problems on the kernel side.
|
|
Andre Radke - Re: Status of Regex DLL
4/22/2001; 3:04:39 PM (reads: 17725, responses:
0) |
I think I may have isolated a bug in the Frontier DLL interface (Mac OS X only). Here is how to reproduce:
- Download Regex 2.0.2b2 for Mac OS X
- Unstuff the downloaded archive and import the resulting file into system.extensions.regex
- Quit Frontier if it is currently running
- Delete regex.dll from the DLL subfolder of the Frontier application folder, if present
- Launch Frontier and run the following example script:
local (pat, s = "<h2>hello</h2>");
pat = regex.compile ("<[^>]+>");
dialog.notify (regex.match (pat, @s));
regex.free (pat)
When I run this script on my machine, single-stepping over every line in the script debugger, Frontier for Mac OS X crashes during the regex.match call.
Stepping into regex.compile and regex.match reveals that during the second call to regex.data.getPath (from regex.match), dll.isloaded returns false and the DLL is loaded again -- but this doesn't make sense because the DLL already should have been loaded during the previous call to regex.data.getPath.
It appears that either the DLL actually got unloaded after the regex.compile call or more likely dll.isloaded does not properly determine whether the DLL has been loaded.
Downloads: Crash Log, Regex 2.0.2b2 for Mac OS X, Regex 2.0.2b2 Project for Codewarrior 6
Note: I need to properly rewrite the script logic for loading different versions of the Regex DLL. This version of the Regex glue is just a quick hack.
|
|
paustian@b... - Re: Status of Regex DLL
4/22/2001; 8:43:17 PM (reads: 15140, responses:
0) |
Andr,
I had a chance to look at this just a bit. From looking at the crash logs it seems as though a thread is stomping on something. I would be wary of the code you are chasing. When threads are stomping on one another, my experience has been that the line that comes up in the debugger doesn't mean much.
Are you doing anything with threads? You code is crashing on a context switch. If you install any callbacks into the system you almost always have to use UPPs using the new mechanism. I can elaborate if you want.
|
|
Andre Radke - Re: Status of Regex DLL
4/23/2001; 4:15:08 AM (reads: 14913, responses:
0) |
Are you doing anything with threads?
No. The Regex DLL only uses functions from the standard C library and the callbacks from the Frontier DLL interface. There is very little platform-specific code, e.g. the DLL yields cpu time by calling the DoScript callback with "sys.systemTask()" as the script string.
|
|
paustian@b... - Re: Status of Regex DLL
4/24/2001; 10:15:09 AM (reads: 15318, responses:
0) |
Yeah I had a look at the code. The other thing I can think of is if the code casts any WindowPtr to DialogPtr or things like that. I doubt you would be doing that however.
|
|
|
|
|