Menu

#1378 SysGetservbyname(...) gives Segmentation fault

5.0.0
closed
Erich
None
none
1
2023-01-01
2016-05-10
PaulD
No

Operating System: z/Linux
Distribution: SLES11 SP4
Hardware: IBM System z114
Version ooRexx v4.20 64-bit : Installed from rpm download. Source code was also downloaded and code rebuilt to get the "librxunixsys.so" module made specifically on this platform - same error.

Sample program:
/ /
h = SysGethostname();
Say "SysGethostname() : " h ;
s=0;
s = SysGetservbyname("db2c_lxszins1", "TCP", "p");
Say "SysGetservbyname('db2c_lxszins1', 'TCP', 'p') : " s ;

::REQUIRES "rxunixsys" LIBRARY

Test run:
$-3>rexx testutil.rexx
SysGethostname() : sbxlnx
Segmentation fault
$-3>

Discussion

  • PaulD

    PaulD - 2016-05-10

    REXX "/ /" header got replaced to "/ /" in supplied sample program above. Plase modify before running the sample.

     
  • Erich

    Erich - 2016-05-11
    • status: open --> accepted
    • assigned_to: Erich
    • Pending work items: none --> tests
    • Group: v4.2.0 --> 5.0.0
     
  • Erich

    Erich - 2016-05-11

    Committed revision [r11045] to main\branches\4.2
    Committed revision [r11046] to main\trunk

    Needs to be tested - Paul, can you do a build from branches\4.2 and confirm?

     

    Related

    Commit: [r11045]
    Commit: [r11046]

  • Anonymous

    Anonymous - 2016-05-12

    Erich, thanks for the update. I am sorry my system is not directly connected to the internet, and so cannot do downloads. In any case I have to ask our internal folks to do downloads for us from non-vendor sites.

    Can you please provide a direct link that I can pass to our folks to download the source for building. Thanks.

     
  • Anonymous

    Anonymous - 2016-05-12

    Erich, never mind - I have the links.

    Regards. PaulD.

     
  • Anonymous

    Anonymous - 2016-05-12

    Providing feedback - downloaded updates and now function "SysGetservbyname(...)" works.

    One observation though is that if I code the "proto" parameter in uppercase it returns nothing. Code it in lower case and it works OK. In other words;

    s = SysGetservbyname("db2c_lxszins1", "tcp", "p"); <=== works.
    s = SysGetservbyname("db2c_lxszins1", "TCP", "p"); <=== does not work!

    In our "/etc/services" file the service entries are coded like this:
    ...
    db2c_lxszins1 4461/tcp # DB2-Remote Relational Database Access
    db2c_lxszins1 4461/udp # DB2-Remote Relational Database Access
    ...
    As a developer I should not have to worry, or know, as to how the services file is cased.

     
  • Erich

    Erich - 2016-05-12
    • status: accepted --> pending
    • Pending work items: tests --> none
     
  • Erich

    Erich - 2016-05-12

    downloaded updates and now function "SysGetservbyname(...)" works.

    Thanks for the feedback

    if I code the "proto" parameter in uppercase it returns nothing

    Paul, as far as i understand, /etc/services entries are case-sensitive (although most commonly lowercase), and so are any args to SysGetservbyname(), which Rexx then simply hands over to the C function getservbyname()

     
  • Anonymous

    Anonymous - 2016-05-16

    Erich, just an observation; In section 6.2 of the "Unix Extensions Function Reference" PDF manual, the option choices for the "proto" paramter are printed in uppercase. That is what I followed exactly and of course that does not work in our case.

     
  • Erich

    Erich - 2016-07-06

    Updated docs to state that args name and proto are case-sensitive.
    Updated examples.
    Committed as revision [r11088]

     

    Related

    Commit: [r11088]

  • Rony G. Flatscher

    • Status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB