[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63622] jsonencode breaks down on (nested) emp

From: anonymous
Subject: [Octave-bug-tracker] [bug #63622] jsonencode breaks down on (nested) empty struct arrays
Date: Thu, 5 Jan 2023 17:13:35 -0500 (EST)


                 Summary: jsonencode breaks down on (nested) empty struct
                 Project: GNU Octave
               Submitter: None
               Submitted: Thu 05 Jan 2023 10:13:33 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: dennisvang
        Originator Email: 
             Open/Closed: Open
                 Release: 7.1.0
         Discussion Lock: Any
        Operating System: GNU/Linux
           Fixed Release: None
         Planned Release: None


Follow-up Comments:

Date: Thu 05 Jan 2023 10:13:33 PM UTC By: Anonymous

Example of invalid JSON (in this case using `--gui`):

>> x.y = struct('z', {});
>> jsonencode(x)
ans = {"y"}
>> jsondecode(jsonencode(x))
error: jsondecode: parse error at offset 5: Missing a colon after a name of
object member.

Example of crash:

GNU Octave, version 7.1.0
Octave was configured for "x86_64-pc-linux-gnu".

octave:1> x.y = struct('z', {});
octave:2> x.a = 1;
octave:3> jsonencode(x)
octave-gui: /usr/include/rapidjson/writer.h:448: void
rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding,
StackAllocator, writeFlags>::Prefix(rapidjson::Type) [with OutputStream =
rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding =
rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator =
rapidjson::CrtAllocator; unsigned int writeFlags = 2]: Assertion `type ==
kStringType' failed.
fatal: caught signal Aborted -- stopping myself...
Aborted (core dumped)

# My system
- OS: Ubuntu 22.04
- Octave version: Version 7.1.0
- Installation method: latest available snap


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]