munmap_chunk() : invalid pointer error in client server code

Hello, I am doing a project on client server using socket programming in c++ using aes encryption and generating shared key using deffi hellman algo (crpto++ lib) but i am getting the following error. I have mentioned the erorr in image below … if code is needed I wld send it
how to solve this errro? is there any problem in socket programming? bcz when i am running my encryption part its printing the values of plain and vipher text correctly until it is retures and used as input for decryption
CF
Cyber Forum207d ago
Post created!
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord 🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Forum Profile" role in <id:customize> ✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution (if you don't see the option, try refreshing Discord with Ctrl + R)
From An unknown user
D
DirtyJ207d ago
That looks like something is being freed that isn't free-able. I'd recommend setting up a debugger and stepping through there to see where exactly that's happening. Valgrind is a pretty good tool for that on Linux
T
tanlock207d ago
Yes i started de bugging in steps … checked the produced public keys and private keys and the shared key generated is the same … I then tried dubugging the aes encryption function and its giving an correct output to of cipher text but when cipher text is returned and used in decryption there is this error
T
tanlock207d ago
T
tanlock207d ago
For reference 😅
D
DirtyJ207d ago
If you have valgrind and GDB, you can remotely step through the code line by line until you hit the line that causes the error to occur https://valgrind.org/docs/manual/manual-core-adv.html
Valgrind
Official Home Page for valgrind, a suite of tools for debugging and profiling. Automatically detect memory management and threading bugs, and perform detailed profiling. The current stable version is valgrind-3.21.0.
T
tanlock207d ago
Oki wld try this first …
D
DirtyJ207d ago
Currently not at my PC, but I'll take a closer look tomorrow morning if you haven't figured it out by then
T
tanlock205d ago
Yes thankyou ✌️🫡 Hey have you found any solution to the error??
D
DirtyJ205d ago
Hey, didn't have a chance to check it out yesterday. Going to look after a meeting today I'm not seeing anything specific from scanning through that code that would cause it. Unless the socket is being closed twice or there's something weird happening to the server reference after it's typecasted and sent to connect(). Setting up a debugger and stepping through that logic is the best bet for finding the exact line/behavior that caused it without getting too much of a headache trying to figure it out in your head
T
tanlock205d ago
I know basic multithread client server programming and was trying to mix it up encryption and key generation … so you are saying there some problem in my socket programming part right? There is some problem*
D
DirtyJ205d ago
Could be, or it could be the way things are being handed to some of the functions being used. For example, if you hand something over to another function and it's freed in there, freeing it again will result in an error. Stepping through it will show you exactly where that's occurring
T
tanlock205d ago
Okay wld check that and ask if you if I am facing any problems further
More Posts
DJVU RansomHello, I am having a really big problem, yesterday my PC got hacked and all of my files have been enResolve /app in Flatpak's /proc/<pid/mapsHello, guys. I really need some help here, I have asked this in so many places and have never gottenvirus not getting detected svchost.exe filei have a virus on my computer, its not getting detected by Kaspersky, windows defender or virustotalHello everyoneI need access to a bot's steam accountSnort Struggles: How to detect the FTP service name?I am muddling through learning Snort and feeling a bit daft. I'm trying to write a rule that allows Hi there, I am having an issue with my instagram account, its hacked. can you help with this.Hi there, I am here to bring this into your notice that my account is hacked few days ago. i can't rNeed some help answering this questionI have answered it but It's mostly wrong im pretty sure would just appreciate someone to help me outIdk if im wording this right.I was wondering if someone could kinda guide or teach me a little about code stuff. Maybe just enoughow to set up a proxy?So im living here in Delhi, India and I have wifi connection in Mumbai, india how can I use that wifNeed help choosing what to do for my future in cybersecurity (PLEASE READ)Im a full time college student getting my bachelors in IT and cyber , i do 40 hrs a week in college,hello i'm violet how can i learn cybersequrityEthical Hacking ReportI want someone to look through this please and give me suggests on improvementsI wanna learn ethical hackingHi, i cant disclose my name because i dont want to but you can refer me as unknown. I have some knowwanting to learn Cyber securityHI my name is sal, and i wanted to ask if any know someone and is a mentor on teaching me cyber secuAdvices on data confidentiality & treatment in Management System Tool of corporationManagement System Tool is basically covered with the documents of transactions, initiatives, and sugOSI Model Layers QuestionSo I mostly get the OSI model I understand the basics of, for isntance, FTP, HTTP, DNS, TCP/IP, etc.career questionHello, maybe this is not the appropriate topic to ask on the server, I'm sorry in advance but I needAbout hackingI have done all the things at own but, i am not able to figure it out to how i can gear up my skill Need help with nwfilter part of libvirt VM packageI'm really bad at subnetting i think i overwrote 255.255.0.0 with 255.255.255.0, i'm a bit confused my rockstar games account has been hackedbasically my rockstar account has been hacked, found out when i went to buy red dead redemption agai