When I run the following in Pike 8.1, it SEGFAULTs:
foo::bar = 1;
Gets me: p.pike:4:No inherit or surrounding class foo. Segmentation fault
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
When I run the following in Pike 8.1, it SEGFAULTs:
foo::bar = 1;
Gets me: p.pike:4:No inherit or surrounding class foo. Segmentation fault
Please provide a full example.
$ ls -l p.pike -rwxr-xr-x 1 srb srb 39 jun 11 09:04 p.pike $ cat p.pike #!/usr/local/bin/pike81
foo::bar = 1; $ ./p.pike p.pike:3:No inherit or surrounding class foo. Segmentation fault $
Stephen R. van den Berg wrote:
Please provide a full example.
Shortest example so far:
$ pike -e "foo::bar = 1;" -:2:No inherit or surrounding class foo. Segmentation fault
I can't reproduce the crash:
| $ ./pike -e "foo::bar = 1;" | -:2:No inherit or surrounding class foo. | Compilation failed. | $ echo $? | 20
Please provide the backtrace of the crash from a debugger.
/grubba
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Stephen R. van den Berg wrote:
Please provide a full example.
Shortest example so far:
$ pike -e "foo::bar = 1;" -:2:No inherit or surrounding class foo. Segmentation fault
I can't reproduce the crash:
| $ ./pike -e "foo::bar = 1;" | -:2:No inherit or surrounding class foo. | Compilation failed. | $ echo $? | 20
Please provide the backtrace of the crash from a debugger.
Program received signal SIGSEGV, Segmentation fault. 0x000055555561c6b5 in find_inherited_identifier (inherit_state=0x5555557e7140, inherit_depth=0, inh=1, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2304 2304 return program_magic_identifier(inherit_state, inherit_depth, inh, ident, 1); (gdb) where #0 0x000055555561c6b5 in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=1, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2304 #1 0x00005555555727ae in yyparse () at language.yacc:4232 #2 0x0000555555610b75 in do_yyparse () at /var/src/roxen/81pike/src/pike_compiler.cmod:362 #3 0x00005555556151a5 in run_pass1 (c=0x5555557d4a00) at /var/src/roxen/81pike/src/pike_compiler.cmod:1050 #4 f_compilation_compile (args=0) at /var/src/roxen/81pike/src/pike_compiler.cmod:1657 #5 0x0000555555584d6f in lower_mega_apply (args=args@entry=0, o=o@entry=0x5555557ca2b0, fun=1) at /var/src/roxen/81pike/src/interpret.c:2285 #6 0x0000555555585612 in jump_opcode_F_CALL_OTHER (arg1=13) at /var/src/roxen/81pike/src/interpret_functions.h:2424 #7 0x00007ffff753cdad in ?? () #8 0x0000000000000091 in ?? () #9 0x0000000000000000 in ?? () (gdb) list 2299 return mkidentifiernode(id); 2300 } 2301 if (inh < 0) inh = -1; 2302 } 2303 2304 return program_magic_identifier(inherit_state, inherit_depth, inh, ident, 1); 2305 } 2306 2307 /*! @decl constant this 2308 *! (gdb) p *inherit_state $1 = {previous = 0x55555587c5d0, last_line = 93824994705424, last_file = 0x0, fake_object = 0x0, new_program = 0x0, malloc_size_program = 0x0, init_node = 0x0, last_pc = 861, num_parse_error = 0, compiler_frame = 0x0, num_used_modules = 0, compiler_pass = 3, local_class_counter = 0, catch_level = 0, current_modifiers = 1, current_annotations = 0x0, current_attributes = 0x0, varargs = 0, num_create_args = 0, num_inherits = 1, last_identifier = 0x0, module_index_cache = 0x0, type_stackp = 0x7ffff75d6000, pike_type_mark_stackp = 0x7ffff75a5018, parent_identifier = 50, compat_major = 8, compat_minor = 1, flags = 0, compiler = 0x0, node_allocator = {l = {offset = 40880, block_size = 80, blocks = 512, alignment = 0, doffset = 16}, size = 0 '\000', last_free = 0 '\000', alloc = 0 '\000', pages = {0x0 <repeats 24 times>}}} (gdb) p *ident $2 = {refs = 2, flags = 24 '\030', size_shift = 0 '\000', alloc_type = 2 '\002', struct_type = 0 '\000', min = 97 'a', max = 114 'r', len = 3, hval = 2164092984, next = 0x0, str = 0x555555909de0 "bar"}
Stephen R. van den Berg wrote:
Program received signal SIGSEGV, Segmentation fault. 0x000055555561c6b5 in find_inherited_identifier (inherit_state=0x5555557e7140, inherit_depth=0, inh=1, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2304 2304 return program_magic_identifier(inherit_state, inherit_depth, inh, ident, 1); (gdb) where #0 0x000055555561c6b5 in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=1, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2304 #1 0x00005555555727ae in yyparse () at language.yacc:4232
[...]
Thanks. Potentially fixed.
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Thanks. Potentially fixed.
Sorry, whack-a-mole, I guess. The bug shifted, maybe it's more obvious now (you check for inh > 0, does that even work for pointers? Maybe that should be inh != 0 instead?):
-:2:No inherit or surrounding class foo.
Program received signal SIGSEGV, Segmentation fault. really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 7392 last_inh = prog->num_inherits; (gdb) where #0 really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 #1 0x000055555561c53f in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=0, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2249 #2 0x00005555555727ae in yyparse () at language.yacc:4230 #3 0x0000555555610b55 in do_yyparse () at /var/src/roxen/81pike/src/pike_compiler.cmod:362 #4 0x0000555555615185 in run_pass1 (c=0x5555557d4a00) at /var/src/roxen/81pike/src/pike_compiler.cmod:1050 #5 f_compilation_compile (args=0) at /var/src/roxen/81pike/src/pike_compiler.cmod:1657 #6 0x0000555555584d4f in lower_mega_apply (args=args@entry=0, o=o@entry=0x5555557ca2b0, fun=1) at /var/src/roxen/81pike/src/interpret.c:2285 #7 0x00005555555855f2 in jump_opcode_F_CALL_OTHER (arg1=13) at /var/src/roxen/81pike/src/interpret_functions.h:2424 #8 0x00007ffff753cdad in ?? () #9 0x0000000000000091 in ?? () #10 0x0000000000000000 in ?? () (gdb) list 7387 } 7388 #endif /* PIKE_DEBUG */ 7389 7390 id = -1; 7391 depth = 0; 7392 last_inh = prog->num_inherits; 7393 i = (int)prog->num_identifier_references; 7394 while(i--) 7395 { 7396 funp = prog->identifier_references + i; (gdb) p prog $1 = (const struct program *) 0x0 (gdb) up #1 0x000055555561c53f in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=0, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2249 2249 id = really_low_find_shared_string_identifier(ident, (gdb) l 2244 /* Specified inherit. */ 2245 id = low_reference_inherited_identifier(inherit_state, inh, ident, 2246 SEE_PROTECTED); 2247 } else { 2248 /* this_program:: (0), local:: (-1) or global:: (-2). */ 2249 id = really_low_find_shared_string_identifier(ident, 2250 inherit_state->new_program, 2251 SEE_PROTECTED|SEE_PRIVATE); 2252 } 2253 (gdb) p inh $2 = 0 (gdb) l 2230 2225 if (id == -1) continue; 2226 if (inherit_depth) { 2227 n = mkexternalnode(inherit_state->new_program, id); 2228 } else { 2229 n = mkidentifiernode(id); 2230 } 2231 if (res) { 2232 res = mknode(F_ARG_LIST, res, n); 2233 } else { 2234 res = n; (gdb) l 2235 } 2236 } 2237 if (res) { 2238 if (res->token == F_ARG_LIST) res = mkefuncallnode("aggregate", res); 2239 return res; 2240 } 2241 inh = -1; 2242 } else { 2243 if (inh > 0) { 2244 /* Specified inherit. */ (gdb) l 2245 id = low_reference_inherited_identifier(inherit_state, inh, ident, 2246 SEE_PROTECTED); 2247 } else { 2248 /* this_program:: (0), local:: (-1) or global:: (-2). */ 2249 id = really_low_find_shared_string_identifier(ident, 2250 inherit_state->new_program, 2251 SEE_PROTECTED|SEE_PRIVATE); 2252 } 2253 2254 if (id != -1) { (gdb)
Stephen R. van den Berg wrote:
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Thanks. Potentially fixed.
Sorry, whack-a-mole, I guess. The bug shifted, maybe it's more obvious now (you check for inh > 0, does that even work for pointers? Maybe that should be inh != 0 instead?):
Sorry, didn't look right, here are the relevant values:
(gdb) p ident $3 = (struct pike_string *) 0x55555590a308 (gdb) p *ident $4 = {refs = 2, flags = 24 '\030', size_shift = 0 '\000', alloc_type = 2 '\002', struct_type = 0 '\000', min = 97 'a', max = 114 'r', len = 3, hval = 2164092984, next = 0x0, str = 0x555555909de0 "bar"} (gdb) p inherit_state $5 = (struct program_state *) 0x5555557e7140 (gdb) p *inherit_state $6 = {previous = 0x55555594bf50, last_line = 93824994705424, last_file = 0x0, fake_object = 0x0, new_program = 0x0, malloc_size_program = 0x0, init_node = 0x0, last_pc = 861, num_parse_error = 0, compiler_frame = 0x0, num_used_modules = 0, compiler_pass = 3, local_class_counter = 0, catch_level = 0, current_modifiers = 1, current_annotations = 0x0, current_attributes = 0x0, varargs = 0, num_create_args = 0, num_inherits = 1, last_identifier = 0x0, module_index_cache = 0x0, type_stackp = 0x7ffff75d6000, pike_type_mark_stackp = 0x7ffff75a5018, parent_identifier = 50, compat_major = 8, compat_minor = 1, flags = 0, compiler = 0x0, node_allocator = {l = {offset = 40880, block_size = 80, blocks = 512, alignment = 0, doffset = 16}, size = 0 '\000', last_free = 0 '\000', alloc = 0 '\000', pages = {0x0 <repeats 24 times>}}}
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Thanks. Potentially fixed.
Sorry, whack-a-mole, I guess. The bug shifted, maybe it's more obvious now (you check for inh > 0, does that even work for pointers? Maybe that should be inh != 0 instead?):
[...]
Program received signal SIGSEGV, Segmentation fault. really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 7392 last_inh = prog->num_inherits; (gdb) where #0 really_low_find_shared_string_identifier (name=name@entry=0x55555590a308, prog=prog@entry=0x0, flags=flags@entry=3) at /var/src/roxen/81pike/src/program.c:7392 #1 0x000055555561c53f in find_inherited_identifier ( inherit_state=0x5555557e7140, inherit_depth=0, inh=0, ident=0x55555590a308) at /var/src/roxen/81pike/src/program.c:2249 #2 0x00005555555727ae in yyparse () at language.yacc:4230
[...]
Looks like something has set Pike_compiler->new_program to NULL.
New attempt at fixing committed.
/grubba
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Thanks. Potentially fixed.
Looks like something has set Pike_compiler->new_program to NULL.
New attempt at fixing committed.
$ pike -e "foo::bar = 1;" -:2:No inherit or surrounding class foo. Compilation failed.
Cheers!
Looks like something has set Pike_compiler->new_program to NULL.
New attempt at fixing committed.
$ pike -e "foo::bar = 1;" -:2:No inherit or surrounding class foo. Compilation failed.
Cheers!
Great.
Now please fix the testsuite falures caused by the Stdio.FakePipe changes.
/grubba
Stephen R. van den Berg wrote:
Henrik Grubbström (Lysator) @ Pike (-) developers forum wrote:
Now please fix the testsuite falures caused by the Stdio.FakePipe changes.
I'll run through them.
Fixed.
There are still some failures that are triggered:
| Doing tests in modules/_Stdio/testsuite (181 tests, pid 24931) | Child: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 15 open fds: | 0 | - 14 | | Child failed with errcode 1 | Parent: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 15 open fds: | 0 | - 14 | | 3/26 tests failed (skipped 0). | Child: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 15 open fds: | 0 | - 14 | | Child failed with errcode 1 | Parent: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 15 open fds: | 0 | - 14 | | 3/26 tests failed (skipped 0). | Child: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 16 open fds: | 0 | - 15 | | Child failed with errcode 1 | Parent: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 16 open fds: | 0 | - 15 | | 3/26 tests failed (skipped 0). | Child: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 16 open fds: | 0 | - 15 | | Child failed with errcode 1 | Parent: Copying 19712 bytes of data on 14 fake pipes | No callbacks for 2 seconds! | 16 open fds: | 0 | - 15 | | 3/26 tests failed (skipped 0). | Subresult: 722 tests, 12 failed, 7 skipped
/grubba
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Stephen R. van den Berg wrote:
Henrik Grubbstr?m (Lysator) @ Pike (-) developers forum wrote:
Now please fix the testsuite falures caused by the Stdio.FakePipe changes.
I'll run through them.
Fixed.
There are still some failures that are triggered:
| Doing tests in modules/_Stdio/testsuite (181 tests, pid 24931)
Fixed as well.
pike-devel@lists.lysator.liu.se