Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd crash on Linux and Windows XP (on all versions of the compiler) #64

Closed
ziggi opened this issue May 6, 2015 · 6 comments
Closed

Comments

@ziggi
Copy link
Contributor

ziggi commented May 6, 2015

Sometimes i got crash on 2078 line in sc3.c:

        if (arg[argidx].numtags==1)     /* set the expected tag, if any */
          lval.cmptag=arg[argidx].tags[0]; // crash here

I can't show small Pawn code for reproduce this, because It is not always. Sometimes i change one symbol and get compiler crash, after it I change false on true in strcmp and fix it -_-.

On Windows 7 everything is always good.

Without these lines at first sight everything works good.

@Zeex
Copy link
Member

Zeex commented May 10, 2015

Can you show the output of info locals and info args commands in gdb at the point of the crash?

@ziggi
Copy link
Contributor Author

ziggi commented May 10, 2015

Pawn compiler 3.10.20150503                     Copyright (c) 1997-2006, ITB CompuPhase


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff799a7db in callfunction (sym=0x6eb400, lval_result=0x7fffffffdde0, 
    matchparanthesis=1) at /home/ziggi/dev/samp/development/pawn/source/compiler/sc3.c:2078
2078              lval.cmptag=arg[argidx].tags[0];
(gdb) info locals
nest_stkusage = 0
nesting = 1
locheap = 0
close = 0
lvalue = 32767
argpos = 0
argidx = 0
nargs = 0
heapalloc = 0
namedparams = 0
lval = {sym = 0x0, constval = 0, tag = 0, cmptag = 0, ident = 0 '\000', 
  boolresult = 0 '\000', arrayidx = 0x0}
arg = 0x6eaef0
arglist = "\002", '\000' <repeats 125 times>
arrayszlst = {next = 0x0, name = '\000' <repeats 31 times>, value = 0, index = 0}
taglst = {next = 0x0, name = '\000' <repeats 31 times>, value = 0, index = 0}
symret = 0x0
lexval = 32767
lexstr = 0x7ffff7bbc589 <pline+9> "_OnPlayerStateChange(playerid, newstate, oldstate);\r\n"
__PRETTY_FUNCTION__ = "callfunction"
(gdb) info args
sym = 0x6eb400
lval_result = 0x7fffffffdde0
matchparanthesis = 1

@ziggi
Copy link
Contributor Author

ziggi commented May 10, 2015

Maybe it will be useful too:

(gdb) p arg[argidx]
$16 = {
  name = "\000\000\000\000\000\000\000\000X\234\226\367\377\177", '\000' <repeats 17 times>, 
  ident = 0 '\000', usage = 83 'S', tags = 0x430755dd41757176, numtags = 1, dim = {1, 583, 
    -994609610}, idxtag = {-1031180662, 1096484389, 1124595925}, numdim = 1, 
  hasdefault = 1 '\001', defvalue = {val = -994852039, size = {
      symname = 0xc3322dbfc4b3c339 <error: Cannot access memory at address 0xc3322dbfc4b3c339>, level = -3355}, array = {data = 0xc3322dbfc4b3c339, size = 1096479461, 
      arraysize = 1135011142, addr = 1}}, defvalue_tag = 583}
(gdb) p arg[argidx].tags
$17 = (int *) 0x430755dd41757176
(gdb) p arg[argidx].tags[0]
Cannot access memory at address 0x430755dd41757176

@Zeex
Copy link
Member

Zeex commented May 10, 2015

OK, thanks.

BTW it seems that you're using a 64-bit binary of the compiler instead of a 32-bit one. That may be not 100% working. To compile a 32-bit executable you need to pass a -DCMAKE_C_FLAGS=-m32 option to cmake.

@ziggi
Copy link
Contributor Author

ziggi commented May 10, 2015

After change the compiler on a 32-bit version, gamemode was compiled good. But I made some changes (define FIXES_Single 1) and I got crash again:

Pawn compiler 3.10.25c7f33                      Copyright (c) 1997-2006, ITB CompuPhase


Program received signal SIGSEGV, Segmentation fault.
0xf7f5477f in callfunction (sym=0x80fb690, lval_result=0xffffcf94, matchparanthesis=1)
    at /home/ziggi/dev/samp/development/pawn/source/compiler/sc3.c:2078
2078              lval.cmptag=arg[argidx].tags[0];
(gdb) info locals
nest_stkusage = 0
nesting = 1
locheap = 0
close = 0
lvalue = 124
argpos = 0
argidx = 0
nargs = 0
heapalloc = 0
namedparams = 0
lval = {sym = 0x0, constval = 0, tag = 0, cmptag = 0, ident = 0 '\000', 
  boolresult = 0 '\000', arrayidx = 0x0}
arg = 0x80fb700
arglist = "\002", '\000' <repeats 125 times>
arrayszlst = {next = 0x0, name = '\000' <repeats 31 times>, value = 0, index = 0}
taglst = {next = 0x0, name = '\000' <repeats 31 times>, value = 0, index = 0}
symret = 0x0
lexval = 1
lexstr = 0x80 <error: Cannot access memory at address 0x80>
__PRETTY_FUNCTION__ = "callfunction"
(gdb) info args
sym = 0x80fb690
lval_result = 0xffffcf94
matchparanthesis = 1
(gdb) p arg[argidx]
$1 = {
  name = "p\330\362\367p\330\362\367\000\000\000\000\000\000\000\000\035\002\000\000i\376\265Da\355\063EO\036'A", ident = 0 '\000', usage = 21 '\025', tags = 0x33, numtags = 1, dim = {
    545, 1153380971, 1160985191}, idxtag = {1093278263, 1132856748, 39}, numdim = 1, 
  hasdefault = 165 '\245', defvalue = {val = 1153381418, size = {
      symname = 0x44bf342a <error: Cannot access memory at address 0x44bf342a>, 
      level = 15309}, array = {data = 0x44bf342a, size = 1160854477, arraysize = 1093288224, 
      addr = 1132918322}}, defvalue_tag = 62}
(gdb) p arg[argidx].tags
$2 = (int *) 0x33
(gdb) p arg[argidx].tags[0]
Cannot access memory at address 0x33

Zeex added a commit that referenced this issue Sep 7, 2016
Remove Linux crash lines (#64, #114)
@Zeex
Copy link
Member

Zeex commented Sep 7, 2016

This was fixed by #115.

@Zeex Zeex closed this as completed Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants