Issue with glog https://github.com/golang/glog/releases/tag/v1.1.0

297 views
Skip to first unread message

Chandra S. Rangavajjula (Nokia)

unread,
Mar 16, 2023, 11:56:18 AM3/16/23
to golan...@googlegroups.com
Hi,
I am using glog in my application development. With the latest tag (https://github.com/golang/glog/releases/tag/v1.1.0), there started a new panic error with -vmodule. This issue was not there in older version.

########################################################################################################################
Error:-
########################################################################################################################
$./tst --help
usage: example -stderrthreshold=[INFO|WARNING|FATAL] -log_dir=[string]
  -alsologtostderr
      log to standard error as well as files
  -log_backtrace_at value
      when logging hits line file:N, emit a stack trace
  -log_dir string
      If non-empty, write log files in this directory
  -log_link string
      If non-empty, add symbolic links in this directory to the log files
  -logbuflevel int
      Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms.
  -logtostderr
      log to standard error instead of files
  -stderrthreshold value
      logs at or above this threshold go to stderr (default 2)
  -v value
      log level for V logs
  -vmodule value
      comma-separated list of pattern=N settings for file-filtered logging

panic calling String method on zero glog.vModuleFlag for flag vmodule: runtime error: invalid memory address or nil pointer dereference

########################################################################################################################
Example code:-
########################################################################################################################
package main

import (
      "github.com/golang/glog"
      "os"
      "flag"
      "fmt"
)

func usage() {
      fmt.Fprintf(os.Stderr, "usage: example -stderrthreshold=[INFO|WARNING|FATAL] -log_dir=[string]\n", )
      flag.PrintDefaults()
      os.Exit(2)
}

func init() {
      flag.Usage = usage
      // NOTE: This next line is key you have to call flag.Parse() for the command line
      // options or "flags" that are defined in the glog module to be picked up.
      flag.Parse()
}

func main() {
      number_of_lines := 100000
      for i := 0; i < number_of_lines; i++ {
            glog.V(2).Infof("LINE: %d", i)
            message := fmt.Sprintf("TEST LINE: %d", i)
            glog.Error(message)
      }
      glog.Flush()
}
########################################################################################################################

Regards,
Chandra R

Ian Lance Taylor

unread,
Mar 16, 2023, 12:24:47 PM3/16/23
to Chandra S. Rangavajjula (Nokia), Jonathan Amsterdam, golan...@googlegroups.com
[ + jba ]
> --
> 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/AS4PR07MB875652B4C33A66DF22D15C5BC3BC9%40AS4PR07MB8756.eurprd07.prod.outlook.com.

Chressie Himpel

unread,
Mar 16, 2023, 3:17:20 PM3/16/23
to Ian Lance Taylor, Chandra S. Rangavajjula (Nokia), Jonathan Amsterdam, golan...@googlegroups.com
On Thu, Mar 16, 2023 at 5:24 PM Ian Lance Taylor <ia...@golang.org> wrote:
>
> [ + jba ]
>
> On Thu, Mar 16, 2023 at 8:56 AM Chandra S. Rangavajjula (Nokia)
> <chandra.s.r...@nokia.com> wrote:
> >
> > Hi,
> > I am using glog in my application development. With the latest tag (https://github.com/golang/glog/releases/tag/v1.1.0), there started a new panic error with -vmodule. This issue was not there in older version.

Thanks for the report. The panic stems from the flag package trying to
call .String on the mentioned glog.vModuleFlag type. I'll fix this
internally and publish a new version soon.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXXuFg24BCDAtSRLd2XjSqVJOHtMfbdqMH-EryF0mK7iA%40mail.gmail.com.

chandra sekhar

unread,
Mar 20, 2023, 11:44:22 AM3/20/23
to golang-nuts
Hi,
I see that you have already provided a fix for this issue https://github.com/golang/glog/commit/9c9801e69114b582b12aa7010c75fe2105ae23b3.
Any idea when you will make a new tag release with this fix?

Regards,
Chandra R.

Chressie Himpel

unread,
Mar 20, 2023, 1:08:15 PM3/20/23
to chandra sekhar, golang-nuts
On Mon, Mar 20, 2023 at 4:44 PM chandra sekhar <sekhar...@gmail.com> wrote:
>
> Hi,
> I see that you have already provided a fix for this issue https://github.com/golang/glog/commit/9c9801e69114b582b12aa7010c75fe2105ae23b3.
> Any idea when you will make a new tag release with this fix?

I have another fix in the pipeline that i would like to land before
tagging a new release. It should be a matter of a few days. Thanks for
your patience.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e0353b10-21c9-4540-a107-8eea8104e6f7n%40googlegroups.com.

Chressie Himpel

unread,
Mar 22, 2023, 12:08:17 PM3/22/23
to chandra sekhar, golang-nuts
On Mon, Mar 20, 2023 at 6:07 PM Chressie Himpel <chre...@google.com> wrote:
>
> On Mon, Mar 20, 2023 at 4:44 PM chandra sekhar <sekhar...@gmail.com> wrote:
> >
> > Hi,
> > I see that you have already provided a fix for this issue https://github.com/golang/glog/commit/9c9801e69114b582b12aa7010c75fe2105ae23b3.
> > Any idea when you will make a new tag release with this fix?
>
> I have another fix in the pipeline that i would like to land before
> tagging a new release. It should be a matter of a few days. Thanks for
> your patience.

I just tagged https://github.com/golang/glog/releases/tag/v1.1.1 that
contains the fix.

chandra sekhar

unread,
Mar 23, 2023, 2:24:16 PM3/23/23
to golang-nuts
Hi Chressie Himpel,
Fix works for me. Thanks for the quick response. 

Regards,
Chandra R

Reply all
Reply to author
Forward
0 new messages