Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-05 Thread Brian Candler
But if you remove the reference to regexp/syntax in the top-level main.go, 
then it also works fine (with no change to the plugin code itself).

On Tuesday, 5 September 2023 at 20:05:58 UTC+1 Howard C. Shaw III wrote:

> It looks to me like the regexp package has an func init() that never gets 
> called when Re is only imported in a plugin, which is why it works when you 
> uncomment the lines that use regexp in the main package.
>
> Howard
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9d61d856-8630-41bd-823d-079101305dacn%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-05 Thread Howard C. Shaw III
It looks to me like the regexp package has an func init() that never gets 
called when Re is only imported in a plugin, which is why it works when you 
uncomment the lines that use regexp in the main package.

Howard

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/272c1bc4-ec9e-4ac4-b023-9ed8fee865c3n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-05 Thread Brian Candler
Slightly simplified version:

==> go.mod <==
module example.com

go 1.20

==> main.go <==
package main

import (
"plugin"
"regexp/syntax"
)

func main() {
if syntax.Perl != 212 {
panic("Unexpected flags")
}

p, err := plugin.Open("p1.so")
if err != nil {
panic(err)
}
s, err := p.Lookup("F")
if err != nil {
panic(err)
}

f := s.(func())
f()
}

==> p1/plugin.go <==
package main

import (
"regexp"
)

func F() {
_ = regexp.MustCompile(`\w+`)
}

func main() {}


FWIW, it also fails in the same way on macOS:

$ go build -buildmode=plugin ./p1 && go run main.go
panic: regexp: Compile(`\w+`): error parsing regexp: invalid escape 
sequence: `\w`

goroutine 1 [running]:
regexp.MustCompile({0x107aa6eea, 0x3})
/usr/local/go/src/regexp/regexp.go:319 +0xb4
example.com/p1.F()
/Users/brian/tmp/go/62430/p1/plugin.go:8 +0x1f
main.main()
/Users/brian/tmp/go/62430/main.go:23 +0x103
exit status 2

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e6767616-877e-4362-9c2f-21522646ccc9n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-05 Thread Brian Candler
I forgot to include

==> go.mod <==
module example.com

go 1.20

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ef1aa868-6604-45a9-ae91-4cfd6d4ce277n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-05 Thread Brian Candler
I have been able to replicate the OP's problem with go 1.21.0

==> main.go <==
package main

import (
"plugin"
//"regexp"
"regexp/syntax"
)

func main() {
//_, _ = regexp.Compile(`\w+`)

p, err := plugin.Open("p1.so")
if err != nil {
panic(err)
}
s, err := p.Lookup("F")
if err != nil {
panic(err)
}

f := s.(func() (syntax.Flags, error))
_, err = f()
if err != nil {
panic(err)
}
}

==> p1/plugin.go <==
package main

import (
"regexp"
"regexp/syntax"
)

func F() (syntax.Flags, error) {
_, err := regexp.Compile(`\w+`)
return syntax.Flags(0), err
}

func main() {}


$ go version
go version go1.21.0 linux/amd64
$ go build -buildmode=plugin ./p1 && go run main.go
panic: error parsing regexp: invalid escape sequence: `\w`

goroutine 1 [running]:
main.main()
/home/ubuntu/62430/main.go:24 +0x129
exit status 2

The problem goes away if you uncomment the two commented-out lines in 
main.go

I had an idea about what might be happening.  In this situation, 
MustCompile is behaving like MustCompilePOSIX (which doesn't accept the \w 
character class).

Package regexp/syntax defines a constant "Perl" which includes various 
flags, including PerlX which allows this class:

func Compile(expr string) (*Regexp, error) {
return compile(expr, syntax.Perl, false)
}

I'm wondering if somehow this value hasn't been initialized, and is treated 
as zero.  However, if I print the value of syntax.Perl within main() or 
F(), I see that it is 212 as expected, even when the error occurs.

