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 > c

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 "g

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

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

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) }

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

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

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): >

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 yo

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

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 t

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.

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 > compi

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

2023-08-08 Thread Bernd Fix
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