Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8530289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:13:33+00:00 2026-06-11T09:13:33+00:00

I’m having an odd issue with this timer call. It works on my test

  • 0

I’m having an odd issue with this timer call. It works on my test system (x64), but when I load it into the target system, running i386 linux and compile there, it compiles fine but throws a segmentation fault. Here’s the suspected code:

507: int SwitchData = 0xFF,s, retval = EX_SOFTWARE;
508: struct sigevent sev;
509: struct itimerspec ts;
510: timer_t *tid;

snip

517: if(EX_OK != retval)
518: {
519:     fprintf(stderr,"init failed\n");
520:     return EX_SOFTWARE;
521: }
522: //notify via thread
    523:    sev.sigev_notify = SIGEV_THREAD;
    524:    sev.sigev_notify_function = SwitchThreadHandler;
    525:    sev.sigev_notify_attributes = NULL;
    526:    sev.sigev_value.sival_ptr = tid;
    527:    ts.it_interval.tv_sec = 0;
    528:    ts.it_interval.tv_nsec = 200000000;
    529:    if(-1 == timer_create(CLOCK_REALTIME,&sev,tid))
    530:    {
    531:        retval = EX_SOFTWARE;
    532:        fprintf(stderr,"Failed to create timer.");
    533:        return retval;
    534:    }
    535:    timer_settime(tid,0,&ts,NULL);

So, the backtrace points to timer_create as the cause. Test system is Kernel 3.0.0-24-generic, target is 3.0.0-17-generic. Both systems are gcc v4.6.1. They’re both running installs of ubuntu 11.10.

Here’s the output of catchsegv when run against it:

*** Segmentation fault
Register dump:

EAX: 005c6ff4   EBX: 003daff4   ECX: 00000000   EDX: 00000001
ESI: 003db228   EDI: 00000000   EBP: 09ba00d0   ESP: bf96b2c8

EIP: 003d7058   EFLAGS: 00010292

CS: 0073   DS: 007b   ES: 007b   FS: 0000   GS: 0033   SS: 007b

Trap: 0000000e   Error: 00000007   OldMask: 00000000
ESP/signal: bf96b2c8   CR2: 005c6ff4

FPUCW: ffff037f   FPUSW: ffff0000   TAG: ffffffff
IPOFF: 00000000   CSSEL: 0000   DATAOFF: 00000000   DATASEL: 0000

ST(0) 0000 0000000000000000   ST(1) 0000 0000000000000000
ST(2) 0000 0000000000000000   ST(3) 0000 0000000000000000
ST(4) 0000 0000000000000000   ST(5) 0000 0000000000000000
ST(6) 0000 0000000000000000   ST(7) 0000 0000000000000000

Backtrace:
/lib/i386-linux-gnu/librt.so.1(timer_create+0x208)[0x3d7058]
/home/vislink/aircam/AircamFrontPanel/FrontPanel.c:529(main)[0x8048fd6]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x466113]
??:0(_start)[0x80488c1]

Memory map:

00240000-00257000 r-xp 00000000 08:01 131477 /lib/i386-linux-gnu/libpthread-2.13.so
00257000-00258000 r--p 00016000 08:01 131477 /lib/i386-linux-gnu/libpthread-2.13.so
00258000-00259000 rw-p 00017000 08:01 131477 /lib/i386-linux-gnu/libpthread-2.13.so
00259000-0025b000 rw-p 00000000 00:00 0
003d3000-003da000 r-xp 00000000 08:01 131479 /lib/i386-linux-gnu/librt-2.13.so
003da000-003db000 r--p 00006000 08:01 131479 /lib/i386-linux-gnu/librt-2.13.so
003db000-003dc000 rw-p 00007000 08:01 131479 /lib/i386-linux-gnu/librt-2.13.so
00447000-0044b000 r-xp 00000000 08:01 310504 /usr/local/lib/libmpsse.so
0044b000-0044c000 r--p 00003000 08:01 310504 /usr/local/lib/libmpsse.so
0044c000-0044d000 rw-p 00004000 08:01 310504 /usr/local/lib/libmpsse.so
0044d000-005c5000 r-xp 00000000 08:01 131463 /lib/i386-linux-gnu/libc-2.13.so
005c5000-005c7000 r--p 00178000 08:01 131463 /lib/i386-linux-gnu/libc-2.13.so
005c7000-005c8000 rw-p 0017a000 08:01 131463 /lib/i386-linux-gnu/libc-2.13.so
005c8000-005cb000 rw-p 00000000 00:00 0
00600000-00603000 r-xp 00000000 08:01 131480 /lib/i386-linux-gnu/libSegFault.so
00603000-00604000 r--p 00002000 08:01 131480 /lib/i386-linux-gnu/libSegFault.so
00604000-00605000 rw-p 00003000 08:01 131480 /lib/i386-linux-gnu/libSegFault.so
0081f000-0083d000 r-xp 00000000 08:01 131460 /lib/i386-linux-gnu/ld-2.13.so
0083d000-0083e000 r--p 0001d000 08:01 131460 /lib/i386-linux-gnu/ld-2.13.so
0083e000-0083f000 rw-p 0001e000 08:01 131460 /lib/i386-linux-gnu/ld-2.13.so
0093c000-00942000 r-xp 00000000 08:01 308124 /usr/local/lib/libftdi.so.1.20.0
00942000-00943000 r--p 00005000 08:01 308124 /usr/local/lib/libftdi.so.1.20.0
00943000-00944000 rw-p 00006000 08:01 308124 /usr/local/lib/libftdi.so.1.20.0
00a98000-00a9f000 r-xp 00000000 08:01 131345 /lib/libusb-0.1.so.4.4.4
00a9f000-00aa0000 r--p 00006000 08:01 131345 /lib/libusb-0.1.so.4.4.4
00aa0000-00aa1000 rw-p 00007000 08:01 131345 /lib/libusb-0.1.so.4.4.4
00aa1000-00aa2000 rw-p 00000000 00:00 0
00d22000-00d3e000 r-xp 00000000 08:01 130812 /lib/i386-linux-gnu/libgcc_s.so.1
00d3e000-00d3f000 r--p 0001b000 08:01 130812 /lib/i386-linux-gnu/libgcc_s.so.1
00d3f000-00d40000 rw-p 0001c000 08:01 130812 /lib/i386-linux-gnu/libgcc_s.so.1
00d56000-00d57000 r-xp 00000000 00:00 0 [vdso]
08048000-0804b000 r-xp 00000000 08:01 342 /home/vislink/aircam/AircamFrontPanel/debugimage
0804b000-0804c000 r--p 00003000 08:01 342 /home/vislink/aircam/AircamFrontPanel/debugimage
0804c000-0804d000 rw-p 00004000 08:01 342 /home/vislink/aircam/AircamFrontPanel/debugimage
09b9c000-09bc1000 rw-p 00000000 00:00 0 [heap]
b7704000-b7707000 rw-p 00000000 00:00 0
b7711000-b7712000 ---p 00000000 00:00 0
b7712000-b7717000 rw-p 00000000 00:00 0
bf94b000-bf96c000 rw-p 00000000 00:00 0 [stack]

Not sure of the best way to proceed. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:13:34+00:00Added an answer on June 11, 2026 at 9:13 am

    tid is an uninitialized pointer. You have to declare an object of type timer_t and pass a pointer to that object to timer_create. You can’t just create a pointer object of type timer_t * with indeterminate value and pass that indeterminate value to timer_create.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.