On Monday, 4 September 2023 at 18:55:07 UTC+1 Brian Candler wrote:

> I'm afraid I have to contradict that answer (from an AI chatbot perhaps?)
>
> Go's regexp library, called re2, is documented here: 
> https://github.com/google/re2/wiki/Syntax
>
> It *does* support the \w character class. See the section headed "Perl 
> character classes (all ASCII-only)".  Furthermore, the OP was successfully 
> using \w with go 1.20.7.  The problem arose with 1.21 and is something to 
> do with plugin loading or initialization.
>
> On Monday, 4 September 2023 at 17:56:32 UTC+1 Google's Affiliate (Google 
> Business Affiliate) wrote:
>
>> Hello, this is Jonathan, I can help you with your question about the 
>> error parsing regexp in Go.
>>
>> The error you are getting is caused by the use of \w in your regular 
>> expression. This is an invalid escape sequence in Go, because \w is not 
>> a predefined character class 
>> 
>> 1 
>> 
>> . Go only supports the following escape sequences in regular expressions 
>> 
>> 2 
>> 
>> :
>>
>>- \t for tab
>>- \n for newline
>>- \r for carriage return
>>- \f for form feed
>>- \a for alert
>>- \b for word boundary
>>- \B for non-word boundary
>>- \d for decimal digit
>>- \D for non-decimal digit
>>- \s for whitespace character
>>- \S for non-whitespace character
>>- \w for word character (alphanumeric plus _)
>>- \W for non-word character
>>
>> To match a word character in Go, you need to use [[:word:]], which is 
>> equivalent to [0-9A-Za-z_]. Alternatively, you can use [[:alnum:]]_, 
>> which is equivalent to [0-9A-Za-z]_. So, your regular expression should 
>> be:
>>
>> regexp.Compile(`^([[:word:]./]+)/((?:[[:word:]]+)|[*])(.+)?$`)
>>
>> or
>>
>> regexp.Compile(`^([[:alnum:]_./]+)/((?:[[:alnum:]_]+)|[*])(.+)?$`)
>>
>> This should fix the error and allow you to load the plugin successfully.
>>
>> I hope this helps you with your problem. If you have any further 
>> questions, please feel free to ask. 
>>
>>
>>
>> On Sunday, September 3, 2023 at 4:47:39 AM UTC-4 Olivier Szika wrote:
>>
>>> Hi,
>>>
>>> Unexpectedly, unicode.Categories is an empty map when it's only used 
>>> with a plugin.
>>> I opened a ticket: https://github.com/golang/go/issues/62430
>>>
>>> Regards,
>>>
>>> Le samedi 12 août 2023 à 18:13:31 UTC+2, Wojciech S. Czarnecki a écrit :
>>>
 Dnia 2023-08-08, o godz. 18:11:56 
 Bernd Fix  napisał(a): 

 > After switching from go1.20.7 to go1.21.0 one of my applications 
 > compiles without warnings or errors, but fails at run-time with the 
 > following panic when loading a plugin: 

 IIRC release notes tools now are version aware, so likely you need to 
 bring 
 all go.mod's version to state 1.21.0 

 hope this helps, 

 > Cheers, Bernd. 
 > 



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-04 Thread Brian Candler
I'm afraid I have to contradict that answer (from an AI chatbot perhaps?)

Go's regexp library, called re2, is documented 
here: https://github.com/google/re2/wiki/Syntax

It *does* support the \w character class. See the section headed "Perl 
character classes (all ASCII-only)".  Furthermore, the OP was successfully 
using \w with go 1.20.7.  The problem arose with 1.21 and is something to 
do with plugin loading or initialization.

On Monday, 4 September 2023 at 17:56:32 UTC+1 Google's Affiliate (Google 
Business Affiliate) wrote:

> Hello, this is Jonathan, I can help you with your question about the error 
> parsing regexp in Go.
>
> The error you are getting is caused by the use of \w in your regular 
> expression. This is an invalid escape sequence in Go, because \w is not a 
> predefined character class 
> 
> 1 
> 
> . Go only supports the following escape sequences in regular expressions 
> 
> 2 
> 
> :
>
>- \t for tab
>- \n for newline
>- \r for carriage return
>- \f for form feed
>- \a for alert
>- \b for word boundary
>- \B for non-word boundary
>- \d for decimal digit
>- \D for non-decimal digit
>- \s for whitespace character
>- \S for non-whitespace character
>- \w for word character (alphanumeric plus _)
>- \W for non-word character
>
> To match a word character in Go, you need to use [[:word:]], which is 
> equivalent to [0-9A-Za-z_]. Alternatively, you can use [[:alnum:]]_, 
> which is equivalent to [0-9A-Za-z]_. So, your regular expression should 
> be:
>
> regexp.Compile(`^([[:word:]./]+)/((?:[[:word:]]+)|[*])(.+)?$`)
>
> or
>
> regexp.Compile(`^([[:alnum:]_./]+)/((?:[[:alnum:]_]+)|[*])(.+)?$`)
>
> This should fix the error and allow you to load the plugin successfully.
>
> I hope this helps you with your problem. If you have any further 
> questions, please feel free to ask. 
>
>
>
> On Sunday, September 3, 2023 at 4:47:39 AM UTC-4 Olivier Szika wrote:
>
>> Hi,
>>
>> Unexpectedly, unicode.Categories is an empty map when it's only used with 
>> a plugin.
>> I opened a ticket: https://github.com/golang/go/issues/62430
>>
>> Regards,
>>
>> Le samedi 12 août 2023 à 18:13:31 UTC+2, Wojciech S. Czarnecki a écrit :
>>
>>> Dnia 2023-08-08, o godz. 18:11:56 
>>> Bernd Fix  napisał(a): 
>>>
>>> > After switching from go1.20.7 to go1.21.0 one of my applications 
>>> > compiles without warnings or errors, but fails at run-time with the 
>>> > following panic when loading a plugin: 
>>>
>>> IIRC release notes tools now are version aware, so likely you need to 
>>> bring 
>>> all go.mod's version to state 1.21.0 
>>>
>>> hope this helps, 
>>>
>>> > Cheers, Bernd. 
>>> > 
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e43019b7-3fd7-4163-ac9f-c7b6e5465204n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-04 Thread Google's Affiliate (Google Business Affiliate)


Hello, this is Jonathan, I can help you with your question about the error 
parsing regexp in Go.

The error you are getting is caused by the use of \w in your regular 
expression. This is an invalid escape sequence in Go, because \w is not a 
predefined character class 

1 

. Go only supports the following escape sequences in regular expressions 
2 

:

   - \t for tab
   - \n for newline
   - \r for carriage return
   - \f for form feed
   - \a for alert
   - \b for word boundary
   - \B for non-word boundary
   - \d for decimal digit
   - \D for non-decimal digit
   - \s for whitespace character
   - \S for non-whitespace character
   - \w for word character (alphanumeric plus _)
   - \W for non-word character

To match a word character in Go, you need to use [[:word:]], which is 
equivalent to [0-9A-Za-z_]. Alternatively, you can use [[:alnum:]]_, which 
is equivalent to [0-9A-Za-z]_. So, your regular expression should be:

regexp.Compile(`^([[:word:]./]+)/((?:[[:word:]]+)|[*])(.+)?$`)

or

regexp.Compile(`^([[:alnum:]_./]+)/((?:[[:alnum:]_]+)|[*])(.+)?$`)

This should fix the error and allow you to load the plugin successfully.

I hope this helps you with your problem. If you have any further questions, 
please feel free to ask. 



On Sunday, September 3, 2023 at 4:47:39 AM UTC-4 Olivier Szika wrote:

