Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5032a7dc
Commit
5032a7dc
authored
Jan 10, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: distinct panic message for call of nil func value
R=golang-dev, gri CC=golang-dev
https://golang.org/cl/5531062
parent
57f15a3d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
11 deletions
+44
-11
thread_darwin.c
src/pkg/runtime/thread_darwin.c
+8
-2
thread_freebsd.c
src/pkg/runtime/thread_freebsd.c
+8
-2
thread_linux.c
src/pkg/runtime/thread_linux.c
+8
-2
thread_netbsd.c
src/pkg/runtime/thread_netbsd.c
+8
-2
thread_openbsd.c
src/pkg/runtime/thread_openbsd.c
+8
-2
thread_windows.c
src/pkg/runtime/thread_windows.c
+4
-1
No files found.
src/pkg/runtime/thread_darwin.c
View file @
5032a7dc
...
...
@@ -382,13 +382,19 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
SIGBUS
:
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGSEGV
:
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGFPE
:
...
...
src/pkg/runtime/thread_freebsd.c
View file @
5032a7dc
...
...
@@ -128,13 +128,19 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
SIGBUS
:
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGSEGV
:
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGFPE
:
...
...
src/pkg/runtime/thread_linux.c
View file @
5032a7dc
...
...
@@ -184,13 +184,19 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
SIGBUS
:
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
}
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGSEGV
:
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGFPE
:
...
...
src/pkg/runtime/thread_netbsd.c
View file @
5032a7dc
...
...
@@ -175,13 +175,19 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
SIGBUS
:
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGSEGV
:
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGFPE
:
...
...
src/pkg/runtime/thread_openbsd.c
View file @
5032a7dc
...
...
@@ -175,13 +175,19 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
SIGBUS
:
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode0
==
BUS_ADRERR
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGSEGV
:
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
if
((
g
->
sigcode0
==
0
||
g
->
sigcode0
==
SEGV_MAPERR
||
g
->
sigcode0
==
SEGV_ACCERR
)
&&
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
SIGFPE
:
...
...
src/pkg/runtime/thread_windows.c
View file @
5032a7dc
...
...
@@ -270,8 +270,11 @@ runtime·sigpanic(void)
{
switch
(
g
->
sig
)
{
case
EXCEPTION_ACCESS_VIOLATION
:
if
(
g
->
sigcode1
<
0x1000
)
if
(
g
->
sigcode1
<
0x1000
)
{
if
(
g
->
sigpc
==
0
)
runtime
·
panicstring
(
"call of nil func value"
);
runtime
·
panicstring
(
"invalid memory address or nil pointer dereference"
);
}
runtime
·
printf
(
"unexpected fault address %p
\n
"
,
g
->
sigcode1
);
runtime
·
throw
(
"fault"
);
case
EXCEPTION_INT_DIVIDE_BY_ZERO
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment