Hi,
I discover another crash with the Shuffler. Here is a test case:
#!/usr/local/bin/pike
void shuffle_filename() { object shuffler; object shuffle; shuffler = Shuffler.Shuffler(); object stdin = Stdio.File(); mapping options = ([ "stdin": stdin, "stdout": Stdio.stdout->pipe() ]); stdin = stdin->pipe(); Process.create_process(({ "/bin/ls" }), options); shuffle = shuffler->shuffle(stdin); // don't crash if i put data in the string //string data = "foobarzonk"; // crash if empty string string data = ""; shuffle->add_source(data); function foo = lambda() { destruct(stdin);}; // doesn't crash if i don't put write write("crash me! %O\n", 1); shuffle->set_done_callback(foo); shuffle->start(); }
int main(int argc, array argv) { shuffle_filename(); return -1; }
With Pike 7.6 it leads to the backtrace: #0 0x0832d200 in type_stack () #1 0x4001cfdd in __send_more_callback (t=0x83be188, amount=8192) at Shuffler.cmod:445 #2 0x4001b883 in _send_more (t=0x1) at Shuffler.cmod:291 #3 0x080cf653 in low_backend_once (me=0x83c2398, timeout=0xbffff3d8) at backend.cmod:2581 #4 0x080cfb9f in f_Backend_cq__backtick_28_29 (args=-1) at backend.cmod:2828 #5 0x0809c90a in low_mega_apply (type=APPLY_SVALUE, args=1, arg1=0x83c89fc, arg2=0x0) at apply_low.h:214 #6 0x08091be7 in eval_instruction_without_debug ( pc=0x841f7a5 "Q\031Q¶1XõÿÿÿJ(OÁR'(¿\227köÿÿÿQ\031Q¶1Q\031Q¶1XØÿÿÿ\001\001!l'") at interpret_functions.h:1936 #7 0x0809ee1b in o_catch ( pc=0x841f7a0 "Q\031Q¶1Q\031Q¶1XõÿÿÿJ(OÁR'(¿\227köÿÿÿQ\031Q¶1Q\031Q¶1XØÿÿÿ\001\001!l'") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #8 0x0808e029 in eval_instruction_without_debug (pc=0x841f79c "\023") at interpret_functions.h:1236 #9 0x0809ec28 in mega_apply (type=APPLY_STACK, args=0, arg1=0x0, arg2=0x0) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2012 #10 0x080a0a10 in apply (o=0x83b9b10, fun=0x8285d4c "_main", args=0) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2392 #11 0x08130c6b in main (argc=2, argv=0xbffffc34) at /home/david/current-projects/pike/Pike/7.6/src/main.c:839
But sometime I also get this one (from a similar program with pipe and process.create_process and still with empty string as source):
#0 0x00000040 in ?? () #1 0x407098be in _set_callbacks (t=0x8ae1c98) at Shuffler.cmod:298 #2 0x0809c90a in low_mega_apply (type=APPLY_LOW, args=0, arg1=0x83c8a7c, arg2=0xc) at apply_low.h:214 #3 0x080926e6 in eval_instruction_without_debug ( pc=0x8add484 "}\003\001Ä\vÇ\fE\001\035\005\005\a\026l='\001\035\006B\233\006\001\026\nd\017") at interpret_functions.h:1995 #4 0x0809ee1b in o_catch (pc=0x86fc592 "!\033Í") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #5 0x0808e029 in eval_instruction_without_debug (pc=0x86fc58e "\r") at interpret_functions.h:1236 #6 0x0809ee1b in o_catch (pc=0x8632d48 "! ¾-E\001e\035") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #7 0x0808e029 in eval_instruction_without_debug (pc=0x8632d44 "{") at interpret_functions.h:1236 #8 0x0809ec28 in mega_apply (type=145629520, args=145629520, arg1=0x8ae2150, arg2=0x8ae2150) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2012 #9 0x0809eee5 in f_call_function (args=145629520) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2076 #10 0x08184044 in new_thread_func (data=0xbfffef70) at /home/david/current-projects/pike/Pike/7.6/src/threads.c:868 #11 0x4007ae51 in pthread_start_thread () from /lib/libpthread.so.0 ---Type <return> to continue, or q <return> to quit--- #12 0x4007aecf in pthread_start_thread_event () from /lib/libpthread.so.0 #13 0x401ca6ca in clone () from /lib/libc.so.6
/ David
Fixed.
/ Martin Nilsson (DivX Networks)
Previous text:
2004-08-28 13:42: Subject: More testing of Shuffler
Hi,
I discover another crash with the Shuffler. Here is a test case:
#!/usr/local/bin/pike
void shuffle_filename() { object shuffler; object shuffle; shuffler = Shuffler.Shuffler(); object stdin = Stdio.File(); mapping options = ([ "stdin": stdin, "stdout": Stdio.stdout->pipe() ]); stdin = stdin->pipe(); Process.create_process(({ "/bin/ls" }), options); shuffle = shuffler->shuffle(stdin); // don't crash if i put data in the string //string data = "foobarzonk"; // crash if empty string string data = ""; shuffle->add_source(data); function foo = lambda() { destruct(stdin);}; // doesn't crash if i don't put write write("crash me! %O\n", 1); shuffle->set_done_callback(foo); shuffle->start(); }
int main(int argc, array argv) { shuffle_filename(); return -1; }
With Pike 7.6 it leads to the backtrace: #0 0x0832d200 in type_stack () #1 0x4001cfdd in __send_more_callback (t=0x83be188, amount=8192) at Shuffler.cmod:445 #2 0x4001b883 in _send_more (t=0x1) at Shuffler.cmod:291 #3 0x080cf653 in low_backend_once (me=0x83c2398, timeout=0xbffff3d8) at backend.cmod:2581 #4 0x080cfb9f in f_Backend_cq__backtick_28_29 (args=-1) at backend.cmod:2828 #5 0x0809c90a in low_mega_apply (type=APPLY_SVALUE, args=1, arg1=0x83c89fc, arg2=0x0) at apply_low.h:214 #6 0x08091be7 in eval_instruction_without_debug ( pc=0x841f7a5 "Q\031Q¶1XõÿÿÿJ(OÁR'(¿\227köÿÿÿQ\031Q¶1Q\031Q¶1XØÿÿÿ\001\001!l'") at interpret_functions.h:1936 #7 0x0809ee1b in o_catch ( pc=0x841f7a0 "Q\031Q¶1Q\031Q¶1XõÿÿÿJ(OÁR'(¿\227köÿÿÿQ\031Q¶1Q\031Q¶1XØÿÿÿ\001\001!l'") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #8 0x0808e029 in eval_instruction_without_debug (pc=0x841f79c "\023") at interpret_functions.h:1236 #9 0x0809ec28 in mega_apply (type=APPLY_STACK, args=0, arg1=0x0, arg2=0x0) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2012 #10 0x080a0a10 in apply (o=0x83b9b10, fun=0x8285d4c "_main", args=0) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2392 #11 0x08130c6b in main (argc=2, argv=0xbffffc34) at /home/david/current-projects/pike/Pike/7.6/src/main.c:839
But sometime I also get this one (from a similar program with pipe and process.create_process and still with empty string as source):
#0 0x00000040 in ?? () #1 0x407098be in _set_callbacks (t=0x8ae1c98) at Shuffler.cmod:298 #2 0x0809c90a in low_mega_apply (type=APPLY_LOW, args=0, arg1=0x83c8a7c, arg2=0xc) at apply_low.h:214 #3 0x080926e6 in eval_instruction_without_debug ( pc=0x8add484 "}\003\001Ä\vÇ\fE\001\035\005\005\a\026l='\001\035\006B\233\006\001\026\nd\017") at interpret_functions.h:1995 #4 0x0809ee1b in o_catch (pc=0x86fc592 "!\033Í") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #5 0x0808e029 in eval_instruction_without_debug (pc=0x86fc58e "\r") at interpret_functions.h:1236 #6 0x0809ee1b in o_catch (pc=0x8632d48 "! ¾-E\001e\035") at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2053 #7 0x0808e029 in eval_instruction_without_debug (pc=0x8632d44 "{") at interpret_functions.h:1236 #8 0x0809ec28 in mega_apply (type=145629520, args=145629520, arg1=0x8ae2150, arg2=0x8ae2150) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2012 #9 0x0809eee5 in f_call_function (args=145629520) at /home/david/current-projects/pike/Pike/7.6/src/interpret.c:2076 #10 0x08184044 in new_thread_func (data=0xbfffef70) at /home/david/current-projects/pike/Pike/7.6/src/threads.c:868 #11 0x4007ae51 in pthread_start_thread () from /lib/libpthread.so.0 ---Type <return> to continue, or q <return> to quit--- #12 0x4007aecf in pthread_start_thread_event () from /lib/libpthread.so.0 #13 0x401ca6ca in clone () from /lib/libc.so.6
/ David
/ Brevbäraren
pike-devel@lists.lysator.liu.se