> Hi,
>
> Unexpectedly, unicode.Categories is an empty map when it's only used with 
> a plugin.
> I opened a ticket: https://github.com/golang/go/issues/62430
>
> Regards,
>
> Le samedi 12 août 2023 à 18:13:31 UTC+2, Wojciech S. Czarnecki a écrit :
>
>> Dnia 2023-08-08, o godz. 18:11:56 
>> Bernd Fix  napisał(a): 
>>
>> > After switching from go1.20.7 to go1.21.0 one of my applications 
>> > compiles without warnings or errors, but fails at run-time with the 
>> > following panic when loading a plugin: 
>>
>> IIRC release notes tools now are version aware, so likely you need to 
>> bring 
>> all go.mod's version to state 1.21.0 
>>
>> hope this helps, 
>>
>> > Cheers, Bernd. 
>> > 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20eff467-287c-4277-8e38-9838341c5960n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-09-03 Thread Olivier Szika
Hi,

Unexpectedly, unicode.Categories is an empty map when it's only used with a 
plugin.
I opened a ticket: https://github.com/golang/go/issues/62430

Regards,

Le samedi 12 août 2023 à 18:13:31 UTC+2, Wojciech S. Czarnecki a écrit :

> Dnia 2023-08-08, o godz. 18:11:56
> Bernd Fix  napisał(a):
>
> > After switching from go1.20.7 to go1.21.0 one of my applications 
> > compiles without warnings or errors, but fails at run-time with the 
> > following panic when loading a plugin:
>
> IIRC release notes tools now are version aware, so likely you need to bring
> all go.mod's version to state 1.21.0
>
> hope this helps,
>
> > Cheers, Bernd.
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/14ea679c-a715-4a06-a18c-e7386f89009dn%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-12 Thread Wojciech S. Czarnecki
Dnia 2023-08-08, o godz. 18:11:56
Bernd Fix  napisał(a):

> After switching from go1.20.7 to go1.21.0 one of my applications 
> compiles without warnings or errors, but fails at run-time with the 
> following panic when loading a plugin:

IIRC release notes tools now are version aware, so likely you need to bring
all go.mod's version to state 1.21.0

hope this helps,

> Cheers, Bernd.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20230812181144.3992cea8%40xmint.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-09 Thread Bernd Fix

On 8/9/23 07:09, Marcello H wrote:

Can you isolate the problem?
If the issue is within the regex, you might be able to put that in a
separate program to test if it happens there too.


I did that and the regex compiles fine in go1.21.0 (as expected).



Op woensdag 9 augustus 2023 om 00:51:01 UTC+2 schreef Bernd Fix:


On 8/8/23 18:16, Kurtis Rader wrote:

Did you also recompile the plugin with the new Go toolchain? It's a
requirement of plugin support that the main program and all plugins be
compiled with the same toolchain.


Yes, the loading program and the module were both compiled with the same
toolchain. After the first occurence of the issue, I removed everything
below $GOPATH and cleaned the cache, just to make sure everything got
recompiled correctly - but the problem persists.

If loading and loaded module differ, I would expect a panic like "plugin
was built with a different version" (I remember seeing that once) - but
certainly not a panic in a regular expression parser.



On Tue, Aug 8, 2023 at 11:12 AM Bernd Fix  wrote:


After switching from go1.20.7 to go1.21.0 one of my applications
compiles without warnings or errors, but fails at run-time with the
following panic when loading a plugin:

panic: regexp: Compile(`^([\w./]+)/((?:\w+)|[*])(.+)?$`): error parsing
regexp: invalid escape sequence: `\w`

goroutine 1 [running]:
regexp.MustCompile({0x7fee026ddc4f, 0x1e})
.../golang/src/regexp/regexp.go:319 +0xb4
google.golang.org/grpc/internal/binarylog.init()

.../ext/pkg/mod/
google.golang.org/gr...@v1.57.0/internal/binarylog/env_config.go:135



+0xf9
plugin.open({0xc146b0, 0xe})
.../golang/src/plugin/plugin_dlopen.go:95 +0x51c
plugin.Open(...)
.../golang/src/plugin/plugin.go:80

