c-for-go icon indicating copy to clipboard operation
c-for-go copied to clipboard

cannot determine size of struct sockaddr_in

Open XVilka opened this issue 7 years ago • 10 comments

/usr/local/include/libr/r_socket.h:65:21: cannot determine size of struct sockaddr_in (and 1 more errors)

Here is the line causing it https://github.com/radare/radare2/blob/master/libr/include/r_socket.h#L65

radare2.yml contents:


---
GENERATOR:
    PackageName: radare2
    PackageDescription: "Package radare2 provides Go bindings for radare2 reverse engineering library"
    PackageLicense: "LGPLv3"
    PkgConfigOpts: [libr]
    Includes: ['/usr/local/include/libr/r_core.h', '/usr/local/include/libr/r_asm.h', '/usr/local/include/libr/r_anal.h', '/usr/local/include/libr/r_bin.h', '/usr/local/include/libr/r_debug.h', '/usr/local/include/libr/r_io.h', '/usr/local/include/libr/r_config.h', '/usr/local/include/libr/r_flag.h', '/usr/local/include/libr/r_sign.h', '/usr/local/include/libr/r_hash.h', '/usr/local/include/libr/r_diff.h', '/usr/local/include/libr/r_egg.h', '/usr/local/include/libr/r_fs.h', '/usr/local/include/libr/r_lang.h', '/usr/local/include/libr/r_pdb.h']

PARSER:
    IncludePaths: ['/usr/lib/gcc/x86_64-redhat-linux/7/include', '/usr/local/include', '/usr/include', '/usr/local/include/libr', '/usr/local/include/libr/include']
    SourcesPaths: ['/usr/local/include/libr/r_core.h', '/usr/local/include/libr/r_asm.h', '/usr/local/include/libr/r_anal.h', '/usr/local/include/libr/r_bin.h', '/usr/local/include/libr/r_debug.h', '/usr/local/include/libr/r_io.h', '/usr/local/include/libr/r_config.h', '/usr/local/include/libr/r_flag.h', '/usr/local/include/libr/r_sign.h', '/usr/local/include/libr/r_hash.h', '/usr/local/include/libr/r_diff.h', '/usr/local/include/libr/r_egg.h', '/usr/local/include/libr/r_fs.h', '/usr/local/include/libr/r_lang.h', '/usr/local/include/libr/r_pdb.h']
    Defines:
        __UNIX__: 1

TRANSLATOR:
    ConstRules:
        defines: eval
    Rules:
        global:
            - {action: accept, from "^r_"}
            - {transform: export}
        private:
            - {transform: unexport}

XVilka avatar Feb 16 '18 07:02 XVilka

@cznic I'm requesting your help there, pls

xlab avatar Feb 16 '18 11:02 xlab

@xlab I hope to look into it tomorrow. Stay tuned please ;-)

cznic avatar Feb 16 '18 11:02 cznic

So I tried to reproduce the issue, but so far I was not even able to find libr or what it should be with my package manager (OpenSuse) and I'd prefer not installing random headers into my system include folders.

I suggest to create a preferably mimimized but standalone example and including it in a new at cznic/cc. I'm affraid that without such help I'm probably unable to help to resolve the issue.

cznic avatar Feb 18 '18 09:02 cznic

Sure. Will prepare the minimal example.

XVilka avatar Feb 18 '18 10:02 XVilka

Strange, I tried to make a small testcase, but it does work, unlike the radare2 example. cgo.zip

XVilka avatar Feb 21 '18 08:02 XVilka

Retried again, this error still present. See https://github.com/radareorg/radare2-bindings#usage If I run

./genbind.py -o /tmp/qwe -l go

it will produce radare2.yml and will print this error.

XVilka avatar Oct 21 '19 08:10 XVilka

@XVilka will check on this week, thanks for the update.

xlab avatar Oct 21 '19 10:10 xlab

Have you had a chance to look?

XVilka avatar Nov 27 '19 14:11 XVilka

Error is still here - tried with the latest c-for-go and radare2.

XVilka avatar Mar 05 '20 05:03 XVilka

Let me know how we can solve it.

XVilka avatar May 21 '20 06:05 XVilka