bug:Limited mods node def. 0.4 20120106-1 (beta patch provided)

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

bug:Limited mods node def. 0.4 20120106-1 (beta patch provided)

by redcrab » Sun Jan 08, 2012 21:02

After several test to make mesecons and seasons to be available on my server, I'm a bit confused with the issue.

There is no crash ,
I didn't see anything relevant on client and server sides...
the symptoms are :

Client didn't get any "Node definitions" and bad texture loading progress
screenshot from 20120102 but same with 20120106
Image
then the world is only made with "unknown blocks"
Image

Then to find out the issue I've reduced at minimum the Season mods with only
this init.lua code
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("seasons:treehead", {
    tile_images = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
    inventory_image = minetest.inventorycube("default_tree_top.png", "default_tree.png", "default_tree.png"),
    is_ground_content = true,
    material = minetest.digprop_woodlike(1.0),
    dug_item = 'node "tree" 1',
})


There is no issue !

I've replaced the code with the following
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("seasons:ice", {
    tile_images = {"seasons_ice.png"},
    inventory_image = minetest.inventorycube("seasons_ice.png"),
    is_ground_content = true,
    material = minetest.digprop_woodlike(1.0),
    dug_item = '',
})


There is no issue !
But if I combine these two register_node
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("seasons:treehead", {
    tile_images = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
    inventory_image = minetest.inventorycube("default_tree_top.png", "default_tree.png", "default_tree.png"),
    is_ground_content = true,
    material = minetest.digprop_woodlike(1.0),
    dug_item = 'node "tree" 1',
})

minetest.register_node("seasons:ice", {
    tile_images = {"seasons_ice.png"},
    inventory_image = minetest.inventorycube("seasons_ice.png"),
    is_ground_content = true,
    material = minetest.digprop_woodlike(1.0),
    dug_item = '',
})


The issue occurs ...
There is no crash nor assert()

So there is a limit somewhere , but what and where, and what can we do ?
Last edited by redcrab on Tue Jan 10, 2012 17:16, edited 1 time in total.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Mon Jan 09, 2012 15:54

Delete the debug.txt file and run the server and shut it down after after loading and check the debug.txt for errors. If you don't find any redo this with the client connecting and then check the debug.txt file again for errors.
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Mon Jan 09, 2012 19:43

as suggested by randomproof I 've made several execution and collect debug.txt
I collected debug when ok and collected debug when not ok (just one more node definition)

here my diagnostic..

As stated on my first post, no error no warning (differences between ok and not ok)

Then some differences:

When issue occurs
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
INFO[ServerThread]: Server::SendToolDef(): Sending tool definitions: size=1772
INFO[ServerThread]: Server::SendNodeDef(): Sending node definitions: size=100046
INFO[ServerThread]: Server::SendCraftItemDef(): Sending craft item definitions: size=5776


When ok (with one node less (smaller node definition size))
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
INFO[ServerThread]: Server::SendToolDef(): Sending tool definitions: size=1772
INFO[ServerThread]: Server::SendNodeDef(): Sending node definitions: size=99680
INFO[ServerThread]: Server::SendCraftItemDef(): Sending craft item definitions: size=5776




when ok this following line exist .. but no line alike exists when not ok.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
INFO[main]: Client: Received node definitions: packet size: 99680


I should expect one line with
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
INFO[main]: Client: Received node definitions: packet size: 100046


Node definition never sent data without doing any error ... or Node definition received but ignore it without any error ... and this only when packet size go over 100000 bytes ?

I suspect something around con::Connection::send(...) and makeSplitPacket but can't find out what... :(

Does somebody else get same behaviour ?
I don't know what to do next... I'm not a good troubleshooter and not a skilly programmer...
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Mon Jan 09, 2012 20:49

I think there is a packet size limit. Doing a quick search on 100000 found this, but I'm not sure this is where the problem is. The way that the server and clients communicate is very complex. So try increasing this number and see if that helps.

