Error when push Json Document

0 votes

Hi Every one,

I got this error when push a json doc. in Log cat i got this message :

"@@@ ABORTING: INVALID HEAP ADDRESS IN dlfree addr=0x519ce448 Fatal signa; 11 (SIGSEGV) at 0xdeadbad (code=1), thread 12697 (thread-2870)"

 

Any one know how to solve this problem ??

asked Feb 17, 2015 in App42 Cloud API-BaaS by imam_choy (12 points)
recategorized Mar 3, 2015 by sushil
.................

1 Answer

0 votes

Hey Imam, Please share some more details that will help us to trace out the exact problem, you are facing.

Please share which SDK you are using and also share more logs of application. You can enable App42 logs using

App42Log.setDebug(true);

Let me know if further query is concern.

Thanks

Vishnu

 

answered Feb 17, 2015 by Vishnu Garg (674 points)
I'm using Cocos2d-X v 3.2 and eclipse.
i got that error when i try to push my json data with a long string character data.
but when i push a short string character data, i didn't get any error.

Here is the JSON Data that i'm trying to push :

{
    "dataBarn":[{"kolom":28,"baris":25}],
    "dataBuilderHouse":[{"kolom":34,"baris":29}],
    "dataSilo":[{"kolom":27,"baris":34}],
    "soilSize":3,"dataSoil":[
        {"id":1,"kolom":33,"baris":26 },
        {"id":2,"kolom":32,"baris":25 },
        {"id":3,"kolom":31,"baris":24 }],
    "smallStoneSize":17,"smallStoneTotalSize":18,"smallStoneData":[
        {"id":100,"kolom":54,"baris":49, "exist":1 },
        {"id":101,"kolom":49,"baris":42, "exist":1 },
        {"id":102,"kolom":43,"baris":52, "exist":1 },
        {"id":103,"kolom":37,"baris":2, "exist":1 },
        {"id":104,"kolom":34,"baris":5, "exist":1 },
        {"id":105,"kolom":30,"baris":11, "exist":1 },
        {"id":106,"kolom":34,"baris":23, "exist":0 },
        {"id":107,"kolom":33,"baris":36, "exist":1 },
        {"id":108,"kolom":36,"baris":57, "exist":1 },
        {"id":109,"kolom":34,"baris":49, "exist":1 },
        {"id":110,"kolom":21,"baris":54, "exist":1 },
        {"id":111,"kolom":28,"baris":49, "exist":1 },
        {"id":112,"kolom":24,"baris":43, "exist":1 },
        {"id":113,"kolom":17,"baris":38, "exist":1 },
        {"id":114,"kolom":14,"baris":33, "exist":1 },
        {"id":115,"kolom":10,"baris":33, "exist":1 },
        {"id":116,"kolom":8,"baris":27, "exist":1 },
        {"id":117,"kolom":4,"baris":33, "exist":1 }],
    "mediumStoneSize":21,"mediumStoneTotalSize":21,"mediumStoneData":[
        {"id":200,"kolom":48,"baris":65, "exist":1 },
        {"id":201,"kolom":45,"baris":64, "exist":1 },
        {"id":202,"kolom":46,"baris":55, "exist":1 },
        {"id":203,"kolom":49,"baris":46, "exist":1 },
        {"id":204,"kolom":62,"baris":45, "exist":1 },
        {"id":205,"kolom":65,"baris":46, "exist":1 },
        {"id":206,"kolom":54,"baris":21, "exist":1 },
        {"id":207,"kolom":60,"baris":13, "exist":1 },
        {"id":208,"kolom":59,"baris":8, "exist":1 },
        {"id":209,"kolom":43,"baris":28, "exist":1 },
        {"id":210,"kolom":37,"baris":8, "exist":1 },
        {"id":211,"kolom":35,"baris":34, "exist":1 },
        {"id":212,"kolom":34,"baris":43, "exist":1 },
        {"id":213,"kolom":36,"baris":51, "exist":1 },
        {"id":214,"kolom":39,"baris":66, "exist":1 },
        {"id":215,"kolom":31,"baris":66, "exist":1 },
        {"id":216,"kolom":30,"baris":57, "exist":1 },
        {"id":217,"kolom":15,"baris":50, "exist":1 },
        {"id":218,"kolom":14,"baris":41, "exist":1 },
        {"id":219,"kolom":7,"baris":42, "exist":1 },
        {"id":220,"kolom":9,"baris":28, "exist":1 }],
    "bigStoneSize":9,"bigStoneTotalSize":9,"bigStoneData":[
        {"id":300,"kolom":59,"baris":18, "exist":1 },
        {"id":301,"kolom":50,"baris":11, "exist":1 },
        {"id":302,"kolom":77,"baris":24, "exist":1 },
        {"id":303,"kolom":70,"baris":29, "exist":1 },
        {"id":304,"kolom":64,"baris":25, "exist":1 },
        {"id":305,"kolom":66,"baris":51, "exist":1 },
        {"id":306,"kolom":53,"baris":50, "exist":1 },
        {"id":307,"kolom":46,"baris":67, "exist":1 },
        {"id":308,"kolom":31,"baris":48, "exist":1 }],
    "dataStorage":[{"kolom":23,"baris":30}],
    "smallTreeSize":26,"smallTreeTotalSize":28,"smallTreeData":[
        {"id":100,"kolom":49,"baris":70, "exist":1 },
        {"id":101,"kolom":44,"baris":59, "exist":1 },
        {"id":102,"kolom":42,"baris":45, "exist":1 },
        {"id":103,"kolom":36,"baris":61, "exist":1 },
        {"id":104,"kolom":62,"baris":53, "exist":1 },
        {"id":105,"kolom":70,"baris":41, "exist":1 },
        {"id":106,"kolom":67,"baris":28, "exist":1 },
        {"id":107,"kolom":67,"baris":20, "exist":1 },
        {"id":108,"kolom":47,"baris":16, "exist":1 },
        {"id":109,"kolom":39,"baris":20, "exist":1 },
        {"id":110,"kolom":39,"baris":6, "exist":1 },
        {"id":111,"kolom":31,"baris":4, "exist":1 },
        {"id":112,"kolom":36,"baris":3, "exist":1 },
        {"id":113,"kolom":33,"baris":8, "exist":1 },
        {"id":114,"kolom":33,"baris":14, "exist":0 },
        {"id":115,"kolom":30,"baris":15, "exist":0 },
        {"id":116,"kolom":34,"baris":37, "exist":1 },
        {"id":117,"kolom":29,"baris":42, "exist":1 },
        {"id":118,"kolom":28,"baris":53, "exist":1 },
        {"id":119,"kolom":24,"baris":57, "exist":1 },
        {"id":120,"kolom":23,"baris":50, "exist":1 },
        {"id":121,"kolom":22,"baris":43, "exist":1 },
        {"id":122,"kolom":17,"baris":42, "exist":1 },
        {"id":123,"kolom":5,"baris":34, "exist":1 },
        {"id":124,"kolom":12,"baris":35, "exist":1 },
        {"id":125,"kolom":12,"baris":29, "exist":1 },
        {"id":126,"kolom":8,"baris":31, "exist":1 },
        {"id":127,"kolom":6,"baris":27, "exist":1 }],
    "mediumTreeSize":26,"mediumTreeTotalSize":26,"mediumTreeData":[
        {"id":200,"kolom":50,"baris":49, "exist":1 },
        {"id":201,"kolom":68,"baris":45, "exist":1 },
        {"id":202,"kolom":68,"baris":35, "exist":1 },
        {"id":203,"kolom":63,"baris":18, "exist":1 },
        {"id":204,"kolom":51,"baris":16, "exist":1 },
        {"id":205,"kolom":51,"baris":32, "exist":1 },
        {"id":206,"kolom":52,"baris":41, "exist":1 },
        {"id":207,"kolom":53,"baris":56, "exist":1 },
        {"id":208,"kolom":49,"baris":58, "exist":1 },
        {"id":209,"kolom":44,"baris":73, "exist":1 },
        {"id":210,"kolom":42,"baris":63, "exist":1 },
        {"id":211,"kolom":34,"baris":53, "exist":1 },
        {"id":212,"kolom":37,"baris":42, "exist":1 },
        {"id":213,"kolom":40,"baris":31, "exist":1 },
        {"id":214,"kolom":45,"baris":20, "exist":1 },
        {"id":215,"kolom":43,"baris":12, "exist":1 },
        {"id":216,"kolom":42,"baris":1, "exist":1 },
        {"id":217,"kolom":38,"baris":11, "exist":1 },
        {"id":218,"kolom":27,"baris":8, "exist":1 },
        {"id":219,"kolom":35,"baris":66, "exist":1 },
        {"id":220,"kolom":32,"baris":59, "exist":1 },
        {"id":221,"kolom":27,"baris":58, "exist":1 },
        {"id":222,"kolom":21,"baris":56, "exist":1 },
        {"id":223,"kolom":18,"baris":47, "exist":1 },
        {"id":224,"kolom":9,"baris":34, "exist":1 },
        {"id":225,"kolom":2,"baris":31, "exist":1 }],
    "bigTreeSize":17,"bigTreeTotalSize":17,"bigTreeData":[
        {"id":300,"kolom":58,"baris":51, "exist":1 },
        {"id":301,"kolom":59,"baris":40, "exist":1 },
        {"id":302,"kolom":55,"baris":30, "exist":1 },
        {"id":303,"kolom":62,"baris":31, "exist":1 },
        {"id":304,"kolom":74,"baris":33, "exist":1 },
        {"id":305,"kolom":78,"baris":29, "exist":1 },
        {"id":306,"kolom":72,"baris":19, "exist":1 },
        {"id":307,"kolom":57,"baris":22, "exist":1 },
        {"id":308,"kolom":55,"baris":8, "exist":1 },
        {"id":309,"kolom":50,"baris":1, "exist":1 },
        {"id":310,"kolom":50,"baris":21, "exist":1 },
        {"id":311,"kolom":47,"baris":42, "exist":1 },
        {"id":312,"kolom":45,"baris":2, "exist":1 },
        {"id":313,"kolom":45,"baris":32, "exist":1 },
        {"id":314,"kolom":39,"baris":52, "exist":1 },
        {"id":315,"kolom":38,"baris":69, "exist":1 },
        {"id":316,"kolom":12,"baris":43, "exist":1 }],
    "dataWoodCutterHouse":[{"kolom":38,"baris":27}]
}
Can you please share exact code snippet that you are using.
I use this function to push the json data.

