Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV in function Ethernet_sendPacket #86

Open
fouzhe opened this issue Nov 8, 2018 · 1 comment
Open

SEGV in function Ethernet_sendPacket #86

fouzhe opened this issue Nov 8, 2018 · 1 comment

Comments

@fouzhe
Copy link

fouzhe commented Nov 8, 2018

I built libiec61850 in macOS 10.12.6 with AddressSanitizer(export CFLAGS="-g -fsanitize=address" CXXFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address" before make).

I ran the sv_publisher in directory libiec61850/examples/sv_publisher by command sudo ./sv_publisher, however, there is a SEGV in function Ethernet_sendPacket in ethernet_bsd.c when the selected interface is unable.

Here is output with ASAN information:

Using interface eth0
Could not find the network interface eth0!Unable to select interface eth0!
ASAN:DEADLYSIGNAL
=================================================================
==77056==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0x0004e3bd bp 0xbffe6a18 sp 0xbffe69e0 T0)
==77056==The signal is caused by a READ memory access.
==77056==Hint: address points to the zero page.
    #0 0x4e3bc in Ethernet_sendPacket ethernet_bsd.c:416
    #1 0x4500c in SVPublisher_publish sv_publisher.c:488
    #2 0x1acc7 in main sv_publisher_example.c:70
    #3 0xa1541394 in start (libdyld.dylib:i386+0x5394)

==77056==Register values:
eax = 0x00000000  ebx = 0x00000000  ecx = 0x20000000  edx = 0x00000000
edi = 0x00000000  esi = 0x02f03880  ebp = 0xbffe6a18  esp = 0xbffe69e0
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ethernet_bsd.c:416 in Ethernet_sendPacket
==77056==ABORTING
Abort trap: 6
@mzillgith
Copy link
Contributor

Reason is an invalid interface id given at the command line or in general by the user application as an input for the Ethernet_create function. For now the library user has to ensure to provide a correct interface ID. Library side error handling will be added in version 1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants