Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Node
  3. Crash On Double Read Clock Object

Crash on double read Clock object

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

Profile picture for user Dmitry
By Dmitry , 9 September, 2021
Forums
Gurux.DLMS

Hi!
I write test program server side DLMS.cpp.
I created CGXDLMSClock object and add it to CGXDLMSObjectCollection.

Then i try read clock from DLMSDIrector. Read first time - ok, second time - my program crashed.

I think error in int CGXDLMSLNCommandHandler::HandleAccessRequest() method.

pointer *e allocates memory out of loop single time, push_back() to args several times (8 for clock) in loop and when function body ends destructor of CGXDLMSValueEventCollection several times delete memory of *e which allocated single time.

When i row
CGXDLMSValueEventArg* e = new CGXDLMSValueEventArg(server, NULL, 0);
moved to begin of loop - no crashes.
Am I right?

Tested on Linux Mint 20.2, 64 bit
Thanks!

Image
Profile picture for user Kurumi

Kurumi

5 years ago

Hi Dmitry,

Hi Dmitry,

Thank you for this info. I created a ticket from this and it's fixed today.
http://www.gurux.fi/node/19026

BR,
Mikko

Profile picture for user Dmitry

Dmitry

5 years ago

Thanks! It works after fixing

Thanks! It works after fixing.
By the way:
I found possible forgotten break key word in switch-case in methods:
int CGXDLMSCharge::SetValue(CGXDLMSSettings& settings, CGXDLMSValueEventArg& e);

int CGXDLMSSNCommandHandler::HandleWriteRequest(
CGXDLMSSettings& settings,
CGXDLMSServer* server,
CGXByteBuffer& data,
CGXByteBuffer* replyData,
CGXDLMSTranslatorStructure* xml,
unsigned char cipheredCommand)

Is it bugs?

Profile picture for user Kurumi

Kurumi

5 years ago

Hi,

Hi,

No one is not using that and it's not implemented because of that. Meter manufacturers are generally speaking moving from Short Name Referencing to Logical Name Referencing.

Services that can't be verified with the meter(s) are not usually implemented. There are features in DLMS that no one is using at the moment and those are not implemented if they are not used in any meter.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • Anaglyfos Trading CC
  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin