OpenAPITools / OpenAPITools/openapi-generator

Crash happened for attribute of type integer with value 0 in REST C Client code generated by OpenApiTool

Open
#14,224 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f84247cdbf0 in __GI___nanosleep (requested_time=0x7ffe3c376990, remaining=0x0)
at ../sysdeps/unix/sysv/linux/nanosleep.c:28
28 ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
(gdb) c
Continuing.

Thread 3 "netopeer2-serve" received signal SIGABRT, Aborted.
[Switching to Thread 0x7f841c3a5700 (LWP 29368)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f841e347535 in __GI_abort () at abort.c:79
#2 0x00007f841e39e508 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f841e4a928d "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007f841e3a4c1a in malloc_printerr (str=str@entry=0x7f841e4aabf8 "munmap_chunk(): invalid pointer")
at malloc.c:5341
#4 0x00007f841e3a5184 in munmap_chunk (p=) at malloc.c:2830
#5 0x00007f841ec481ba in OpenconfigInterfacesAPI_deleteOpenconfigInterfacesInterfacesInterfaceSubinterfacesSubinterface (apiClient=0x7f8400001c60, name=0x7f840c000b20 "Ethernet120", index=0)
at /home/arpit/sonic/rest_base_6_2_0/rest_client_c/api/OpenconfigInterfacesAPI.c:18858
#6 0x00007f841ed477c0 in restc_delete_openconfig_interfaces_interface_subinterfaces_subinterface (
name=0x7f840c000b20 "Ethernet120", index=0)
at /home/arpit/sonic/rest_base_6_2_0/rest_client_c/api/OpenconfigInterfacesWrapperAPI.c:326
#7 0x000055a840c1d552 in np2srv_openconfig_interfaces_interfaces_interface_subinterfaces_subinterface_cb (
session=0x7f8400005b50, UNUSED_sub_id=29, UNUSED_module_name=0x55a8427b8a90 "openconfig-interfaces",
xpath=0x55a8427b7a40 "/openconfig-interfaces:interfaces/interface/subinterfaces/subinterface",
UNUSED_event=SR_EV_DONE, UNUSED_request_id=3, UNUSED_private_data=0x0)
at /home/arpit/sonic/update_netconf_server/netopeer2/src/netconf_openconfig_interfaces.c:277
#8 0x00007f841f68820a in sr_shmsub_change_listen_process_module_events (change_subs=0x55a8427fa170,
conn=0x55a842424cc0) at /home/arpit/sonic/update_netconf_server/sysrepo/src/shm_sub.c:3069
#9 0x00007f841f6430c3 in sr_subscription_process_events (subscription=0x55a842433290, session=0x0,
wake_up_in=0x7f841c3a4ad0) at /home/arpit/sonic/update_netconf_server/sysrepo/src/sysrepo.c:4286
#10 0x00007f841f68bb24 in sr_shmsub_listen_thread (arg=0x55a842433290)
at /home/arpit/sonic/update_netconf_server/sysrepo/src/shm_sub.c:4512
#11 0x00007f84247c3fa3 in start_thread (arg=) at pthread_create.c:486

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OpenconfigInterfacesAPI.c at OpenconfigInterfacesAPI_deleteOpenconfigInterfacesInterfacesInterfaceSubinterfacesSubinterface, then inspect the wrapper in OpenconfigInterfacesWrapperAPI.c and the callback in netconf_openconfig_interfaces.c. Reproduce the delete operation with index=0 and determine what causes the invalid-pointer abort; done means the generated REST C client completes this operation without crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, openapi
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.