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. Forums
  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

4 years 9 months 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

4 years 9 months 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

4 years 9 months 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

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin