[v2.0.18-] invalid memory read/write with regular expressions.

Report problems with documented functionality
User avatar
RaptorX
Posts: 436
Joined: 06 Dec 2014, 14:27
Contact:

[v2.0.18-] invalid memory read/write with regular expressions.

Post by RaptorX » 08 Oct 2024, 22:07

I am experiencing a interesting bug. This seems to affect v2.0.18-.
I have a class that uses regular expressions to determine certain things.

This particular method is being called in a loop, but there are delays between one call and another because i need to do some http requests before calling this method. I hadn't reported the issue because i don't have a way to reproduce the error reliably.

But every once in a while i get these errors:
Error logs:

As you can see it always fails in the same spot:

Code: Select all

If job_title ~='i)Manager' || job_title ~= 'i)\b(3|III)\b'
I tried using the Save option S) to see if caching the regex would help to no avail.

here is the method being called:

Code: Select all

static GetLevel(code?, instance?)
	{
		static level_codes := Map(
			'Leader'                 , '010',
			'Owner'                  , '020',
			'Founder'                , '030',
			'Partner'                , '040',
			'Operating Partner'      , '050',
			'Lower Partner'          , '060',
			'Executive'              , '070',
			'Operating Principal'    , '080',
			'Global EVP/SVP'         , '090',
			'EVP/SVP/SMD'            , '100',
			'Principal/MD/Deputy/AGC', '110',
			'Global Vice President'  , '120',
			'Vice President'         , '130',
			'Senior Global Director' , '138',
			'Senior Director'        , '139',
			'Global Director'        , '140',
			'Director'               , '150',
			'Principal'              , '159',
			'Lower Director'         , '160',
			'Upper Level Manager'    , '170',
			'Senior Manager'         , '180',
			'Global Manager'         , '190',
			'Territory Manager'      , '200',
			'Manager'                , '210',
			'Lower Manager'          , '220',
			'Specialist'             , '230',
			'Senior'                 , '240',
			'Entry'                  , '250',
			'Lower Entry'            , '260',
			'Intern'                 , '270',
			'Consultant'             , '280',
			'Investor'               , '290',
			'Chairman'               , '300',
			'Board'                  , '310',
			'Advisor'                , '320',
		)

		if IsSet(code)
		{

			if code ~= '\d{3}'
			{
				for level, i_code in level_codes
				{
					if code != i_code
						continue

					return level
				}
				return 'Entry'
			}
			else if code = 'headers'
			{
				levels := []
				for level in level_codes
					levels.Push(level)
				return levels
			}
			else
				return level_codes[code]
		}

		job_title := instance['title']
		OutputDebug 'GetLevel for: ' job_title '`n'

		if (job_title ~= 'iS)executive assistant'
		|| job_title ~= 'iS)accounts? executive'
		|| job_title ~= 'iS)assistant to the president'
		|| job_title ~= 'iS)contract coordinator'
		|| job_title ~= 'iS)sales executive')
		&& !(job_title ~= 'iS)s(enio)?r\.?|j(unio)?r\.?')
			;; Entry
			return level_codes['Entry']

		else if job_title ~= 'iS)advis(e|o)r'
			;; Advisor
			return level_codes['Advisor']

		else if job_title ~= 'iS)consult(ant|ing)'
		     || job_title ~= 'iS)freelancer?'
		     || job_title ~= 'iS)independent'
		     || job_title ~= 'iS)contract(or)?'
			;; Consultant
			return level_codes['Consultant']


		else if job_title ~= 'iS)business owner'
		|| job_title ~= 'iS)(co-)?owner'
			;; Owner
			return level_codes['Owner']

		else if job_title ~= 'iS)\b(Global\s)?V(ice(-|\s*))?\.?P(resident)?\.?\b'
		     || job_title ~= 'iS)\bV(ice)?\s*P(resident)?\b'
		     || job_title ~= 'iS)leader'
			;; Vice President
			return level_codes['Vice President']

		else if job_title ~= 'iS)\bC(hief)?\s*E(xecutive)?\s*O(fficer)?\b'
		|| job_title ~= 'iS)president'
			;; Leader
			return level_codes['Leader']

		else if job_title ~= 'iS)\bE(xecutive)?\.?\s*V(ice(-|\s*))?\.?P(resident)?\.?\b'
		|| job_title ~= 'iS)\bS((enio)?r\.?\s+)?\.?V(ice(-|\s*))?\.?P(resident)?\.?\b'
		|| job_title ~= 'iS)S(enio)?r\.? Managing Director'
		|| job_title ~= 'iS)executive director'
		|| job_title ~= 'iS)secretary (general|treasurer)'
			;; EVP/SVP/SMD
			return level_codes['EVP/SVP/SMD']

		else if job_title ~= 'iS)(managing|operating) partner'
			;; Operating Partner
			return level_codes['Operating Partner']

		else if job_title ~= 'iS)associate partner'
		     || job_title ~= 'iS)j(unio)?r\.? partner'
			;; Lower Partner
			return level_codes['Lower Partner']

		else if job_title ~= 'iS)(?<!business\s)(?<!director\sof\s)partner(?!\s*success)'
			;; Partner
			return level_codes['Partner']

		else if job_title ~= 'iS)chair(man|person)'
		|| job_title ~= 'iS)co-chair'
			;; Chairman
			return level_codes['Chairman']

		else if job_title ~= 'iS)board'
			;; Board
			return level_codes['Board']

		else if job_title ~= 'iS)(managing|operating) principal'
			;; Operating Principal
			return level_codes['Operating Principal']

		else if job_title ~= 'iS)(co-)?founder'
			;; Founder
			return level_codes['Founder']

		else if job_title ~= 'iS)\bC\.?(R|M|S|E|F|O|R|B|M|P|D|A|C|I|T|HR|IS|DS|ML|AI|BI|CM)\.?O\.?\b'
		|| job_title ~= 'iS)president|found(er|ing)|co-found(er|ing)|co-president'
		|| job_title ~= 'iS)^exec(?!.*?(assistant|specialist|coordinator|secretary|liaison))'
		|| job_title ~= 'iS)chief'
		|| job_title ~= 'iS)(?<!Associate\s|Deputy\s|Assistant\s)\bG(eneral)?\s*C(ounsel)?\b'
		|| job_title ~= 'iS)executive business partner'
			;; Executive
			return level_codes['Executive']

		else if job_title ~= 'iS)Global (E|S)VP'
			;; Global EVP/SVP
			return level_codes['Global EVP/SVP']

		; else if job_title ~= 'iS)(?<!solutions\s)(?<!solution\s)architect'
		; 	;; Architect
		; 	return level_code['Architect']

		else if job_title ~= 'iS)(?<!engineer\s)(?<!software\s)principal(?!.*software)(?!.*engineer)'
		|| job_title ~= 'iS)managing director'
		|| job_title ~= 'iS)deputy(?!\s*general|\s*clerk)'
		|| job_title ~= 'iS)\bG(eneral)?\s*C(ounsel)?\b'
			;; Principal/MD/Deputy/AGC
			return level_codes['Principal/MD/Deputy/AGC']

		else if job_title ~= 'iS)principal'
			;; Principal
			return level_codes['Principal']

		else if job_title ~= 'iS)Global S(enio)?r\.? Director'
		|| job_title ~= 'iS)Global Director'
			;; Global Director
			return level_codes['Global Director']

		else if job_title ~= 'iS)senior.*director'
			;; Senior Director
			return level_codes['Senior Director']

		else if job_title ~= 'iS)S(enio)?r\.? Director'
		|| job_title ~= 'iS)head'
		|| job_title ~= 'iS)(?<!associate\s)director'
		|| job_title ~= 'iS)\bG(eneral)?\s*M(anager)?\b'
		|| job_title ~= 'iS)controller'
		|| job_title ~= 'iS)\b(4|IV)\b'
			;; Director
			return level_codes['Director']

		else if job_title ~= 'iS)associate director'
			;; Lower Director
			return level_codes['Lower Director']

		else if job_title ~= 'iS)Global S(enio)?r\.? Manager'
		|| job_title ~= 'iS)S(enio)?r\.? Manager'
		|| job_title ~= 'iS)S(enio)?r\.? Territory Manager'
		|| job_title ~= 'iS)S(enio)?r\.? Regional Manager'
		|| job_title ~= 'iS)Program Manager'
			;; Upper Level Manager
			return level_codes['Upper Level Manager']

		else if job_title ~= 'iS)Global .* Manager'
			;; Global Manager
			return level_codes['Global Manager']

		else if job_title ~= 'iS)(Associate|Assistant) Manager'
		     || job_title ~= 'iS)staff \w+'
		     || job_title ~= 'iS)lead'
			;; Lower Manager
			return level_codes['Lower Manager']

		else if job_title ~= 'iS)(National|Regional|Territory) Manager'
			;; Territory Manager
			return level_codes['Territory Manager']

		else if job_title ~='iS)S(enio)?r\.?(?=.*manager)'
			;; Senior Manager
			return level_codes['Senior Manager']

		else if job_title ~='iS)Manager'
		|| job_title ~= 'iS)\b(3|III)\b'
			;; Manager
			return level_codes['Manager']

		else if job_title ~= 'iS)Specialist'
		     || job_title ~= 'iS)architect'
			;; Specialist
			return level_codes['Specialist']

		else if job_title ~= 'iS)supervisor' ; job_title ~= 'iS)\b(^\w+(\s|-)?)?lead(\s \w+)?\b'
		     || job_title ~= 'iS)s(enio)?r\.?'
		     || job_title ~= 'iS)\b(2|II)\b'
			;; Senior
			return level_codes['Senior']

		else if job_title ~= 'iS)(business|sales) development (representative|executive)'
		     || job_title ~= 'iS)assistant'
		     || job_title ~= 'iS)coordinator'
		     || job_title ~= 'iS)j(unio)?r'
		     || job_title ~= 'iS)junior account (executive|associate)'
		     || job_title ~= 'iS)fellow'
			;; Lower Entry
			return level_codes['Lower Entry']

		else if job_title ~= 'iS)intern'
			;; Intern
			return level_codes['Intern']

		else if job_title ~= 'iS)investor'
			;; Investor
			return level_codes['Investor']

		return level_codes['Entry']
	}
It is part of a bigger class but thats the relevant part of the code.

Any insights as to why autohotkey decides to completely crash from time to time might be appreciated.
Projects:
AHK-ToolKit

Descolada
Posts: 1494
Joined: 23 Dec 2021, 02:30

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by Descolada » 09 Oct 2024, 11:33

I let the following modification run for a while, but couldn't reproduce the error:

Code: Select all

Chars := [' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Loop {
    NumChars := Random(1, 10)
    Title := ""
    Loop NumChars
        Title .= Chars[Random(1, Chars.Length)]
    GetLevel(, Map('title', Title))
}

GetLevel(code?, instance?) {
    static level_codes := Map(
        'Leader'                 , '010',
        'Owner'                  , '020',
        'Founder'                , '030',
        'Partner'                , '040',
        'Operating Partner'      , '050',
        'Lower Partner'          , '060',
        'Executive'              , '070',
        'Operating Principal'    , '080',
        'Global EVP/SVP'         , '090',
        'EVP/SVP/SMD'            , '100',
        'Principal/MD/Deputy/AGC', '110',
        'Global Vice President'  , '120',
        'Vice President'         , '130',
        'Senior Global Director' , '138',
        'Senior Director'        , '139',
        'Global Director'        , '140',
        'Director'               , '150',
        'Principal'              , '159',
        'Lower Director'         , '160',
        'Upper Level Manager'    , '170',
        'Senior Manager'         , '180',
        'Global Manager'         , '190',
        'Territory Manager'      , '200',
        'Manager'                , '210',
        'Lower Manager'          , '220',
        'Specialist'             , '230',
        'Senior'                 , '240',
        'Entry'                  , '250',
        'Lower Entry'            , '260',
        'Intern'                 , '270',
        'Consultant'             , '280',
        'Investor'               , '290',
        'Chairman'               , '300',
        'Board'                  , '310',
        'Advisor'                , '320',
    )

    if IsSet(code)
    {

        if code ~= '\d{3}'
        {
            for level, i_code in level_codes
            {
                if code != i_code
                    continue

                return level
            }
            return 'Entry'
        }
        else if code = 'headers'
        {
            levels := []
            for level in level_codes
                levels.Push(level)
            return levels
        }
        else
            return level_codes[code]
    }

    job_title := instance['title']
    ;OutputDebug 'GetLevel for: ' job_title '`n'

    if (job_title ~= 'iS)executive assistant'
    || job_title ~= 'iS)accounts? executive'
    || job_title ~= 'iS)assistant to the president'
    || job_title ~= 'iS)contract coordinator'
    || job_title ~= 'iS)sales executive')
    && !(job_title ~= 'iS)s(enio)?r\.?|j(unio)?r\.?')
        ;; Entry
        return level_codes['Entry']

    else if job_title ~= 'iS)advis(e|o)r'
        ;; Advisor
        return level_codes['Advisor']

    else if job_title ~= 'iS)consult(ant|ing)'
            || job_title ~= 'iS)freelancer?'
            || job_title ~= 'iS)independent'
            || job_title ~= 'iS)contract(or)?'
        ;; Consultant
        return level_codes['Consultant']


    else if job_title ~= 'iS)business owner'
    || job_title ~= 'iS)(co-)?owner'
        ;; Owner
        return level_codes['Owner']

    else if job_title ~= 'iS)\b(Global\s)?V(ice(-|\s*))?\.?P(resident)?\.?\b'
            || job_title ~= 'iS)\bV(ice)?\s*P(resident)?\b'
            || job_title ~= 'iS)leader'
        ;; Vice President
        return level_codes['Vice President']

    else if job_title ~= 'iS)\bC(hief)?\s*E(xecutive)?\s*O(fficer)?\b'
    || job_title ~= 'iS)president'
        ;; Leader
        return level_codes['Leader']

    else if job_title ~= 'iS)\bE(xecutive)?\.?\s*V(ice(-|\s*))?\.?P(resident)?\.?\b'
    || job_title ~= 'iS)\bS((enio)?r\.?\s+)?\.?V(ice(-|\s*))?\.?P(resident)?\.?\b'
    || job_title ~= 'iS)S(enio)?r\.? Managing Director'
    || job_title ~= 'iS)executive director'
    || job_title ~= 'iS)secretary (general|treasurer)'
        ;; EVP/SVP/SMD
        return level_codes['EVP/SVP/SMD']

    else if job_title ~= 'iS)(managing|operating) partner'
        ;; Operating Partner
        return level_codes['Operating Partner']

    else if job_title ~= 'iS)associate partner'
            || job_title ~= 'iS)j(unio)?r\.? partner'
        ;; Lower Partner
        return level_codes['Lower Partner']

    else if job_title ~= 'iS)(?<!business\s)(?<!director\sof\s)partner(?!\s*success)'
        ;; Partner
        return level_codes['Partner']

    else if job_title ~= 'iS)chair(man|person)'
    || job_title ~= 'iS)co-chair'
        ;; Chairman
        return level_codes['Chairman']

    else if job_title ~= 'iS)board'
        ;; Board
        return level_codes['Board']

    else if job_title ~= 'iS)(managing|operating) principal'
        ;; Operating Principal
        return level_codes['Operating Principal']

    else if job_title ~= 'iS)(co-)?founder'
        ;; Founder
        return level_codes['Founder']

    else if job_title ~= 'iS)\bC\.?(R|M|S|E|F|O|R|B|M|P|D|A|C|I|T|HR|IS|DS|ML|AI|BI|CM)\.?O\.?\b'
    || job_title ~= 'iS)president|found(er|ing)|co-found(er|ing)|co-president'
    || job_title ~= 'iS)^exec(?!.*?(assistant|specialist|coordinator|secretary|liaison))'
    || job_title ~= 'iS)chief'
    || job_title ~= 'iS)(?<!Associate\s|Deputy\s|Assistant\s)\bG(eneral)?\s*C(ounsel)?\b'
    || job_title ~= 'iS)executive business partner'
        ;; Executive
        return level_codes['Executive']

    else if job_title ~= 'iS)Global (E|S)VP'
        ;; Global EVP/SVP
        return level_codes['Global EVP/SVP']

    ; else if job_title ~= 'iS)(?<!solutions\s)(?<!solution\s)architect'
    ; 	;; Architect
    ; 	return level_code['Architect']

    else if job_title ~= 'iS)(?<!engineer\s)(?<!software\s)principal(?!.*software)(?!.*engineer)'
    || job_title ~= 'iS)managing director'
    || job_title ~= 'iS)deputy(?!\s*general|\s*clerk)'
    || job_title ~= 'iS)\bG(eneral)?\s*C(ounsel)?\b'
        ;; Principal/MD/Deputy/AGC
        return level_codes['Principal/MD/Deputy/AGC']

    else if job_title ~= 'iS)principal'
        ;; Principal
        return level_codes['Principal']

    else if job_title ~= 'iS)Global S(enio)?r\.? Director'
    || job_title ~= 'iS)Global Director'
        ;; Global Director
        return level_codes['Global Director']

    else if job_title ~= 'iS)senior.*director'
        ;; Senior Director
        return level_codes['Senior Director']

    else if job_title ~= 'iS)S(enio)?r\.? Director'
    || job_title ~= 'iS)head'
    || job_title ~= 'iS)(?<!associate\s)director'
    || job_title ~= 'iS)\bG(eneral)?\s*M(anager)?\b'
    || job_title ~= 'iS)controller'
    || job_title ~= 'iS)\b(4|IV)\b'
        ;; Director
        return level_codes['Director']

    else if job_title ~= 'iS)associate director'
        ;; Lower Director
        return level_codes['Lower Director']

    else if job_title ~= 'iS)Global S(enio)?r\.? Manager'
    || job_title ~= 'iS)S(enio)?r\.? Manager'
    || job_title ~= 'iS)S(enio)?r\.? Territory Manager'
    || job_title ~= 'iS)S(enio)?r\.? Regional Manager'
    || job_title ~= 'iS)Program Manager'
        ;; Upper Level Manager
        return level_codes['Upper Level Manager']

    else if job_title ~= 'iS)Global .* Manager'
        ;; Global Manager
        return level_codes['Global Manager']

    else if job_title ~= 'iS)(Associate|Assistant) Manager'
            || job_title ~= 'iS)staff \w+'
            || job_title ~= 'iS)lead'
        ;; Lower Manager
        return level_codes['Lower Manager']

    else if job_title ~= 'iS)(National|Regional|Territory) Manager'
        ;; Territory Manager
        return level_codes['Territory Manager']

    else if job_title ~='iS)S(enio)?r\.?(?=.*manager)'
        ;; Senior Manager
        return level_codes['Senior Manager']

    else if job_title ~='iS)Manager'
    || job_title ~= 'iS)\b(3|III)\b'
        ;; Manager
        return level_codes['Manager']

    else if job_title ~= 'iS)Specialist'
            || job_title ~= 'iS)architect'
        ;; Specialist
        return level_codes['Specialist']

    else if job_title ~= 'iS)supervisor' ; job_title ~= 'iS)\b(^\w+(\s|-)?)?lead(\s \w+)?\b'
            || job_title ~= 'iS)s(enio)?r\.?'
            || job_title ~= 'iS)\b(2|II)\b'
        ;; Senior
        return level_codes['Senior']

    else if job_title ~= 'iS)(business|sales) development (representative|executive)'
            || job_title ~= 'iS)assistant'
            || job_title ~= 'iS)coordinator'
            || job_title ~= 'iS)j(unio)?r'
            || job_title ~= 'iS)junior account (executive|associate)'
            || job_title ~= 'iS)fellow'
        ;; Lower Entry
        return level_codes['Lower Entry']

    else if job_title ~= 'iS)intern'
        ;; Intern
        return level_codes['Intern']

    else if job_title ~= 'iS)investor'
        ;; Investor
        return level_codes['Investor']

    return level_codes['Entry']
}
Tried this variant as well, still no luck:

Code: Select all

Loop {
    NumChars := Random(1, 10)
    Title := ""
    Loop NumChars
        Title .= Chr(Random(32, 122))
    GetLevel(, Map('title', Title))
}
I've gotten weird errors before in seemingly random places due to using CallbackCreate with Fast mode where it shouldn't have been used. Any chance your script or any of the included libraries uses it?
Also, are you running the script with a debugger or without one?

crocodile
Posts: 116
Joined: 28 Dec 2020, 13:41

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by crocodile » 09 Oct 2024, 12:13

This problem has been around for a long time and I run into it about once a week.
I have no hope of solving it anymore. The effort to solve it is not as good as learning another language.

viewtopic.php?f=37&t=112685

User avatar
RaptorX
Posts: 436
Joined: 06 Dec 2014, 14:27
Contact:

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by RaptorX » 12 Oct 2024, 11:54

Descolada wrote:
09 Oct 2024, 11:33
I let the following modification run for a while, but couldn't reproduce the error:

Code: Select all

; ... 
Tried this variant as well, still no luck:

Code: Select all

; ...
I've gotten weird errors before in seemingly random places due to using CallbackCreate with Fast mode where it shouldn't have been used. Any chance your script or any of the included libraries uses it?
Also, are you running the script with a debugger or without one?
Well I had the same situation as you did:

If I run the script in isolation, I am able to run it for many iterations and no errors:
image.png
image.png (3 KiB) Viewed 1239 times
So, it is very likely a combination of the method calls.

The script does depend on a SQLite class i created where i do some DllCalls.
The only CallBackCreate are from the UIA library that I include, but this whole part of my code does not use UIA, so I am not entirely sure that it is related to the problem.

I will try setting a delay between the calls and see if that helps at least.
crocodile wrote:
09 Oct 2024, 12:13
This problem has been around for a long time and I run into it about once a week.
I have no hope of solving it anymore. The effort to solve it is not as good as learning another language.

viewtopic.php?f=37&t=112685
At least from what I can see from that post, there was not enough information to explain what was going on.
This type of errors are very tricky to figure out. I would just let you know that this problem is not an "AutoHotkey thing...", this problem will happen with any other language that modifies the memory. If the memory is handled incorrectly the program/script will break.

We just have to figure out WHY it's breaking in this case.

I think I will have to compile autohotkey in debug mode and see what's going on.
Projects:
AHK-ToolKit

crocodile
Posts: 116
Joined: 28 Dec 2020, 13:41

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by crocodile » 12 Oct 2024, 15:39

That's the source of the problem, you can't use debug mode for a week or more just to figure this out.
But I came up with a way to use a REGULAR DLL instead of ahk-regular, and if the problem doesn't come back within a month, then we can be sure that it's a problem with AutoHotkey. But of course, even if we know it's ahk-regular, we still can't fix it.

User avatar
RaptorX
Posts: 436
Joined: 06 Dec 2014, 14:27
Contact:

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by RaptorX » 12 Oct 2024, 23:30

crocodile wrote:
12 Oct 2024, 15:39
That's the source of the problem, you can't use debug mode for a week or more just to figure this out.
You definitely can, and should. If you really want to fix the problem, thats the way.

I will continue using the program (even if it breaks) and it might takes months if not years before I get an answer... heck... sometimes we might not even get to an answer at all either.
crocodile wrote:
12 Oct 2024, 15:39
But I came up with a way to use a REGULAR DLL instead of ahk-regular,
I have absolutely no clue what you are trying to say with those words. :shifty:
crocodile wrote:
12 Oct 2024, 15:39
and if the problem doesn't come back within a month, then we can be sure that it's a problem with AutoHotkey.
Well, thats not how programming works. If you do absolutely nothing, and the problem simply stops, it doesn't mean that it is fixed. It just means that the conditions for the problem to appear are not being met.

And if you are talking about using a different autohotkey version, and that version not having the problem, then that at least is a clue, because we would look at the differences and come up with why we are getting the issue in the first place. :)
Projects:
AHK-ToolKit

crocodile
Posts: 116
Joined: 28 Dec 2020, 13:41

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by crocodile » 13 Oct 2024, 01:23

It's like this:
If job_title ~='i)Manager' -> if DllCall("regular.dll\xxx", "str", job_title, "str", "i)Manager", "int")

User avatar
RaptorX
Posts: 436
Joined: 06 Dec 2014, 14:27
Contact:

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by RaptorX » 13 Oct 2024, 12:36

crocodile wrote:
13 Oct 2024, 01:23
It's like this:
If job_title ~='i)Manager' -> if DllCall("regular.dll\xxx", "str", job_title, "str", "i)Manager", "int")
oh, I see, you mean to use an external regex engine instead of the built in one.

Well, i can try that, but the issue is 1) I dont know what other problems i might encounter with that library and 2) the idea is to improve autohotkey as a whole :)

If I see that the problem cant be fixed I will definitely look for a different approach.
Projects:
AHK-ToolKit

User avatar
thqby
Posts: 594
Joined: 16 Apr 2021, 11:18
Contact:

Re: [v2.0.18-] invalid memory read/write with regular expressions.

Post by thqby » 01 Dec 2024, 21:32

https://github.com/AutoHotkey/AutoHotke ... 1652-R1654

@lexikos
This commit affects the above code, resulting in an out-of-bounds memory access.

I submitted a pull request.

Post Reply

Return to “Bug Reports”