Hi
I've installed it, and have some segmentation faults
I've read this post:
https://www.gammon.com.au/forum/?id=12367
And it needs to change the malloc calls, but i can't figured how to make it work
here is the snippet:
https://github.com/Xavious/MSDP_Protocol_Handler
i get this errors:
i've changed this:
Line 294:
from
to
Line 318:
from
to
Line 322:
from
to
I get no errors when compiling, but when i run the mud and try to enter at the login prompt i get a segmentation fault, using gdb the error seems when pProtocol->pVariables is going to be used
gdb:
line 2031 in protocol.c:
Any one have installed this snipping and make it working?
Thanks
I've installed it, and have some segmentation faults
I've read this post:
https://www.gammon.com.au/forum/?id=12367
And it needs to change the malloc calls, but i can't figured how to make it work
here is the snippet:
https://github.com/Xavious/MSDP_Protocol_Handler
i get this errors:
make -s smaug
Compiling o/protocol.o....
protocol.c: In function protocol_t* ProtocolCreate():
protocol.c:294:22: error: invalid conversion from void* to protocol_t* [-fpermissive]
pProtocol = malloc(sizeof(protocol_t));
~~~~~~^~~~~~~~~~~~~~~~~~~~
protocol.c:318:34: error: invalid conversion from void* to MSDP_t** [-fpermissive]
pProtocol->pVariables = malloc(sizeof(MSDP_t*)*eMSDP_MAX);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
protocol.c:322:40: error: invalid conversion from void* to MSDP_t* [-fpermissive]
pProtocol->pVariables[i] = malloc(sizeof(MSDP_t));
~~~~~~^~~~~~~~~~~~~~~~
make[1]: *** [Makefile:106: o/protocol.o] Error 1
make: *** [Makefile:49: all] Error 2i've changed this:
Line 294:
from
pProtocol = malloc(sizeof(protocol_t));to
pProtocol = new protocol_t[sizeof(protocol_t)];Line 318:
from
pProtocol->pVariables = malloc(sizeof(MSDP_t*)*eMSDP_MAX);to
pProtocol->pVariables = new MSDP_t*[eMSDP_MAX * sizeof(MSDP_t)];Line 322:
from
pProtocol->pVariables[i] = malloc(sizeof(MSDP_t));to
pProtocol->pVariables[i] = new MSDP_t[sizeof(MSDP_t)];I get no errors when compiling, but when i run the mud and try to enter at the login prompt i get a segmentation fault, using gdb the error seems when pProtocol->pVariables is going to be used
gdb:
#0 __GI_strcmp (p1=0x0, p2=0x1c4cfc "Unknown") at strcmp.c:38
#1 0x0019b138 in PerformSubnegotiation (aSize=<optimized out>,
apData=0x57dadd <ProtocolInput(descriptor_data*, char*, int, char*)::IacBuf+1> "",
aCmd=<optimized out>, apDescriptor=0x755f7974) at protocol.c:2031
#2 ProtocolInput (apDescriptor=0x755f7974, apDescriptor@entry=0x1780408,
apData=apData@entry=0x24f494 <read_from_descriptor(descriptor_data*)::read_buf> "\377\372\030",
aSize=aSize@entry=41, apOut=0x7265646e <error: Cannot access memory at address 0x7265646e>,
apOut@entry=0x178043d "") at protocol.c:399
#3 0x000af570 in read_from_descriptor (d=d@entry=0x1780408) at comm.c:1442
#4 0x000b6190 in game_loop () at comm.c:870
#5 0x000b69a4 in main (argc=2, argv=0x7e813234) at comm.c:578line 2031 in protocol.c:
if ( !strcmp(pProtocol->pVariables[eMSDP_CLIENT_ID]->pValueString, "Unknown") )Any one have installed this snipping and make it working?
Thanks