IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Just starting out? Need help? Post your questions and find answers here.
User avatar
the.weavster
Addict
Addict
Posts: 1581
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by the.weavster »

MX Linux X86_64
PB 6.10 Beta 9

I'm getting an invalid memory access error here:

Code: Select all

Procedure.s _rpc_get_server_ip()
  Define.i IP
  Define.s ip$ = ""
  If ExamineIPAddresses(#PB_Network_IPv4)
    Repeat
      IP = NextIPAddress() ; *** Invalid Memory Access ***
      If IP : ip$ = IPString(IP) : EndIf
    Until IP = 0
  EndIf
  ProcedureReturn ip$
EndProcedure
Am I doing something wrong or is this a bug?
User avatar
blueb
Addict
Addict
Posts: 1118
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by blueb »

Just tried it using my VPN at 3 different locations...
10.17.18.78 Peru
10.10.18.236 Ecuador
10.14.18.206 Uruguay

everything seems fine.

Code: Select all

Procedure.s _rpc_get_server_ip()
  Define.i IP
  Define.s ip$ = ""
  If ExamineIPAddresses(#PB_Network_IPv4)
    Repeat
      IP = NextIPAddress() ; *** Invalid Memory Access ***
      If IP : ip$ = IPString(IP) : EndIf
    Until IP = 0
  EndIf
  ProcedureReturn ip$
EndProcedure
Debug _rpc_get_server_ip()

- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
the.weavster
Addict
Addict
Posts: 1581
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by the.weavster »

blueb wrote: Tue Mar 26, 2024 1:34 pm Just tried it using my VPN ...
Boom!
Thank you :D

I had a VPN App running on my PC, I shut that down and then the code works as expected.
User avatar
blueb
Addict
Addict
Posts: 1118
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by blueb »

That's odd.. shouldn't it work with your VPN running? :?:
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by Quin »

It should, unless your VPN was only assigning you an IP V6 address I think. Not sure why it'd do that, though.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by Tranquil »

I would think that this is a bug inside PB which maybe should be placed inside the Bug Section of this forum.

Anyway, a code snipping, that reproduces this behavior would be very useful.
Tranquil
User avatar
the.weavster
Addict
Addict
Posts: 1581
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by the.weavster »

Tranquil wrote: Wed Mar 27, 2024 6:28 am Anyway, a code snipping, that reproduces this behavior would be very useful.
The code snippet is in the first post but it only shows the behaviour if the VPN ( Private Internet Access ) app is running.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by Tranquil »

the.weavster wrote: Wed Mar 27, 2024 8:51 am
Tranquil wrote: Wed Mar 27, 2024 6:28 am Anyway, a code snipping, that reproduces this behavior would be very useful.
The code snippet is in the first post but it only shows the behaviour if the VPN ( Private Internet Access ) app is running.
There seems to be some specific network settings with your VPN.
The code you posted works fine for me in both cases:
-> Connected to VPN: Shows internal IPv4 (Using PulseSecure as VPN Client)
-> not Connected to VPN: Shows IPv4 of my network
Tranquil
User avatar
Kiffi
Addict
Addict
Posts: 1509
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by Kiffi »

Tranquil wrote: Wed Mar 27, 2024 8:59 amThe code you posted works fine for me in both cases:
-> Connected to VPN: Shows internal IPv4 (Using PulseSecure as VPN Client)
-> not Connected to VPN: Shows IPv4 of my network
same here.

// Edit: Sorry, I missed the Linux part. :oops:
Hygge
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: IMA error with ExamineIPAddresses(#PB_Network_IPv4)

Post by juergenkulow »

Which MX Linux version are you using?
What is rip, the instruction the rip points to, the registers and the stack at the IMA?
Is it an MX Linux or PureBasic problem?
Post Reply