connection.cpp, line 669
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
// Receive packets from the network and buffers and create ConnectionEvents
void Connection::receive()
{
    u32 datasize = 100000;    <------  HERE
    // TODO: We can not know how many layers of header there are.
    // For now, just assume there are no other than the base headers.
    u32 packet_maxsize = datasize + BASE_HEADER_SIZE;     <------  HERE
    SharedBuffer<u8> packetdata(packet_maxsize);

    bool single_wait_done = false;
Last edited by randomproof on Mon Jan 09, 2012 20:51, edited 1 time in total.
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Mon Jan 09, 2012 22:33

Gotcha it works !

I've replaced
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
u32 datasize = 100000;


by
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
u32 datasize = 200000;  // I ve enough memory ;)



Don't know if this fix code should be integrated into mainstream (every body do not place so much mods ! and may have not so much memory resources)

But It could be cool if this size limit can be place inside minetest.con with a default at 100000
And also cool to make a assert with a message to say that a too big packet is dropped ..
"Too big packet 100042 > 100000 remove mods or change minetest.conf maxpacketsize parameter" something alike ;)
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Mon Jan 09, 2012 22:43

I think the networking code for minetest is way too complicated and needs a rewrite. Maybe I'll take a whack at it some time in the not so near future, but don't hold your breath.
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Mon Jan 09, 2012 23:14

I see that modification is mandatory not for the server but for the client ... So I can't say to my players it is fixed ... The good way is to wait an mainstream version of the client with the fix/rewrite...
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Tue Jan 10, 2012 17:13

just in case if celeron55 or major dev contributor would like to make available the patch to every body.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/src/connection.cpp b/src/connection.cpp
index b9c5d2a..b0a6faa 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -666,7 +666,7 @@ void Connection::send(float dtime)
 // Receive packets from the network and buffers and create ConnectionEvents
 void Connection::receive()
 {
-    u32 datasize = 100000;
+    u32 datasize = 200000;
     // TODO: We can not know how many layers of header there are.
     // For now, just assume there are no other than the base headers.
     u32 packet_maxsize = datasize + BASE_HEADER_SIZE;
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Wed Jan 11, 2012 08:05

thanks.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

kahrl
Member
 
Posts: 236
Joined: Fri Sep 02, 2011 07:51

by kahrl » Wed Jan 11, 2012 11:03

Doubling datasize is not a solution. You'll hit the same roadblock again after you double your number of mods.

Could you try the following?
* Set datasize to 1000. (Yes, the number of 0s on that is correct!)
* Comment out lines 857 to 859, it looks like that check is bogus.
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Wed Jan 11, 2012 12:16

awesome, your suggestion is nicer and it works !

this patch do not take account my previous patch (this patch have to be applied from mainstream git version)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
diff --git a/src/connection.cpp b/src/connection.cpp
index b9c5d2a..2c134b9 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -666,7 +666,7 @@ void Connection::send(float dtime)
 // Receive packets from the network and buffers and create ConnectionEvents
 void Connection::receive()
 {
-       u32 datasize = 100000;
+       u32 datasize = 1000;
        // TODO: We can not know how many layers of header there are.
        // For now, just assume there are no other than the base headers.
        u32 packet_maxsize = datasize + BASE_HEADER_SIZE;
@@ -854,9 +854,9 @@ void Connection::receive()
                        dout_con<<"ProcessPacket returned data of size "
                                        <<resultdata.getSize()<<std::endl;
                       
-                       if(datasize < resultdata.getSize())
-                               throw InvalidIncomingDataException
-                                               ("Buffer too small for received data");
+//             if(datasize < resultdata.getSize())
+//                             throw InvalidIncomingDataException
+//                                             ("Buffer too small for received data");
                       
                        ConnectionEvent e;
                        e.dataReceived(peer_id, resultdata);
Last edited by redcrab on Wed Jan 11, 2012 16:07, edited 1 time in total.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Wed Jan 11, 2012 15:32

It seems to me it would be easier to send the size of a packet as a 32 bit integer before sending the actual packet so you don't need a hard-coded receive size. There are so many send and receive functions, I'm not sure where best to do this, though.
Last edited by randomproof on Wed Jan 11, 2012 15:37, edited 1 time in total.
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Wed Jan 11, 2012 16:43

FYI, kahrl has a protocol-level fix for this in his itemdef patchset:
http://celeron.55.lt/~celeron55/minetest/wiki/doku.php?id=changes:itemdef:code (src/connection.cpp)
I haven't tested it, though.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sat Jan 14, 2012 05:03

set u32 datasize = 100000;
to u32 datasize = 900000;
:D
If you can think it, you can make it.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Sat Jan 14, 2012 16:02

jordan4ibanez wrote:set u32 datasize = 100000;
to u32 datasize = 900000;
:D


:O, thats got to be a lotta mods!

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Sat Jan 14, 2012 18:57

not really :P but i like to keep leeway incase i add a lot more..people who join my server only need to patch to 200000 though :)
If you can think it, you can make it.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 6 guests

cron