View Issue Details

IDProjectCategoryView StatusLast Update
0000391LDMud 3.3Runtimepublic2005-11-24 15:32
Reportermalraux2 Assigned Tolars 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version3.3 
Fixed in Version3.3 
Summary0000391: Passing array of prepositions for %p in parse_command causes segfault
Description    object item1;
    mixed *item2;
    string *prep = ({ "behind", "within" });
    int z = parse_command("red zarm behind second fluffy zarm", all_inventory(this_body()), "%o %p %i", item1, prep, item2);
    printf("z: %O item1: %O item2: %O\n", z, item1, item2);


At this point the inventory contains two objects that answer to "red fluffy zarm". Executing this code causes a segfault. Passing a string var for 'prep' instead of a string array allows the efun to work as advertised, using the preposition list from master.c.
TagsNo tags attached.

Activities

malraux2

2005-06-05 15:25

reporter   ~0000373

The full stack trace:


2005.06.05 16:10:01 (free_svalue) Illegal svalue 0x82be768 type 16
2005.06.05 16:10:01 Current object was cmds/builder/_zarm
secure/simul_efun secure/simul_efun.c line 229
831b9b3: 124 5 push_local_variable_lvalue (1: 36) line 229
831b9b5: 42 (void)= (2: 37)
831b9b6: 15 const0 (0: 35) line 230
831b9b7: 124 3 push_local_variable_lvalue (1: 36)
831b9b9: 42 (void)= (2: 37)
831b9ba: 106 branch (0: 35)
831b9cf: 31 3 local (0: 35)
831b9d1: 31 5 local (1: 36)
831b9d3: 50 < (2: 37)
831b9d4: 110 bbranch_when_non_zero (1: 36)
831b9bc: 31 2 local (0: 35) line 232
831b9be: 31 3 local (1: 36)
831b9c0: 185 no_warn_deprecated (2: 37)
831b9c1: 62 index (2: 37)
831b9c2: 10 26 cstring0 (1: 36)
831b9c4: 53 != (2: 37)
831b9c5: 107 branch_when_zero (1: 36)
831b9cc: 124 3 push_local_variable_lvalue (0: 35) line 230
831b9ce: 33 ++ (1: 36)
831b9cf: 31 3 local (0: 35)
831b9d1: 31 5 local (1: 36)
831b9d3: 50 < (2: 37)
831b9d4: 110 bbranch_when_non_zero (1: 36)
831b9bc: 31 2 local (0: 35) line 232
831b9be: 31 3 local (1: 36)
831b9c0: 185 no_warn_deprecated (2: 37)
831b9c1: 62 index (2: 37)
831b9c2: 10 26 cstring0 (1: 36)
831b9c4: 53 != (2: 37)
831b9c5: 107 5 branch_when_zero (1: 36)
831b9c7: 102 fbranch (0: 35) line 233
831b9d6: 31 5 local (0: 35) line 236
831b9d8: 16 const1 (1: 36)
831b9d9: 48 > (2: 37)
831b9da: 39 8 && (1: 36)
831b9dc: 31 2 local (0: 35)
831b9de: 16 const1 (1: 36)
831b9df: 185 no_warn_deprecated (2: 37)
831b9e0: 63 rindex (2: 37)
831b9e1: 10 26 cstring0 (1: 36)
831b9e3: 52 == (2: 37)
831b9e4: 107 branch_when_zero (1: 36)
831b9f0: 31 5 local (0: 35) line 242
831b9f2: 16 const1 (1: 36)
831b9f3: 44 - (2: 37)
831b9f4: 124 4 push_local_variable_lvalue (1: 36)
831b9f6: 42 (void)= (2: 37)
831b9f7: 31 2 local (0: 35) line 245
831b9f9: 31 3 local (1: 36)
831b9fb: 31 4 local (2: 37)
831b9fd: 67 .. (3: 38)
831b9fe: 24 return (1: 36)
secure/daemons/termd secure/daemons/termd.c line 91
83dac19: 124 2 push_local_variable_lvalue (1: 30) line 91
83dac1b: 42 (void)= (2: 31)
83dac1c: 10 3 cstring0 (0: 29) line 93
83dac1e: 124 0 push_local_variable_lvalue (1: 30)
83dac20: 42 (void)= (2: 31)
83dac21: 97 259 clear_locals (0: 29) line 94
83dac24: 124 3 push_local_variable_lvalue (0: 29)
83dac26: 31 2 local (1: 30)
83dac28: 176 foreach (2: 31)
83dac59: 179 foreach_next (0: 33) line 105
83dac2c: 31 3 local (0: 33) line 95
83dac2e: 203 strlen (1: 34)
83dac2f: 18 2 clit (1: 34)
83dac31: 48 > (2: 35)
83dac32: 107 24 branch_when_zero (1: 34)
83dac34: 98 save_arg_frame (0: 33) line 97
83dac35: 31 3 local (1: 34)
83dac37: 15 const0 (2: 35)
83dac38: 18 2 clit (3: 36)
83dac3a: 67 .. (4: 37)
83dac3b: 31 1 local (2: 35)
83dac3d: 111 call_function (3: 36)
83daa5a: 97 258 clear_locals (0: 38) line 23
83daa5d: 31 0 local (0: 38) line 25
83daa5f: 203 strlen (1: 39)
83daa60: 18 3 clit (1: 39)
83daa62: 53 != (2: 40)
83daa63: 107 branch_when_zero (1: 39)
83daa6b: 31 0 local (0: 38) line 27
83daa6d: 10 1 cstring0 (1: 39)
83daa6f: 52 == (2: 40)
83daa70: 107 12 branch_when_zero (1: 39)
83daa72: 31 1 local (0: 38) line 29
83daa74: 16 const1 (1: 39)
83daa75: 55 & (2: 40)
83daa76: 107 402786819 branch_when_zero (1: 39)
83daa7b: 10 3 cstring0 (0: 38) line 31
83daa7d: 24 return (1: 39)
83dac40: 99 restore_arg_frame (2: 35) line 97
83dac41: 31 3 local (1: 34)
83dac43: 18 3 clit (2: 35)
83dac45: 76 nx_range (3: 36)
83dac46: 43 + (2: 35)
83dac47: 124 3 push_local_variable_lvalue (1: 34)
83dac49: 42 (void)= (2: 35)
83dac4a: 106 branch (0: 33) line 99
83dac54: 31 3 local (0: 33) line 104
83dac56: 124 0 push_local_variable_lvalue (1: 34)
83dac58: 79 (void)+= (2: 35)
83dac59: 179 48 foreach_next (0: 33) line 105
83dac5c: 180 foreach_end (0: 33)
83dac5d: 31 1 local (0: 29) line 107
83dac5f: 16 const1 (1: 30)
83dac60: 55 & (2: 31)
83dac61: 107 branch_when_zero (1: 30)
83dac68: 31 0 local (0: 29) line 109
83dac6a: 24 return (1: 30)
secure/simul_efun secure/simul_efun.c line 1053
831c848: 99 restore_arg_frame (2: 24) line 1053
831c849: 124 1 push_local_variable_lvalue (1: 23)
831c84b: 42 (void)= (2: 24)
831c84c: 31 0 local (0: 22) line 1056
831c84e: 31 1 local (1: 23)
831c850: 380 47 tell_object (2: 24)
831c852: 25 return0 (0: 22) line 1058
secure/body#2 secure/body.c line 501
83d611c: 93 pop_value (1: 20) line 501
83d611d: 25 return0 (0: 19) line 503
secure/simul_efun secure/simul_efun.c line 218
831b988: 25 return0 (0: 16) line 218
cmds/builder/_zarm cmds/builder/_zarm.c line 12
8370aa6: 93 pop_value (1: 15) line 12
8370aa7: 97 1025 clear_locals (0: 14) line 14
8370aaa: 10 5 cstring0 (0: 14) line 16
8370aac: 10 6 cstring0 (1: 15)
8370aae: 167 2 aggregate (2: 16)
8370ab1: 124 3 push_local_variable_lvalue (1: 15)
8370ab3: 42 (void)= (2: 16)
8370ab4: 10 7 cstring0 (0: 14) line 17
8370ab6: 166 simul_efun (1: 15)
secure/simul_efun secure/simul_efun.c line 183
831b8e6: 97 256 clear_locals (0: 16) line 183
831b8e9: 208 this_player (0: 16)
831b8ea: 124 0 push_local_variable_lvalue (1: 17)
831b8ec: 42 (void)= (2: 18)
831b8ed: 98 save_arg_frame (0: 16) line 185
831b8ee: 31 0 local (1: 17)
831b8f0: 10 22 cstring0 (2: 18)
831b8f2: 188 call_other (3: 19)
secure/builder#1 secure/user.c line 25
83c2a5e: 8 33 identifier (0: 19) line 25
83c2a60: 24 return (1: 20)
secure/simul_efun secure/simul_efun.c line 185
831b8f3: 99 restore_arg_frame (2: 18) line 185
831b8f4: 107 8 branch_when_zero (1: 17)
831b8f6: 98 save_arg_frame (0: 16) line 187
831b8f7: 31 0 local (1: 17)
831b8f9: 10 22 cstring0 (2: 18)
831b8fb: 188 call_other (3: 19)
secure/builder#1 secure/user.c line 25
83c2a5e: 8 33 identifier (0: 19) line 25
83c2a60: 24 return (1: 20)
secure/simul_efun secure/simul_efun.c line 187
831b8fc: 99 restore_arg_frame (2: 18) line 187
831b8fd: 24 return (1: 17)
cmds/builder/_zarm cmds/builder/_zarm.c line 17
8370ab8: 231 2 all_inventory (2: 16) line 17
8370aba: 10 8 cstring0 (2: 16)
8370abc: 124 1 push_local_variable_lvalue (3: 17)
8370abe: 124 3 push_local_variable_lvalue (4: 18)
8370ac0: 124 2 push_local_variable_lvalue (5: 19)
8370ac2: 30 parse_command (6: 20)
secure/master secure/master.c line 558
831fb46: 10 64 cstring0 (0: 21) line 558
831fb48: 10 65 cstring0 (1: 22)
831fb4a: 167 2 aggregate (2: 23)
831fb4d: 24 return (1: 22)
831fb5e: 10 66 cstring0 (0: 21) line 563
831fb60: 10 67 cstring0 (1: 22)
831fb62: 10 68 cstring0 (2: 23)
831fb64: 167 3 aggregate (3: 24)
831fb67: 24 return (1: 22)
831fb7a: 10 69 cstring0 (0: 21) line 568
831fb7c: 167 1 aggregate (1: 22)
831fb7f: 24 return (1: 22)
831fb92: 10 70 cstring0 (0: 21) line 573
831fb94: 10 71 cstring0 (1: 22)
831fb96: 10 72 cstring0 (2: 23)
831fb98: 10 73 cstring0 (3: 24)
831fb9a: 10 74 cstring0 (4: 25)
831fb9c: 167 5 aggregate (5: 26)
831fb9f: 24 return (1: 22)
831fbb2: 10 75 cstring0 (0: 21) line 578
831fbb4: 24 return (1: 22)
players/malraux/obj/zarm#4 inherits/object/description.c line 93
837ee5e: 8 7 identifier (0: 21) line 93
837ee60: 24 return (1: 22)
837edc6: 8 6 identifier (0: 21) line 58
837edc8: 24 return (1: 22)
837eec6: 8 8 identifier (0: 21) line 111
837eec8: 24 return (1: 22)
players/malraux/obj/zarm#3 inherits/object/description.c line 93
837ee5e: 8 7 identifier (0: 21) line 93
837ee60: 24 return (1: 22)
837edc6: 8 6 identifier (0: 21) line 58
837edc8: 24 return (1: 22)
837eec6: 8 8 identifier (0: 21) line 111
837eec8: 24 return (1: 22)
cmds/builder/_zarm cmds/builder/_zarm.c line 17
8370ac4: 124 4 push_local_variable_lvalue (1: 15) line 17
8370ac6: 42 (void)= (2: 16)
8370ac7: 98 save_arg_frame (0: 14) line 18
8370ac8: 10 9 cstring0 (1: 15)
8370aca: 31 4 local (2: 16)
8370acc: 31 1 local (3: 17)
8370ace: 31 2 local (4: 18)
8370ad0: 440 42 printf (5: 19)
8370ad2: 15 const0 (1: 15)
8370ad3: 99 restore_arg_frame (2: 16)
8370ad4: 93 pop_value (1: 15)
8370ad5: 16 const1 (0: 14) line 19
8370ad6: 24 return (1: 15)
8370ad7: 26 0 0 1 0 12 0 0
' do_command' in 'secure/user/commands.c' (' secure/builder#1') line 84
'internal_do_command' in 'secure/user/commands.c' (' secure/builder#1') line 63
' do_command' in 'cmds/builder/_zarm.c' (' cmds/builder/_zarm') line 19
2005.06.05 16:10:01 LDMud aborting on fatal error.
Floating point exception

lars

2005-06-19 23:07

reporter   ~0000376

I think I solved this problem in 3.3.708: there was a ref mis-counting when using your own preposition arrays.

Issue History

Date Modified Username Field Change
2005-06-05 15:23 malraux2 New Issue
2005-06-05 15:25 malraux2 Note Added: 0000373
2005-06-19 23:07 lars Status new => resolved
2005-06-19 23:07 lars Fixed in Version => 3.3
2005-06-19 23:07 lars Resolution open => fixed
2005-06-19 23:07 lars Assigned To => lars
2005-06-19 23:07 lars Note Added: 0000376
2005-11-24 15:32 lars Status resolved => closed