The above regex compiles fine in go1.21.0 directly, so I wonder what is
happening here.

After switching back to 1.20.7 and a full recompilation, the application
works fine again...

Cheers, Bernd.

--
You received this message because you are subscribed to the Google

Groups

"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send

an

email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit


https://groups.google.com/d/msgid/golang-nuts/d208fed7-dec3-8865-b332-1d693122edda%40hoi-polloi.org

.






--
"Es sind nicht die besten Massen, die für Brot und Spiele den Verlust
der Freiheit verschmerzen." (Kautsky, 1919, "Diktatur des Proletariats")






--
"Es sind nicht die besten Massen, die für Brot und Spiele den Verlust
der Freiheit verschmerzen." (Kautsky, 1919, "Diktatur des Proletariats")

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2a17175d-e380-b176-be93-f9acd8612a11%40hoi-polloi.org.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-09 Thread Marcello H
Can you isolate the problem?
If the issue is within the regex, you might be able to put that in a 
separate program to test if it happens there too.

Op woensdag 9 augustus 2023 om 00:51:01 UTC+2 schreef Bernd Fix:

> On 8/8/23 18:16, Kurtis Rader wrote:
> > Did you also recompile the plugin with the new Go toolchain? It's a
> > requirement of plugin support that the main program and all plugins be
> > compiled with the same toolchain.
>
> Yes, the loading program and the module were both compiled with the same 
> toolchain. After the first occurence of the issue, I removed everything 
> below $GOPATH and cleaned the cache, just to make sure everything got 
> recompiled correctly - but the problem persists.
>
> If loading and loaded module differ, I would expect a panic like "plugin 
> was built with a different version" (I remember seeing that once) - but 
> certainly not a panic in a regular expression parser.
>
> > 
> > On Tue, Aug 8, 2023 at 11:12 AM Bernd Fix  wrote:
> > 
> >> After switching from go1.20.7 to go1.21.0 one of my applications
> >> compiles without warnings or errors, but fails at run-time with the
> >> following panic when loading a plugin:
> >>
> >> panic: regexp: Compile(`^([\w./]+)/((?:\w+)|[*])(.+)?$`): error parsing
> >> regexp: invalid escape sequence: `\w`
> >>
> >> goroutine 1 [running]:
> >> regexp.MustCompile({0x7fee026ddc4f, 0x1e})
> >> .../golang/src/regexp/regexp.go:319 +0xb4
> >> google.golang.org/grpc/internal/binarylog.init()
> >>
> >> .../ext/pkg/mod/
> >> google.golang.org/gr...@v1.57.0/internal/binarylog/env_config.go:135 
> 
> >> +0xf9
> >> plugin.open({0xc146b0, 0xe})
> >> .../golang/src/plugin/plugin_dlopen.go:95 +0x51c
> >> plugin.Open(...)
> >> .../golang/src/plugin/plugin.go:80
> >>
> >> The above regex compiles fine in go1.21.0 directly, so I wonder what is
> >> happening here.
> >>
> >> After switching back to 1.20.7 and a full recompilation, the application
> >> works fine again...
> >>
> >> Cheers, Bernd.
> >>
> >> --
> >> You received this message because you are subscribed to the Google 
> Groups
> >> "golang-nuts" group.
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an
> >> email to golang-nuts...@googlegroups.com.
> >> To view this discussion on the web visit
> >> 
> https://groups.google.com/d/msgid/golang-nuts/d208fed7-dec3-8865-b332-1d693122edda%40hoi-polloi.org
> >> .
> >>
> > 
> > 
>
> -- 
> "Es sind nicht die besten Massen, die für Brot und Spiele den Verlust
> der Freiheit verschmerzen." (Kautsky, 1919, "Diktatur des Proletariats")
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/91198fba-a405-4eda-b6ed-0ab0fb1cf1a2n%40googlegroups.com.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-08 Thread Bernd Fix

On 8/8/23 18:16, Kurtis Rader wrote:

Did you also recompile the plugin with the new Go toolchain? It's a
requirement of plugin support that the main program and all plugins be
compiled with the same toolchain.


Yes, the loading program and the module were both compiled with the same 
toolchain. After the first occurence of the issue, I removed everything 
below $GOPATH and cleaned the cache, just to make sure everything got 
recompiled correctly - but the problem persists.


If loading and loaded module differ, I would expect a panic like "plugin 
was built with a different version" (I remember seeing that once) - but 
certainly not a panic in a regular expression parser.




On Tue, Aug 8, 2023 at 11:12 AM Bernd Fix  wrote:


After switching from go1.20.7 to go1.21.0 one of my applications
compiles without warnings or errors, but fails at run-time with the
following panic when loading a plugin:

panic: regexp: Compile(`^([\w./]+)/((?:\w+)|[*])(.+)?$`): error parsing
regexp: invalid escape sequence: `\w`

goroutine 1 [running]:
regexp.MustCompile({0x7fee026ddc4f, 0x1e})
  .../golang/src/regexp/regexp.go:319 +0xb4
google.golang.org/grpc/internal/binarylog.init()

.../ext/pkg/mod/
google.golang.org/grpc@v1.57.0/internal/binarylog/env_config.go:135
+0xf9
plugin.open({0xc146b0, 0xe})
  .../golang/src/plugin/plugin_dlopen.go:95 +0x51c
plugin.Open(...)
  .../golang/src/plugin/plugin.go:80

The above regex compiles fine in go1.21.0 directly, so I wonder what is
happening here.

After switching back to 1.20.7 and a full recompilation, the application
works fine again...

Cheers, Bernd.

--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/d208fed7-dec3-8865-b332-1d693122edda%40hoi-polloi.org
.






--
"Es sind nicht die besten Massen, die für Brot und Spiele den Verlust
der Freiheit verschmerzen." (Kautsky, 1919, "Diktatur des Proletariats")

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f78480c7-e68e-3996-9bc6-6b334ccb3fa9%40hoi-polloi.org.


Re: [go-nuts] go1.21.0 panics when loading plugin

2023-08-08 Thread Kurtis Rader
Did you also recompile the plugin with the new Go toolchain? It's a
requirement of plugin support that the main program and all plugins be
compiled with the same toolchain.

On Tue, Aug 8, 2023 at 11:12 AM Bernd Fix  wrote:

> After switching from go1.20.7 to go1.21.0 one of my applications
> compiles without warnings or errors, but fails at run-time with the
> following panic when loading a plugin:
>
> panic: regexp: Compile(`^([\w./]+)/((?:\w+)|[*])(.+)?$`): error parsing
> regexp: invalid escape sequence: `\w`
>
> goroutine 1 [running]:
> regexp.MustCompile({0x7fee026ddc4f, 0x1e})
>  .../golang/src/regexp/regexp.go:319 +0xb4
> google.golang.org/grpc/internal/binarylog.init()
>
> .../ext/pkg/mod/
> google.golang.org/grpc@v1.57.0/internal/binarylog/env_config.go:135
> +0xf9
> plugin.open({0xc146b0, 0xe})
>  .../golang/src/plugin/plugin_dlopen.go:95 +0x51c
> plugin.Open(...)
>  .../golang/src/plugin/plugin.go:80
>
> The above regex compiles fine in go1.21.0 directly, so I wonder what is
> happening here.
>
> After switching back to 1.20.7 and a full recompilation, the application
> works fine again...
>
> Cheers, Bernd.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/d208fed7-dec3-8865-b332-1d693122edda%40hoi-polloi.org
> .
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD9vt%3D%3D-kXx%3Deaz20FJPZ1EuFVXgJ3HjZ%2BfVmoN2F48Ejw%40mail.gmail.com.