Linked list with memory leak issues

The nodes seems to connect just fine until implementing my getName() function for variable assignment:

> *** Error in `./zBunny.exe': free(): invalid pointer: 0x00007f0e528dab78 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f0e5258d7e5] /lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f0e5259637a] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f0e5259a53c] ./zBunny.exe[0x4016e8] ./zBunny.exe[0x401ef2] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f0e52536830] ./zBunny.exe[0x401569] ======= Memory map: ======== 00400000-00404000 r-xp 00000000 08:10 33423400                           /media/keifer/Storage/cppProjects/examples/bunny/zBunny.exe 00604000-00605000 r--p 00004000 08:10 33423400                           /media/keifer/Storage/cppProjects/examples/bunny/zBunny.exe 00605000-00606000 rw-p 00005000 08:10 33423400                           /media/keifer/Storage/cppProjects/examples/bunny/zBunny.exe 01f52000-01f84000 rw-p 00000000 00:00 0                                  [heap] 7f0e4c000000-7f0e4c021000 rw-p 00000000 00:00 0  7f0e4c021000-7f0e50000000 ---p 00000000 00:00 0  7f0e5220d000-7f0e52315000 r-xp 00000000 fc:01 5509816                    /lib/x86_64-linux-gnu/libm-2.23.so 7f0e52315000-7f0e52514000 ---p 00108000 fc:01 5509816                    /lib/x86_64-linux-gnu/libm-2.23.so 7f0e52514000-7f0e52515000 r--p 00107000 fc:01 5509816                    /lib/x86_64-linux-gnu/libm-2.23.so 7f0e52515000-7f0e52516000 rw-p 00108000 fc:01 5509816                    /lib/x86_64-linux-gnu/libm-2.23.so 7f0e52516000-7f0e526d6000 r-xp 00000000 fc:01 5509806                    /lib/x86_64-linux-gnu/libc-2.23.so 7f0e526d6000-7f0e528d6000 ---p 001c0000 fc:01 5509806                    /lib/x86_64-linux-gnu/libc-2.23.so 7f0e528d6000-7f0e528da000 r--p 001c0000 fc:01 5509806                    /lib/x86_64-linux-gnu/libc-2.23.so 7f0e528da000-7f0e528dc000 rw-p 001c4000 fc:01 5509806                    /lib/x86_64-linux-gnu/libc-2.23.so 7f0e528dc000-7f0e528e0000 rw-p 00000000 00:00 0  7f0e528e0000-7f0e528f6000 r-xp 00000000 fc:01 5509743                    /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0e528f6000-7f0e52af5000 ---p 00016000 fc:01 5509743                    /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0e52af5000-7f0e52af6000 rw-p 00015000 fc:01 5509743                    /lib/x86_64-linux-gnu/libgcc_s.so.1 7f0e52af6000-7f0e52c68000 r-xp 00000000 fc:01 3670249                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f0e52c68000-7f0e52e68000 ---p 00172000 fc:01 3670249                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f0e52e68000-7f0e52e72000 r--p 00172000 fc:01 3670249                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f0e52e72000-7f0e52e74000 rw-p 0017c000 fc:01 3670249                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 7f0e52e74000-7f0e52e78000 rw-p 00000000 00:00 0  7f0e52e78000-7f0e52e9e000 r-xp 00000000 fc:01 5509685                    /lib/x86_64-linux-gnu/ld-2.23.so 7f0e53073000-7f0e53079000 rw-p 00000000 00:00 0  7f0e5309c000-7f0e5309d000 rw-p 00000000 00:00 0  7f0e5309d000-7f0e5309e000 r--p 00025000 fc:01 5509685                    /lib/x86_64-linux-gnu/ld-2.23.so 7f0e5309e000-7f0e5309f000 rw-p 00026000 fc:01 5509685                    /lib/x86_64-linux-gnu/ld-2.23.so 7f0e5309f000-7f0e530a0000 rw-p 00000000 00:00 0  7ffe1d800000-7ffe1d821000 rw-p 00000000 00:00 0                          [stack] 7ffe1d9b0000-7ffe1d9b2000 r--p 00000000 00:00 0                          [vvar] 7ffe1d9b2000-7ffe1d9b4000 r-xp 00000000 00:00 0                          [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall] Aborted 

This program is acting as a template for what will be a linked list of bunny objects with unique names and features.

    int Nodes::insert()     {         Node* new_node = (Node*) malloc(sizeof(Node));        new_node->name = getName();        new_node->prev = NULL;       new_node->next = head;        if (head != NULL)       {         head->prev = new_node;       }        head = new_node;        return 0;     } 

I’ve designed it so that ideally when a new node is made the each variable has relevant data assigned from a function call. For example:

new_node->name = getName(); 

In the instance of my memory issue the first node created runs fine but the second one produces the error at this^ function call assignment.

The full code:

#include<iostream> #include<fstream> #include<vector> #include<string>  using std::vector; using std::string; using std::cout; using std::endl;   class Node {     public:         int data;         string name;          Node* next;         Node* prev; };    class Nodes{     private:         Node* head = NULL;      public:         int insert();          void display();         int randomGen(int n);         string getName();         void extract(std::vector<string> *vect, string fileName);  };    void Nodes::display() {     Node* next = head;      while(next != NULL)     {         cout << next->name << '\n';         next = next->next;     }  }   int Nodes::insert() {     Node* new_node = (Node*) malloc(sizeof(Node));      new_node->name = getName();      new_node->prev = NULL;     new_node->next = head;      if (head != NULL)     {         head->prev = new_node;     }      head = new_node;      return 0; }   int Nodes::randomGen(int n)  {     srand((int)time(0));      return (rand() % n) + 1; }   // -- void Nodes::extract(vector<string> *vect, string fileName)//pulls lines from a file and splits the names up from each line using tokenization indexing them for use {      std::ifstream accessFile;     accessFile.open (fileName);      string pulledLine;      if (accessFile.is_open())     {          string extractedName;          getline(accessFile, pulledLine);          for(auto p: pulledLine)         {              if(p != ' ')             {                 if(extractedName != " ")                 {                                             extractedName += p;                 }                  else {                       extractedName = p;                  };              }              else {                  vect->push_back(extractedName);                 extractedName = " ";                                }         }      }  }  string Nodes::getName()//utilizes extract() to pull names and combines them using randomGen() to pull a name from a random index. {      std::vector<string> fNames = {" "};     std::vector<string> lNames = {" "};      const string fileName[2] = {"fnames.txt", "lnames.txt"};      extract(&fNames, fileName[0]);         extract(&lNames, fileName[1]);       /* original formula for pulling random names      string fullName = fNames[randomGen(sizeof(fNames))] + " " + lNames[randomGen(sizeof(lNames))];      */       //put here so I could focus on memory leak.     string fullName = "cjaz";         return fullName;    } // --  int main() {     Nodes control;     control.insert();     control.insert();     // control.insert();     // control.insert();      control.display();  } 

I’m looking to figure out the source of this memory issue and bring to light any bad practices or design flaws that I might be using.

Any and all feedBack is appreciated, Thank you!

Display issues using docking station Dell Universal 6000

I bought a Dell Universal 6000 docking station for my MacBook Pro 2018 to plug in 3 monitors via one Thunderbolt. The problem is that after installing DisplayLink drivers, only 2 displays are useable, both on DisplayPorts, but when I unplug one of them, the display on the HDMI port appears, so it seems like only two of them can be active at the same time. Some time ago when I was almost done fighting with it, I ran an update which popped up few days later and after that it started working. Yesterday I also ran some updates and have this issue again.

I have some suspicions that maybe this GateKeeper update is blocking it there.

Any help appreciated because after hours spent before computer I still cannot solve this issue.

Computer: MacBook Pro 2018

Docking station: Dell Universal 6000

macOS: Mojave 10.14.4

DisplayLink driver: 5.0 (also tried 5.1)

enter image description here

PiVPN setup issues

I’ve installed PiVPN per the instructions on their site. It’s a business connection (static IP) through a SmartHub (latest version). Per the instructions I’ve setup port forwarding in the routers firewall settings. I’ve also run PiVPN’s debug and can’t see any issues. However when connecting via OpenVPN (MacOS and iOS) I get the following error:

CONNECTION_TIMEOUT ERR

I assume this means the port forwarding isn’t working, however I’ve followed BT’s instructions and everything seems correct. I’ve also tried enabling the routers DMZ mode and tried port locking, but both had no impact.

Running the command

pivpn -d 

Creates the following log file:

::: ::: :: PiVPN Debug :: ::: ::: :: Latest Commit :: ::: ::: commit 4b4445b4667576f22a01af3dafbb4063218c964f Merge: bd6a1e1 b75b36f Author: james-lasersoft <37112079+james-lasersoft@users.noreply.github.com> Date: Wed Apr 10 22:23:03 2019 -0500

Merge pull request #716 from jamfrade/patch-1  Fix Easy-RSA install :::                  ::: ::  Recursive list of files in   :: ::  /etc/openvpn/easy-rsa/pki    :: :::                 ::: 

/etc/openvpn/easy-rsa/pki/: ca.crt crl.pem Default.txt ecparams extensions.temp index.txt index.txt.attr index.txt.attr.old index.txt.old issued OfficeVPN.ovpn openssl-easyrsa.cnf private renewed revoked safessl-easyrsa.cnf serial serial.old ta.key

/etc/openvpn/easy-rsa/pki/ecparams: prime256v1.pem

/etc/openvpn/easy-rsa/pki/issued: OfficeVPN.crt server_aLdaaHpdOCAmdyox.crt

/etc/openvpn/easy-rsa/pki/private: ca.key OfficeVPN.key server_aLdaaHpdOCAmdyox.key

/etc/openvpn/easy-rsa/pki/renewed: private_by_serial reqs_by_serial

/etc/openvpn/easy-rsa/pki/renewed/private_by_serial:

/etc/openvpn/easy-rsa/pki/renewed/reqs_by_serial:

/etc/openvpn/easy-rsa/pki/revoked: private_by_serial reqs_by_serial

/etc/openvpn/easy-rsa/pki/revoked/private_by_serial:

/etc/openvpn/easy-rsa/pki/revoked/reqs_by_serial: ::: ::: :: Output of /etc/pivpn/* :: ::: ::: :: START /etc/pivpn/DET_PLATFORM :: Raspbian :: END /etc/pivpn/DET_PLATFORM :: :: START /etc/pivpn/INSTALL_PORT :: 1194 :: END /etc/pivpn/INSTALL_PORT :: :: START /etc/pivpn/INSTALL_PROTO :: udp :: END /etc/pivpn/INSTALL_PROTO :: :: START /etc/pivpn/INSTALL_USER :: pi :: END /etc/pivpn/INSTALL_USER :: :: START /etc/pivpn/NO_UFW :: 1 :: END /etc/pivpn/NO_UFW :: :: START /etc/pivpn/pivpnINTERFACE :: wlan0 :: END /etc/pivpn/pivpnINTERFACE :: :: START /etc/pivpn/setupVars.conf :: pivpnUser=pi UNATTUPG=unattended-upgrades pivpnInterface=wlan0 IPv4dns=192.168.1.254 IPv4addr=192.168.1.69 IPv4gw=192.168.1.254 pivpnProto=udp PORT=1194 ENCRYPT=256 APPLY_TWO_POINT_FOUR=true DOWNLOAD_DH_PARAM=false PUBLICDNS= OVPNDNS1=8.8.8.8 OVPNDNS2=8.8.4.4 :: END /etc/pivpn/setupVars.conf :: :: START /etc/pivpn/TWO_POINT_FOUR :: :: END /etc/pivpn/TWO_POINT_FOUR :: ::: ::: :: /etc/openvpn/easy-rsa/pki/Default.txt :: ::: ::: client dev tun proto udp remote 81.133.250.129 1194 resolv-retry infinite nobind persist-key persist-tun remote-cert-tls server tls-version-min 1.2 verify-x509-name server_aLdaaHpdOCAmdyox name cipher AES-256-CBC auth SHA256 auth-nocache verb 3 ::: ::: :: Debug Output Complete :: ::: :::

To check if the ports are forwarding I’ve tried a range of port lookup sites like https://portchecker.co/check, however each reports port 1194 is closed. Not sure if this is reliable however as they also report port 80 is also closed.

Any advice to diagnose / fix issue would be greatly appreciated. The hardware is a Raspberry Pi 3, connecting via WiFi to the router.

Panel/Pop Up Notification issues after upgrading to Kubuntu 19.04

A little help please!

I just upgraded to Kubuntu 19.04 and am experiencing a little, albeit annoying, issue.

2 issues, actually.

1. When I first log in and am presented with the Kubuntu desktop I have to do a little adjusting to the panel (I have my desktop layed out with a panel at the top and Latte Dock at the bottom ala MacOS). The top panel appears 1/3 of the way down on the desktop. I have to right-click the panel to access the preferences and then move it back into position at the top of the screen. This happens everytime I login.

2. Pop up notifications are HUGE. And I mean they take up the whole screen. Whenever a song changes..BOOM! The whole screen is a notification that interrupts workflow. Very annoying! Even when adjusting the system volume on the panel using my mouse wheel the volume bar notification pop up takes up the entire screen. It used to be a nice small pop up in the middle of the screen as were all other notifications.

*******I must note that at times the pop ups do not take up the whole screen but rather appear 1/3 of the way down and span the width of the screen…about the same size as the Panel when I 1st login.

I can’t figure this out folks. I tried the Notification setting but nothing there as to size. At first I thought it might be an Accessibility setting but nothing there either. I am suspecting an issue with the Panel itself..although I have looked at the Panel Settings and have not found anything that could be the source.

Anyone have any ideas?

I Install WordPress, Setup Theme And Fix Any Wp Issues Or Errors for $10

Hi!! This is Rifat. Thanks for coming to my services. Here I am producing you High-End WordPress related services. My outstanding GIG services for you: # WordPress installation # WP theme setup# WP theme integration with demo data# Plugins setup# WP Site migration # Fix WP issues# Fix WP security issues# Fix WP errors# Fix WP HTML and CSS issues Why you hire me: # I am a professional WordPress expert# Quality and performance-based work is my first priority# Available at affordable prices# 24/7 customer support# Time on delivery# 100% money back guaranty Order me with confidence. Feel free to contact me, Please !! Send me the message before ordering. Thank you, Mohai menur Rifat Certified UI/UX designer and WordPress expert

by: MMRifat
Created: —
Category: WordPress
Viewed: 154


Libvirt network bridging issues

I want to set up a bridge so that guest VMs on my headless server use the LAN DHCP and not dnsmasq. I followed these instructions: https://jamielinux.com/docs/libvirt-networking-handbook/bridged-network.html#bridge-debian. Looking at the ifconfig results, it seems to give me exactly what I was looking for:

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.210  netmask 255.255.255.0  broadcast 192.168.1.255         inet6 fe80::4216:7eff:fe63:7516  prefixlen 64  scopeid 0x20<link>         ether 40:16:7e:63:75:16  txqueuelen 1000  (Ethernet)         RX packets 8255  bytes 653898 (653.8 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 633  bytes 60185 (60.1 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.195  netmask 255.255.255.0  broadcast 192.168.1.255         ether 40:16:7e:63:75:16  txqueuelen 1000  (Ethernet)         RX packets 42190  bytes 48646124 (48.6 MB)         RX errors 0  dropped 3  overruns 0  frame 0         TX packets 9808  bytes 889965 (889.9 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 1000  (Local Loopback)         RX packets 2215  bytes 510180 (510.1 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 2215  bytes 510180 (510.1 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255         ether 52:54:00:7a:ca:5e  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

However, if I try to SSH into my server (192.168.1.195) from another machine (192.168.1.196), I can’t connect. Pings from the server can’t seem to reach other devices on my LAN, but pings from the server to 8.8.8.8 seem to work OK. My /etc/network/interfaces file looks like the below (the MAC is my server’s NIC):

iface enp3s0 inet manual  auto br0 iface br0 inet static     # Use the MAC address identified above.     hwaddress ether 40:16:7e:63:75:16     address 192.168.1.210     netmask 255.255.255.0     gateway 192.168.1.1      bridge_ports enp3s0     # If you want to turn on Spanning Tree Protocol, ask your hosting     # provider first as it may conflict with their network.     bridge_stp on     # If STP is off, set to 0. If STP is on, set to 2 (or greater).     bridge_fd 0 

I’ve spent the last two days googling, and re-imaged my server a couple of times as well when things got too broken, and I think I’m just losing the plot… My server is Ubuntu 18.04.2, completely stock other than the libvirt and ssh packages installed. How can I get the server to be reachable by my other network machines?

Update Manager Issues regarding Google Earth

Any help regarding the following error would be greatly appreciated. I have tried some apt commands to clean it up but to no avail. I am running a Dell Latitude E6510 with LinuxM Mint 19. Thanks, in advance, for any assistance. John.

“An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/earth/deb stable Release: The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) Failed to fetch http://dl.google.com/linux/earth/deb/dists/stable/Release.gpg The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) Some index files failed to download. They have been ignored, or old ones used instead.”

Android Studio – Android SDK Missing and Connection Issues

I’m trying to install Android Studio at the moment, but get stuck at this error:

“Your Android SDK is missing, outdate or corrupted”

When opening the SDK Manager and going to the SDK Setup it shows the SDK as already being Installed, even though they don’t exist, and shows the standard file path (which also does not exist, and is not created when I click Next.)

Android SDK (Installed)

When I click continue I get the following message

“SDK is up to date Tools Directory is missing”

The whole directory in Appdate does not exist however, so there’s nothing to add the Tools directory to, either. I’ve already tried manually adding the SDK

SDK Manually added to appdata/Android/SDK/tools

in the standard folder but then I just get these error messages:

“Target folder is neither empty nor does it contain an SDK installation”

And if I try to continue it just shows

Android SDK is up to date

but still does not work, or detect the SDK in the folder.

I’m guessing it can’t download the SDK for the same reason I cannot check for updates, which just gives me a

Connection Failed

error message. I’m already running Android Studio as Admin, tried a fresh install, tried manually adding the SDK and tried updating with my firewall temporarily disabled, which just gives me the same error message. I’ve tried adding the path through Configure>Project Details>Project Structure but that just gets stuck on

“Checking Availability” “SDK does not contain any platforms”

I’m using Comodo for internet security and am on Windows 10. Any help would be greatly appreciated.

Get email notifications for pr’s and issues on my github repo

How can I get email notifications when somebody opens an issue on a repository I own ? I have a small open source plugin I manage, and when a user reports an issue, or send a PR, it’s important for me to be notified of it.

I can’t seem to find any setting that will allow me to setup an email for my repo. I am able to configure email notifications for existing issues, but this is not what I need.