Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread T L
On Saturday, August 31, 2019 at 9:49:56 PM UTC-4, Robert Engels wrote: > > Yes, that is why the original code did not use a lock on the read but the > read of the flag was wrong. The version I posted in the other thread works > fine locally. time.Sleep() has problems in the playground > You

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread Robert Engels
Yes, that is why the original code did not use a lock on the read but the read of the flag was wrong. The version I posted in the other thread works fine locally. time.Sleep() has problems in the playground > On Aug 31, 2019, at 7:50 AM, T L wrote: > > > >> On Saturday, August 31, 2019 at

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-08-31 Thread andrey mirtchovski
see the "faking time" section here: https://blog.golang.org/playground not sure if anything has changed since that article On Sat, Aug 31, 2019 at 4:22 PM robert engels wrote: > Yes, the code runs fine locally. Reviewing the playground docs, it sees > that at one point time.Sleep() was a no-op

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-08-31 Thread robert engels
Yes, the code runs fine locally. Reviewing the playground docs, it sees that at one point time.Sleep() was a no-op and it was changed. I am thinking that in the course of that change, they forgot to change the ‘deadlock’ detector. > On Aug 31, 2019, at 5:17 PM, burak serdar wrote: > > On Sat,

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-08-31 Thread burak serdar
On Sat, Aug 31, 2019 at 4:13 PM robert engels wrote: > > The code at https://play.golang.org/p/9ZdPVvwyaYK > > should not deadlock. But it reports: I had the same problem the other day. Code runs locally, but not on playground. It also had a sleep in a goroutine. > > fatal error: all

[go-nuts] playground - time.Sleep causes deadlock

2019-08-31 Thread robert engels
The code at https://play.golang.org/p/9ZdPVvwyaYK should not deadlock. But it reports: fatal error: all goroutines are asleep - deadlock! But if you look at the stack traces, you see multiple routines (sampled) like: goroutine 1 [sleep]:

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Ronny Bangsund
On Saturday, August 31, 2019 at 3:14:28 PM UTC+2, Jakob Borg wrote: > > On 31 Aug 2019, at 12:33, Ronny Bangsund > wrote: > > > Digging through my vast mess of code, I found this function which sets the > real and effective user (Setreuid) of the calling process: > func DegradeToUser(uname

[go-nuts] Go module and local dependencies

2019-08-31 Thread t hepudds
A few quick comments: 1. Try 'go build ./...' from the root directory of the module to build all the packages in the module. 'go build' without any arguments is the same as 'go build .' which means just build the current directory/package. 2. With only one go.mod, you should not need a

[go-nuts] Go module and local dependencies

2019-08-31 Thread Guillaume Lescure
Hi, I spend my day trying to build a new project in Go using the new Go module system. I didn't succeed so I'm kind of upset because I never waste that much time for something that simple before. The project : I try to use Go module only so no environment variable anywhere. There are 1

[go-nuts] adding files to existing ZIP archieves

2019-08-31 Thread lgodio2
How do I use files in ...\src\archive\zip to add files to an existing archive file MyArchieve.zip ?? -- 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

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-31 Thread George Hartzell
George Hartzell writes: > > Quick summary, I'm trying to understand the Go structures that cgo > gives me, how they map back onto the C structures and why a Go struct > that doesn't quite match the cgo output seems to work anyway. > [...] Ian gave me a lot of good things to chew on, but

Re: [go-nuts] Help understanding mapping Go<->C structures across IOCTL's

2019-08-31 Thread George Hartzell
Ian Lance Taylor writes: > [...] > OK, that is true. Since your program will be using cgo, even though > you aren't calling any C functions, it will be dynamically linked by > default. You could try using "go build -ldflags=-extldflags=-static". > I don't know whether it will work. > To

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Jakob Borg
On 31 Aug 2019, at 12:33, Ronny Bangsund mailto:ronny.bangs...@gmail.com>> wrote: Digging through my vast mess of code, I found this function which sets the real and effective user (Setreuid) of the calling process: func DegradeToUser(uname string) error { Doesn't this suffer from the issue of

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread T L
On Saturday, August 31, 2019 at 8:24:31 AM UTC-4, Robert Engels wrote: > > If you comment out the read method then all threads will block. That is > the the behavior of an unbuffered channel - a writer blocks until a reader > is ready. Which is why you always need a valid reader running.

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread Robert Engels
If you comment out the read method then all threads will block. That is the the behavior of an unbuffered channel - a writer blocks until a reader is ready. Which is why you always need a valid reader running. Unless the channel is closed and then the writer will panic. The code I provided is

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Ronny Bangsund
On Saturday, August 31, 2019 at 10:07:59 AM UTC+2, Chris Burkert wrote: > > is there some code available to dig into that? I plan to do something > similar that a regular user process starts up a kind of a root broker which > starts several other processes as different users. > You would by

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread T L
On Saturday, August 31, 2019 at 4:04:29 AM UTC-4, T L wrote: > > > > On Saturday, August 31, 2019 at 2:32:26 AM UTC-4, rog wrote: >> >> The reason you're wanting priority select is because you are shutting >> down the data channel preemptively, but you can wait for an acknowledgement >> from

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-08-31 Thread Jesper Louis Andersen
On Thu, Aug 29, 2019 at 7:02 AM Leo Lara wrote: > Hi Michael, > > The way I always have seen "transparent" used in software engineering is, > that the user of something (lirabry, service, framework, etc) can use it > without knowing its internal details, just normally, and the magic is done > in

Re: [go-nuts] How to execute a command using root?

2019-08-31 Thread Chris Burkert
Dear Kevin, is there some code available to dig into that? I plan to do something similar that a regular user process starts up a kind of a root broker which starts several other processes as different users. Especially for the communication part I don’t have a good and secure idea so far. thanks

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread T L
On Saturday, August 31, 2019 at 2:32:26 AM UTC-4, rog wrote: > > The reason you're wanting priority select is because you are shutting down > the data channel preemptively, but you can wait for an acknowledgement from > the run goroutine instead: > > https://play.golang.org/p/qSWluYy4ifl > >

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread T L
On Friday, August 30, 2019 at 1:40:33 PM UTC-4, Robert Engels wrote: > > You changed the Read() method incorrectly - it should be using the Read > lock, not the Write lock. > > Still, as I pointed out when I posted it, Play has a problem where it > aborts if all routines are sleeping (not just

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-31 Thread roger peppe
The reason you're wanting priority select is because you are shutting down the data channel preemptively, but you can wait for an acknowledgement from the run goroutine instead: https://play.golang.org/p/qSWluYy4ifl On Wed, 28 Aug 2019 at 18:06, T L wrote: > The old thread: >