void UploadGameData::uploadFile(){

    App42API::Initialize(API_KEY, SECRET_KEY);
    App42API::setIsTraceEnabled(true);


    StorageService *storageService = App42API::BuildStorageService();

    App42API::setLoggedInUser("Imam");

    dbName = "gameData";
    collectionName = "gameProgress";
    docId = "";

    App42API::setDbName(dbName);

    std::string jsonData = "{\"dataBarn\":[{\"kolom\":28,\"baris\":25}],\"dataBuilderHouse\":[{\"kolom\":34,\"baris\":29}],\"dataSilo\":[{\"kolom\":27,\"baris\":34}],\"soilSize\":3,\"dataSoil\":[{\"id\":1,\"kolom\":33,\"baris\":26 },{\"id\":2,\"kolom\":32,\"baris\":25 },{\"id\":3,\"kolom\":31,\"baris\":24 }],\"smallStoneSize\":17,\"smallStoneTotalSize\":18,\"smallStoneData\":[{\"id\":100,\"kolom\":54,\"baris\":49, \"exist\":1 },{\"id\":101,\"kolom\":49,\"baris\":42, \"exist\":1 },{\"id\":102,\"kolom\":43,\"baris\":52, \"exist\":1 },{\"id\":103,\"kolom\":37,\"baris\":2, \"exist\":1 },{\"id\":104,\"kolom\":34,\"baris\":5, \"exist\":1 },{\"id\":105,\"kolom\":30,\"baris\":11, \"exist\":1 },{\"id\":106,\"kolom\":34,\"baris\":23, \"exist\":0 },{\"id\":107,\"kolom\":33,\"baris\":36, \"exist\":1 },{\"id\":108,\"kolom\":36,\"baris\":57, \"exist\":1 },{\"id\":109,\"kolom\":34,\"baris\":49, \"exist\":1 },{\"id\":110,\"kolom\":21,\"baris\":54, \"exist\":1 },{\"id\":111,\"kolom\":28,\"baris\":49, \"exist\":1 },{\"id\":112,\"kolom\":24,\"baris\":43, \"exist\":1 },{\"id\":113,\"kolom\":17,\"baris\":38, \"exist\":1 },{\"id\":114,\"kolom\":14,\"baris\":33, \"exist\":1 },{\"id\":115,\"kolom\":10,\"baris\":33, \"exist\":1 },{\"id\":116,\"kolom\":8,\"baris\":27, \"exist\":1 },{\"id\":117,\"kolom\":4,\"baris\":33, \"exist\":1 }],\"mediumStoneSize\":21,\"mediumStoneTotalSize\":21,\"mediumStoneData\":[{\"id\":200,\"kolom\":48,\"baris\":65, \"exist\":1 },{\"id\":201,\"kolom\":45,\"baris\":64, \"exist\":1 },{\"id\":202,\"kolom\":46,\"baris\":55, \"exist\":1 },{\"id\":203,\"kolom\":49,\"baris\":46, \"exist\":1 },{\"id\":204,\"kolom\":62,\"baris\":45, \"exist\":1 },{\"id\":205,\"kolom\":65,\"baris\":46, \"exist\":1 },{\"id\":206,\"kolom\":54,\"baris\":21, \"exist\":1 },{\"id\":207,\"kolom\":60,\"baris\":13, \"exist\":1 },{\"id\":208,\"kolom\":59,\"baris\":8, \"exist\":1 },{\"id\":209,\"kolom\":43,\"baris\":28, \"exist\":1 },{\"id\":210,\"kolom\":37,\"baris\":8, \"exist\":1 },{\"id\":211,\"kolom\":35,\"baris\":34, \"exist\":1 },{\"id\":212,\"kolom\":34,\"baris\":43, \"exist\":1 },{\"id\":213,\"kolom\":36,\"baris\":51, \"exist\":1 },{\"id\":214,\"kolom\":39,\"baris\":66, \"exist\":1 },{\"id\":215,\"kolom\":31,\"baris\":66, \"exist\":1 },{\"id\":216,\"kolom\":30,\"baris\":57, \"exist\":1 },{\"id\":217,\"kolom\":15,\"baris\":50, \"exist\":1 },{\"id\":218,\"kolom\":14,\"baris\":41, \"exist\":1 },{\"id\":219,\"kolom\":7,\"baris\":42, \"exist\":1 },{\"id\":220,\"kolom\":9,\"baris\":28, \"exist\":1 }],\"bigStoneSize\":9,\"bigStoneTotalSize\":9,\"bigStoneData\":[{\"id\":300,\"kolom\":59,\"baris\":18, \"exist\":1 },{\"id\":301,\"kolom\":50,\"baris\":11, \"exist\":1 },{\"id\":302,\"kolom\":77,\"baris\":24, \"exist\":1 },{\"id\":303,\"kolom\":70,\"baris\":29, \"exist\":1 },{\"id\":304,\"kolom\":64,\"baris\":25, \"exist\":1 },{\"id\":305,\"kolom\":66,\"baris\":51, \"exist\":1 },{\"id\":306,\"kolom\":53,\"baris\":50, \"exist\":1 },{\"id\":307,\"kolom\":46,\"baris\":67, \"exist\":1 },{\"id\":308,\"kolom\":31,\"baris\":48, \"exist\":1 }],\"dataStorage\":[{\"kolom\":23,\"baris\":30}],\"smallTreeSize\":26,\"smallTreeTotalSize\":28,\"smallTreeData\":[{\"id\":100,\"kolom\":49,\"baris\":70, \"exist\":1 },{\"id\":101,\"kolom\":44,\"baris\":59, \"exist\":1 },{\"id\":102,\"kolom\":42,\"baris\":45, \"exist\":1 },{\"id\":103,\"kolom\":36,\"baris\":61, \"exist\":1 },{\"id\":104,\"kolom\":62,\"baris\":53, \"exist\":1 },{\"id\":105,\"kolom\":70,\"baris\":41, \"exist\":1 },{\"id\":106,\"kolom\":67,\"baris\":28, \"exist\":1 },{\"id\":107,\"kolom\":67,\"baris\":20, \"exist\":1 },{\"id\":108,\"kolom\":47,\"baris\":16, \"exist\":1 },{\"id\":109,\"kolom\":39,\"baris\":20, \"exist\":1 },{\"id\":110,\"kolom\":39,\"baris\":6, \"exist\":1 },{\"id\":111,\"kolom\":31,\"baris\":4, \"exist\":1 },{\"id\":112,\"kolom\":36,\"baris\":3, \"exist\":1 },{\"id\":113,\"kolom\":33,\"baris\":8, \"exist\":1 },{\"id\":114,\"kolom\":33,\"baris\":14, \"exist\":0 },{\"id\":115,\"kolom\":30,\"baris\":15, \"exist\":0 },{\"id\":116,\"kolom\":34,\"baris\":37, \"exist\":1 },{\"id\":117,\"kolom\":29,\"baris\":42, \"exist\":1 },{\"id\":118,\"kolom\":28,\"baris\":53, \"exist\":1 },{\"id\":119,\"kolom\":24,\"baris\":57, \"exist\":1 },{\"id\":120,\"kolom\":23,\"baris\":50, \"exist\":1 },{\"id\":121,\"kolom\":22,\"baris\":43, \"exist\":1 },{\"id\":122,\"kolom\":17,\"baris\":42, \"exist\":1 },{\"id\":123,\"kolom\":5,\"baris\":34, \"exist\":1 },{\"id\":124,\"kolom\":12,\"baris\":35, \"exist\":1 },{\"id\":125,\"kolom\":12,\"baris\":29, \"exist\":1 },{\"id\":126,\"kolom\":8,\"baris\":31, \"exist\":1 },{\"id\":127,\"kolom\":6,\"baris\":27, \"exist\":1 }],\"mediumTreeSize\":26,\"mediumTreeTotalSize\":26,\"mediumTreeData\":[{\"id\":200,\"kolom\":50,\"baris\":49, \"exist\":1 },{\"id\":201,\"kolom\":68,\"baris\":45, \"exist\":1 },{\"id\":202,\"kolom\":68,\"baris\":35, \"exist\":1 },{\"id\":203,\"kolom\":63,\"baris\":18, \"exist\":1 },{\"id\":204,\"kolom\":51,\"baris\":16, \"exist\":1 },{\"id\":205,\"kolom\":51,\"baris\":32, \"exist\":1 },{\"id\":206,\"kolom\":52,\"baris\":41, \"exist\":1 },{\"id\":207,\"kolom\":53,\"baris\":56, \"exist\":1 },{\"id\":208,\"kolom\":49,\"baris\":58, \"exist\":1 },{\"id\":209,\"kolom\":44,\"baris\":73, \"exist\":1 },{\"id\":210,\"kolom\":42,\"baris\":63, \"exist\":1 },{\"id\":211,\"kolom\":34,\"baris\":53, \"exist\":1 },{\"id\":212,\"kolom\":37,\"baris\":42, \"exist\":1 },{\"id\":213,\"kolom\":40,\"baris\":31, \"exist\":1 },{\"id\":214,\"kolom\":45,\"baris\":20, \"exist\":1 },{\"id\":215,\"kolom\":43,\"baris\":12, \"exist\":1 },{\"id\":216,\"kolom\":42,\"baris\":1, \"exist\":1 },{\"id\":217,\"kolom\":38,\"baris\":11, \"exist\":1 },{\"id\":218,\"kolom\":27,\"baris\":8, \"exist\":1 },{\"id\":219,\"kolom\":35,\"baris\":66, \"exist\":1 },{\"id\":220,\"kolom\":32,\"baris\":59, \"exist\":1 },{\"id\":221,\"kolom\":27,\"baris\":58, \"exist\":1 },{\"id\":222,\"kolom\":21,\"baris\":56, \"exist\":1 },{\"id\":223,\"kolom\":18,\"baris\":47, \"exist\":1 },{\"id\":224,\"kolom\":9,\"baris\":34, \"exist\":1 },{\"id\":225,\"kolom\":2,\"baris\":31, \"exist\":1 }],\"bigTreeSize\":17,\"bigTreeTotalSize\":17,\"bigTreeData\":[{\"id\":300,\"kolom\":58,\"baris\":51, \"exist\":1 },{\"id\":301,\"kolom\":59,\"baris\":40, \"exist\":1 },{\"id\":302,\"kolom\":55,\"baris\":30, \"exist\":1 },{\"id\":303,\"kolom\":62,\"baris\":31, \"exist\":1 },{\"id\":304,\"kolom\":74,\"baris\":33, \"exist\":1 },{\"id\":305,\"kolom\":78,\"baris\":29, \"exist\":1 },{\"id\":306,\"kolom\":72,\"baris\":19, \"exist\":1 },{\"id\":307,\"kolom\":57,\"baris\":22, \"exist\":1 },{\"id\":308,\"kolom\":55,\"baris\":8, \"exist\":1 },{\"id\":309,\"kolom\":50,\"baris\":1, \"exist\":1 },{\"id\":310,\"kolom\":50,\"baris\":21, \"exist\":1 },{\"id\":311,\"kolom\":47,\"baris\":42, \"exist\":1 },{\"id\":312,\"kolom\":45,\"baris\":2, \"exist\":1 },{\"id\":313,\"kolom\":45,\"baris\":32, \"exist\":1 },{\"id\":314,\"kolom\":39,\"baris\":52, \"exist\":1 },{\"id\":315,\"kolom\":38,\"baris\":69, \"exist\":1 },{\"id\":316,\"kolom\":12,\"baris\":43, \"exist\":1 }],\"dataWoodCutterHouse\":[{\"kolom\":38,\"baris\":27}]}";
    storageService->InsertJsonDocument(dbName, collectionName, jsonData.c_str(), app42callback(UploadGameData::onRequestCompleted, this));


}


//----------------------------------------------------


that function running well if i change the json data become smaller data,
but it gives me error when i try to push all json data that i want to push, it confuses me.
As your Json data is too large so I suggest you to use upload Service to upload json file on AppHQ and store file URL in storage service.

Thanks
Vishnu
hmmm... can i edit/update the file if i use upload service just like the storage service??
I don't find the way to update file in upload service documentation. Can u give me suggestion? I will need to upload the file for game progress.

Thank's
If you want to edit or update Json, please insert small Json data as you said earlier its working and use "AddOrUpdateKeys" method to add or update more data in chunks.

Thanks
Vishnu
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...